flizzer_tracker.h 1.6 KB

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