flizzer_tracker.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. #pragma once
  2. #include <cli/cli.h>
  3. #include <furi.h>
  4. #include <gui/gui.h>
  5. #include <input/input.h>
  6. #include <notification/notification_messages.h>
  7. #include <stdio.h>
  8. #include <u8g2_glue.h>
  9. #include <gui/view_dispatcher.h>
  10. #include <gui/modules/text_input.h>
  11. #include "flizzer_tracker_hal.h"
  12. #include "sound_engine/freqs.h"
  13. #include "sound_engine/sound_engine_defs.h"
  14. #include "sound_engine/sound_engine_filter.h"
  15. #include "tracker_engine/tracker_engine_defs.h"
  16. #define MIDDLE_C (12 * 4)
  17. #define MAX_NOTE (12 * 7 + 11)
  18. typedef enum
  19. {
  20. EventTypeInput,
  21. } EventType;
  22. typedef struct
  23. {
  24. EventType type;
  25. InputEvent input;
  26. uint32_t period;
  27. } FlizzerTrackerEvent;
  28. typedef enum
  29. {
  30. PATTERN_VIEW,
  31. INST_EDITOR_VIEW,
  32. EXPORT_WAV_VIEW,
  33. } TrackerMode;
  34. typedef enum
  35. {
  36. EDIT_PATTERN,
  37. EDIT_SEQUENCE,
  38. EDIT_SONGINFO,
  39. EDIT_INSTRUMENT,
  40. EDIT_PROGRAM,
  41. } TrackerFocus;
  42. typedef enum
  43. {
  44. SI_PATTERNPOS,
  45. SI_SEQUENCEPOS,
  46. SI_SONGSPEED,
  47. SI_SONGRATE,
  48. SI_MASTERVOL,
  49. SI_SONGNAME,
  50. SI_CURRENTINSTRUMENT,
  51. SI_INSTRUMENTNAME,
  52. /* ======== */
  53. SI_PARAMS,
  54. } SongInfoParam;
  55. typedef struct
  56. {
  57. View *view;
  58. void *context;
  59. } TrackerView;
  60. typedef enum
  61. {
  62. VIEW_TRACKER,
  63. VIEW_KEYBOARD,
  64. VIEW_FILE_MANAGER,
  65. VIEW_SUBMENU,
  66. } FlizzerTrackerViews;
  67. typedef struct
  68. {
  69. NotificationApp *notification;
  70. FuriMessageQueue *event_queue;
  71. Gui *gui;
  72. TrackerView *tracker_view;
  73. ViewDispatcher *view_dispatcher;
  74. TextInput* text_input;
  75. bool was_it_back_keypress;
  76. uint32_t current_time;
  77. uint32_t period;
  78. SoundEngine sound_engine;
  79. TrackerEngine tracker_engine;
  80. TrackerSong song;
  81. uint8_t selected_param;
  82. uint8_t mode, focus;
  83. uint8_t patternx, current_channel, current_digit, program_step, current_instrument, current_note;
  84. bool editing;
  85. bool was_editing;
  86. bool quit;
  87. } FlizzerTrackerApp;
  88. typedef struct
  89. {
  90. FlizzerTrackerApp *tracker;
  91. } TrackerViewModel;