-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflizzer_tracker.h
187 lines (153 loc) · 3.32 KB
/
flizzer_tracker.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
#pragma once
#include <cli/cli.h>
#include <dialogs/dialogs.h>
#include <furi.h>
#include <gui/gui.h>
#include <gui/modules/submenu.h>
#include <input/input.h>
#include <notification/notification_messages.h>
#include <stdio.h>
#include <toolbox/stream/file_stream.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_RETURN,
SUBMENU_PATTERN_EXIT,
} PatternSubmenuParams;
typedef enum
{
SUBMENU_INSTRUMENT_RETURN,
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);