| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185 |
- #pragma once
- #include <cli/cli.h>
- #include <furi.h>
- #include <gui/gui.h>
- #include <input/input.h>
- #include <notification/notification_messages.h>
- #include <dialogs/dialogs.h>
- #include <gui/modules/submenu.h>
- #include <toolbox/stream/file_stream.h>
- #include <stdio.h>
- #include <u8g2_glue.h>
- #include <gui/modules/text_input.h>
- #include <gui/view_dispatcher.h>
- #include "flizzer_tracker_hal.h"
- #include "sound_engine/freqs.h"
- #include "sound_engine/sound_engine_defs.h"
- #include "sound_engine/sound_engine_filter.h"
- #include "tracker_engine/tracker_engine_defs.h"
- typedef enum
- {
- EventTypeInput,
- } EventType;
- typedef struct
- {
- EventType type;
- InputEvent input;
- uint32_t period;
- } FlizzerTrackerEvent;
- typedef enum
- {
- PATTERN_VIEW,
- INST_EDITOR_VIEW,
- EXPORT_WAV_VIEW,
- } TrackerMode;
- typedef enum
- {
- EDIT_PATTERN,
- EDIT_SEQUENCE,
- EDIT_SONGINFO,
- EDIT_INSTRUMENT,
- EDIT_PROGRAM,
- } TrackerFocus;
- typedef enum
- {
- SI_PATTERNPOS,
- SI_SEQUENCEPOS,
- SI_SONGSPEED,
- SI_SONGRATE,
- SI_MASTERVOL,
- SI_SONGNAME,
- SI_CURRENTINSTRUMENT,
- SI_INSTRUMENTNAME,
- /* ======== */
- SI_PARAMS,
- } SongInfoParam;
- typedef enum
- {
- INST_CURRENTINSTRUMENT,
- INST_INSTRUMENTNAME,
- INST_CURRENT_NOTE,
- INST_FINETUNE,
- INST_SLIDESPEED,
- INST_SETPW,
- INST_PW,
- INST_SETCUTOFF,
- INST_WAVE_NOISE,
- INST_WAVE_PULSE,
- INST_WAVE_TRIANGLE,
- INST_WAVE_SAWTOOTH,
- INST_WAVE_NOISE_METAL,
- INST_WAVE_SINE,
- INST_ATTACK,
- INST_DECAY,
- INST_SUSTAIN,
- INST_RELEASE,
- INST_VOLUME,
- INST_ENABLEFILTER,
- INST_FILTERCUTOFF,
- INST_FILTERRESONANCE,
- INST_FILTERTYPE,
- INST_ENABLERINGMOD,
- INST_RINGMODSRC,
- INST_ENABLEHARDSYNC,
- INST_HARDSYNCSRC,
- INST_RETRIGGERONSLIDE,
- INST_ENABLEKEYSYNC,
- INST_ENABLEVIBRATO,
- INST_VIBRATOSPEED,
- INST_VIBRATODEPTH,
- INST_VIBRATODELAY,
- INST_ENABLEPWM,
- INST_PWMSPEED,
- INST_PWMDEPTH,
- INST_PWMDELAY,
- INST_PROGRAMEPERIOD,
- /* ========= */
- INST_PARAMS,
- } InstrumentParam;
- typedef struct
- {
- View *view;
- void *context;
- } TrackerView;
- typedef enum
- {
- VIEW_TRACKER,
- VIEW_KEYBOARD,
- VIEW_FILE_MANAGER,
- VIEW_SUBMENU_PATTERN,
- VIEW_SUBMENU_INSTRUMENT,
- } FlizzerTrackerViews;
- typedef enum
- {
- SUBMENU_PATTERN_EXIT,
- } PatternSubmenuParams;
- typedef enum
- {
- SUBMENU_INSTRUMENT_EXIT,
- } InstrumentSubmenuParams;
- typedef struct
- {
- NotificationApp *notification;
- FuriMessageQueue *event_queue;
- Gui *gui;
- TrackerView *tracker_view;
- ViewDispatcher *view_dispatcher;
- TextInput *text_input;
- Stream* stream;
- DialogsApp* dialogs;
- Submenu* pattern_submenu;
- Submenu* instrument_submenu;
- bool was_it_back_keypress;
- uint32_t current_time;
- uint32_t period;
- SoundEngine sound_engine;
- TrackerEngine tracker_engine;
- TrackerSong song;
- uint8_t selected_param;
- uint8_t mode, focus;
- uint8_t patternx, current_channel, current_digit, program_step, current_instrument, current_note;
- uint8_t inst_editor_shift;
- bool editing;
- bool was_editing;
- bool quit;
- } FlizzerTrackerApp;
- typedef struct
- {
- FlizzerTrackerApp *tracker;
- } TrackerViewModel;
- void draw_callback(Canvas *canvas, void *ctx);
- bool input_callback(InputEvent *input_event, void *ctx);
|