diff options
author | Bad Diode <bd@badd10de.dev> | 2023-07-12 19:34:25 +0200 |
---|---|---|
committer | Bad Diode <bd@badd10de.dev> | 2023-07-12 19:34:25 +0200 |
commit | 8fa42f9f9107f460b49fa7ab171529942e66e7ea (patch) | |
tree | 3965abb20cfcf43173841543e115cfb1f550450c | |
parent | 20b1b448b7a1c8e22cb2e0f2d6294533f7a220af (diff) | |
download | stepper-8fa42f9f9107f460b49fa7ab171529942e66e7ea.tar.gz stepper-8fa42f9f9107f460b49fa7ab171529942e66e7ea.zip |
Add optional help prompt to the notif bar
-rw-r--r-- | src/drawing.c | 39 | ||||
-rw-r--r-- | src/main.c | 1 | ||||
-rw-r--r-- | src/sequencer.c | 1 | ||||
-rw-r--r-- | src/settings.c | 14 | ||||
-rw-r--r-- | src/settings.h | 15 |
5 files changed, 64 insertions, 6 deletions
diff --git a/src/drawing.c b/src/drawing.c index b488ed1..18504bc 100644 --- a/src/drawing.c +++ b/src/drawing.c | |||
@@ -1261,11 +1261,40 @@ draw_notif_bar() { | |||
1261 | } | 1261 | } |
1262 | txt_drawf_small(msg, x0 + 2, y0 + 1, color); | 1262 | txt_drawf_small(msg, x0 + 2, y0 + 1, color); |
1263 | } else { | 1263 | } else { |
1264 | // if (notif.time > -16) { | 1264 | if (settings.help == HELP_ON) { |
1265 | // notif.time--; | 1265 | if (input_handler == handle_trigger_selection || |
1266 | // return; | 1266 | input_handler == handle_channel_selection) { |
1267 | // } | 1267 | txt_drawf_small("L/R:NOTE A:PARAMS B:TOGGLE", x0 + 2, y0 + 1, color); |
1268 | // TODO: More context dependent messages? Use instructions? | 1268 | } else if (input_handler == handle_param_selection_sq1 || |
1269 | input_handler == handle_param_selection_sq2 || | ||
1270 | input_handler == handle_param_selection_wave || | ||
1271 | input_handler == handle_param_selection_noise) { | ||
1272 | txt_drawf_small("L/R:ADJUST SELECT:COPY", x0 + 2, y0 + 1, color); | ||
1273 | } else if (input_handler == handle_pattern_selection) { | ||
1274 | txt_drawf_small("L/R:CHAIN A:PARAMS B:QUEUE", x0 + 2, y0 + 1, color); | ||
1275 | } else if (input_handler == handle_right_col_selection) { | ||
1276 | if (right_col_selection_loc == R_COL_STOP) { | ||
1277 | txt_drawf_small("B:STOP", x0 + 2, y0 + 1, color); | ||
1278 | } else if (right_col_selection_loc == R_COL_PLAY) { | ||
1279 | if (play_status == 0) { | ||
1280 | txt_drawf_small("B:PLAY", x0 + 2, y0 + 1, color); | ||
1281 | } else { | ||
1282 | txt_drawf_small("B:PAUSE", x0 + 2, y0 + 1, color); | ||
1283 | } | ||
1284 | } else if (right_col_selection_loc == R_COL_BPM) { | ||
1285 | txt_drawf_small("L/R:TEMPO", x0 + 2, y0 + 1, color); | ||
1286 | } else if (right_col_selection_loc == R_COL_SETTINGS) { | ||
1287 | txt_drawf_small("B:SETTINGS", x0 + 2, y0 + 1, color); | ||
1288 | } else if (right_col_selection_loc == R_COL_BANK_A || | ||
1289 | right_col_selection_loc == R_COL_BANK_B || | ||
1290 | right_col_selection_loc == R_COL_BANK_C || | ||
1291 | right_col_selection_loc == R_COL_BANK_D) { | ||
1292 | txt_drawf_small("B:SAVE CURRENT BANK AND SWITCH", x0 + 2, y0 + 1, color); | ||
1293 | } | ||
1294 | } | ||
1295 | return; | ||
1296 | } | ||
1297 | |||
1269 | if (play_status == 0) { | 1298 | if (play_status == 0) { |
1270 | txt_drawf_small("STOPPED", x0 + 2, y0 + 1, color); | 1299 | txt_drawf_small("STOPPED", x0 + 2, y0 + 1, color); |
1271 | } else { | 1300 | } else { |
@@ -115,6 +115,7 @@ render_settings(void) { | |||
115 | txt_printf(" SYNC: %s\n\n", sync_setting_str[settings.sync]); | 115 | txt_printf(" SYNC: %s\n\n", sync_setting_str[settings.sync]); |
116 | txt_printf(" THEME: %s\n\n", theme_setting_str[settings.theme]); | 116 | txt_printf(" THEME: %s\n\n", theme_setting_str[settings.theme]); |
117 | txt_printf(" CURSOR: %s\n\n", cursor_setting_str[settings.cursor]); | 117 | txt_printf(" CURSOR: %s\n\n", cursor_setting_str[settings.cursor]); |
118 | txt_printf(" HELP: %s\n\n", help_setting_str[settings.help]); | ||
118 | txt_render(); | 119 | txt_render(); |
119 | txt_clear(); | 120 | txt_clear(); |
120 | PROF(draw_settings_cursor(), draw_cursor_cycles); | 121 | PROF(draw_settings_cursor(), draw_cursor_cycles); |
diff --git a/src/sequencer.c b/src/sequencer.c index a22c219..5b70bb2 100644 --- a/src/sequencer.c +++ b/src/sequencer.c | |||
@@ -70,6 +70,7 @@ play_step(void) { | |||
70 | | sound_rates[trig->note]; | 70 | | sound_rates[trig->note]; |
71 | } | 71 | } |
72 | } else { | 72 | } else { |
73 | SOUND_SQUARE1_SWEEP = 0; | ||
73 | SOUND_SQUARE1_CTRL = 0; | 74 | SOUND_SQUARE1_CTRL = 0; |
74 | SOUND_SQUARE1_FREQ = 0; | 75 | SOUND_SQUARE1_FREQ = 0; |
75 | } | 76 | } |
diff --git a/src/settings.c b/src/settings.c index 2c698d1..d2491b8 100644 --- a/src/settings.c +++ b/src/settings.c | |||
@@ -102,6 +102,13 @@ handle_settings_input(void) { | |||
102 | settings.cursor++; | 102 | settings.cursor++; |
103 | } | 103 | } |
104 | } break; | 104 | } break; |
105 | case 3: { | ||
106 | if ((settings.help + 1) >= HELP_NUM) { | ||
107 | settings.help = 0; | ||
108 | } else { | ||
109 | settings.help++; | ||
110 | } | ||
111 | } break; | ||
105 | } | 112 | } |
106 | save_metadata(); | 113 | save_metadata(); |
107 | clear_screen = true; | 114 | clear_screen = true; |
@@ -131,6 +138,13 @@ handle_settings_input(void) { | |||
131 | settings.cursor--; | 138 | settings.cursor--; |
132 | } | 139 | } |
133 | } break; | 140 | } break; |
141 | case 3: { | ||
142 | if (settings.help == 0) { | ||
143 | settings.help = HELP_NUM - 1; | ||
144 | } else { | ||
145 | settings.help--; | ||
146 | } | ||
147 | } break; | ||
134 | } | 148 | } |
135 | save_metadata(); | 149 | save_metadata(); |
136 | clear_screen = true; | 150 | clear_screen = true; |
diff --git a/src/settings.h b/src/settings.h index 1a45d75..c3e035e 100644 --- a/src/settings.h +++ b/src/settings.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef SETTINGS_H | 1 | #ifndef SETTINGS_H |
2 | #define SETTINGS_H | 2 | #define SETTINGS_H |
3 | 3 | ||
4 | #define N_SETTINGS 3 | 4 | #define N_SETTINGS 4 |
5 | 5 | ||
6 | typedef enum SyncSetting { | 6 | typedef enum SyncSetting { |
7 | SYNC_NONE = 0, | 7 | SYNC_NONE = 0, |
@@ -62,10 +62,23 @@ char * cursor_setting_str[] = { | |||
62 | "THICK LINE", | 62 | "THICK LINE", |
63 | }; | 63 | }; |
64 | 64 | ||
65 | typedef enum HelpSetting { | ||
66 | HELP_OFF = 0, | ||
67 | HELP_ON, | ||
68 | HELP_NUM, | ||
69 | } HelpSetting; | ||
70 | |||
71 | char * help_setting_str[] = { | ||
72 | "OFF", | ||
73 | "ON", | ||
74 | }; | ||
75 | |||
65 | typedef struct Settings { | 76 | typedef struct Settings { |
66 | SyncSetting sync; | 77 | SyncSetting sync; |
67 | ThemeSetting theme; | 78 | ThemeSetting theme; |
68 | CursorSetting cursor; | 79 | CursorSetting cursor; |
80 | HelpSetting help; | ||
81 | u8 reserved[63]; | ||
69 | } Settings; | 82 | } Settings; |
70 | 83 | ||
71 | #endif // SETTINGS_H | 84 | #endif // SETTINGS_H |