flizzer_tracker.h 1.4 KB

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