diff options
author | Bad Diode <bd@badd10de.dev> | 2023-07-22 11:44:35 +0200 |
---|---|---|
committer | Bad Diode <bd@badd10de.dev> | 2023-07-22 11:44:35 +0200 |
commit | 8585ffba82eab7f8e80bdac12773aa1f2e9e6915 (patch) | |
tree | 9880a5c3938d09bb6edd109de835618d8ae7ee5e | |
parent | 22225331c93b254aa926d76d2c50b5438f12586d (diff) | |
download | stepper-8585ffba82eab7f8e80bdac12773aa1f2e9e6915.tar.gz stepper-8585ffba82eab7f8e80bdac12773aa1f2e9e6915.zip |
Add percent drawing when needed on notif params
-rw-r--r-- | src/drawing.c | 347 |
1 files changed, 120 insertions, 227 deletions
diff --git a/src/drawing.c b/src/drawing.c index c076886..a48a1ea 100644 --- a/src/drawing.c +++ b/src/drawing.c | |||
@@ -744,14 +744,29 @@ draw_parameters_wave(ChannelWaveParams *params, bool global) { | |||
744 | 744 | ||
745 | // Wave volume. | 745 | // Wave volume. |
746 | { | 746 | { |
747 | size_t x = PARAMS_START_X + PARAMS_BOX_OFFSET_X; | 747 | size_t x = PARAMS_START_X + PARAMS_BOX_OFFSET_X + 3; |
748 | size_t y = PARAMS_START_Y + PARAMS_BOX_OFFSET_Y; | 748 | size_t y = PARAMS_START_Y + PARAMS_BOX_OFFSET_Y + 5; |
749 | switch (params->wave_volume) { | 749 | switch (params->wave_volume) { |
750 | case 0: { txt_drawf("0", x + 12, y + 5, col_fg); } break; | 750 | case 0: { |
751 | case 1: { txt_drawf("25", x + 9, y + 5, col_fg); } break; | 751 | txt_drawf("0", x + 6, y, col_fg); |
752 | case 2: { txt_drawf("50", x + 9, y + 5, col_fg); } break; | 752 | txt_drawc('%', x + 12, y, col_fg); |
753 | case 3: { txt_drawf("75", x + 9, y + 5, col_fg); } break; | 753 | } break; |
754 | case 4: { txt_drawf("100", x + 6, y + 5, col_fg); } break; | 754 | case 1: { |
755 | txt_drawf("25", x + 3, y, col_fg); | ||
756 | txt_drawc('%', x + 15, y, col_fg); | ||
757 | } break; | ||
758 | case 2: { | ||
759 | txt_drawf("50", x + 3, y, col_fg); | ||
760 | txt_drawc('%', x + 15, y, col_fg); | ||
761 | } break; | ||
762 | case 3: { | ||
763 | txt_drawf("75", x + 3, y, col_fg); | ||
764 | txt_drawc('%', x + 15, y, col_fg); | ||
765 | } break; | ||
766 | case 4: { | ||
767 | txt_drawf("100", x, y, col_fg); | ||
768 | txt_drawc('%', x + 18, y, col_fg); | ||
769 | } break; | ||
755 | } | 770 | } |
756 | } | 771 | } |
757 | 772 | ||
@@ -892,14 +907,14 @@ draw_parameters_square(ChannelSquareParams *params, bool sweep, bool global) { | |||
892 | // Time. | 907 | // Time. |
893 | x += PARAMS_BOX_OFFSET_X; | 908 | x += PARAMS_BOX_OFFSET_X; |
894 | switch (params->sweep_time) { | 909 | switch (params->sweep_time) { |
895 | case 0: { txt_drawf("0", x + 12, y + 5, col_fg); } break; | 910 | case 0: { txt_drawf("Off", x + 6, y + 5, col_fg); } break; |
896 | case 1: { txt_drawf("1", x + 12, y + 5, col_fg); } break; | 911 | case 1: { txt_drawf("7ms", x + 6, y + 5, col_fg); } break; |
897 | case 2: { txt_drawf("2", x + 12, y + 5, col_fg); } break; | 912 | case 2: { txt_drawf("15ms", x + 3, y + 5, col_fg); } break; |
898 | case 3: { txt_drawf("3", x + 12, y + 5, col_fg); } break; | 913 | case 3: { txt_drawf("23ms", x + 3, y + 5, col_fg); } break; |
899 | case 4: { txt_drawf("4", x + 12, y + 5, col_fg); } break; | 914 | case 4: { txt_drawf("31ms", x + 3, y + 5, col_fg); } break; |
900 | case 5: { txt_drawf("5", x + 12, y + 5, col_fg); } break; | 915 | case 5: { txt_drawf("39ms", x + 3, y + 5, col_fg); } break; |
901 | case 6: { txt_drawf("6", x + 12, y + 5, col_fg); } break; | 916 | case 6: { txt_drawf("46ms", x + 3, y + 5, col_fg); } break; |
902 | case 7: { txt_drawf("7", x + 12, y + 5, col_fg); } break; | 917 | case 7: { txt_drawf("54ms", x + 3, y + 5, col_fg); } break; |
903 | } | 918 | } |
904 | 919 | ||
905 | // Direction. | 920 | // Direction. |
@@ -1161,6 +1176,76 @@ draw_piano_notes(void) { | |||
1161 | } | 1176 | } |
1162 | 1177 | ||
1163 | void | 1178 | void |
1179 | draw_notif_param_edit_prob(u8 prob, u8 x, u8 y, u8 color) { | ||
1180 | txt_drawf_small("PROB/CONDITION: ", x + 2, y + 1, color); | ||
1181 | switch (prob) { | ||
1182 | case PROB_100: { txt_drawf_small("100", x + 2 + 16 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 19 * 4, y + 1, color); } break; | ||
1183 | case PROB_80: { txt_drawf_small("80", x + 2 + 16 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 18 * 4, y + 1, color); } break; | ||
1184 | case PROB_60: { txt_drawf_small("60", x + 2 + 16 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 18 * 4, y + 1, color); } break; | ||
1185 | case PROB_40: { txt_drawf_small("40", x + 2 + 16 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 18 * 4, y + 1, color); } break; | ||
1186 | case PROB_20: { txt_drawf_small("20", x + 2 + 16 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 18 * 4, y + 1, color); } break; | ||
1187 | case PROB_FIRST: { txt_drawf_small("first bar", x + 2 + 16 * 4, y + 1, color); } break; | ||
1188 | case PROB_NOT_FIRST: { txt_drawf_small("not first bar", x + 2 + 16 * 4, y + 1, color); } break; | ||
1189 | case PROB_ONE_TWO: { txt_drawf_small("1st bar out of 2", x + 2 + 16 * 4, y + 1, color); } break; | ||
1190 | case PROB_TWO_TWO: { txt_drawf_small("2nd bar out of 2", x + 2 + 16 * 4, y + 1, color); } break; | ||
1191 | case PROB_ONE_THREE: { txt_drawf_small("1st bar out of 3", x + 2 + 16 * 4, y + 1, color); } break; | ||
1192 | case PROB_TWO_THREE: { txt_drawf_small("2nd bar out of 3", x + 2 + 16 * 4, y + 1, color); } break; | ||
1193 | case PROB_THREE_THREE: { txt_drawf_small("3rd bar out of 3", x + 2 + 16 * 4, y + 1, color); } break; | ||
1194 | case PROB_ONE_FOUR: { txt_drawf_small("1st bar out of 4", x + 2 + 16 * 4, y + 1, color); } break; | ||
1195 | case PROB_TWO_FOUR: { txt_drawf_small("2nd bar out of 4", x + 2 + 16 * 4, y + 1, color); } break; | ||
1196 | case PROB_THREE_FOUR: { txt_drawf_small("3rd bar out of 4", x + 2 + 16 * 4, y + 1, color); } break; | ||
1197 | case PROB_FOUR_FOUR: { txt_drawf_small("4th bar out of 4", x + 2 + 16 * 4, y + 1, color); } break; | ||
1198 | } | ||
1199 | } | ||
1200 | |||
1201 | void | ||
1202 | draw_notif_param_env_vol(u8 vol, u8 x, u8 y, u8 color) { | ||
1203 | txt_drawf_small("VOL: ", x + 2, y + 1, color); | ||
1204 | switch (vol) { | ||
1205 | case 0: { txt_drawf_small("0", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 6 * 4, y + 1, color); } break; | ||
1206 | case 1: { txt_drawf_small("6", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 6 * 4, y + 1, color); } break; | ||
1207 | case 2: { txt_drawf_small("13", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; | ||
1208 | case 3: { txt_drawf_small("20", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; | ||
1209 | case 4: { txt_drawf_small("26", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; | ||
1210 | case 5: { txt_drawf_small("33", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; | ||
1211 | case 6: { txt_drawf_small("40", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; | ||
1212 | case 7: { txt_drawf_small("46", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; | ||
1213 | case 8: { txt_drawf_small("53", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; | ||
1214 | case 9: { txt_drawf_small("60", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; | ||
1215 | case 10: { txt_drawf_small("66", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; | ||
1216 | case 11: { txt_drawf_small("73", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; | ||
1217 | case 12: { txt_drawf_small("80", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; | ||
1218 | case 13: { txt_drawf_small("86", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; | ||
1219 | case 14: { txt_drawf_small("93", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; | ||
1220 | case 15: { txt_drawf_small("100", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 8 * 4, y + 1, color); } break; | ||
1221 | } | ||
1222 | } | ||
1223 | |||
1224 | void | ||
1225 | draw_notif_param_env_time(u8 time, u8 x, u8 y, u8 color) { | ||
1226 | txt_drawf_small("TIME: ", x + 2, y + 1, color); | ||
1227 | switch (time) { | ||
1228 | case 0: { txt_drawf_small("off", x + 2 + 6 * 4, y + 1, color); } break; | ||
1229 | case 1: { txt_drawf_small("150ms", x + 2 + 6 * 4, y + 1, color); } break; | ||
1230 | case 2: { txt_drawf_small("310ms", x + 2 + 6 * 4, y + 1, color); } break; | ||
1231 | case 3: { txt_drawf_small("460ms", x + 2 + 6 * 4, y + 1, color); } break; | ||
1232 | case 4: { txt_drawf_small("620ms", x + 2 + 6 * 4, y + 1, color); } break; | ||
1233 | case 5: { txt_drawf_small("780ms", x + 2 + 6 * 4, y + 1, color); } break; | ||
1234 | case 6: { txt_drawf_small("930ms", x + 2 + 6 * 4, y + 1, color); } break; | ||
1235 | case 7: { txt_drawf_small("1s", x + 2 + 6 * 4, y + 1, color); } break; | ||
1236 | } | ||
1237 | } | ||
1238 | |||
1239 | void | ||
1240 | draw_notif_param_env_dir(u8 dir, u8 x, u8 y, u8 color) { | ||
1241 | txt_drawf_small("DIRECTION: ", x + 2, y + 1, color); | ||
1242 | switch (dir) { | ||
1243 | case 0: { txt_drawf_small("down", x + 2 + 11 * 4, y + 1, color); } break; | ||
1244 | case 1: { txt_drawf_small("up", x + 2 + 11 * 4, y + 1, color); } break; | ||
1245 | } | ||
1246 | } | ||
1247 | |||
1248 | void | ||
1164 | draw_notif_bar() { | 1249 | draw_notif_bar() { |
1165 | u8 x0 = NOTIF_START_X; | 1250 | u8 x0 = NOTIF_START_X; |
1166 | u8 y0 = NOTIF_START_Y - 7; | 1251 | u8 y0 = NOTIF_START_Y - 7; |
@@ -1200,69 +1285,12 @@ draw_notif_bar() { | |||
1200 | case 2: { txt_drawf_small("50", x0 + 2 + 7 * 4, y0 + 1, color); } break; | 1285 | case 2: { txt_drawf_small("50", x0 + 2 + 7 * 4, y0 + 1, color); } break; |
1201 | case 3: { txt_drawf_small("75", x0 + 2 + 7 * 4, y0 + 1, color); } break; | 1286 | case 3: { txt_drawf_small("75", x0 + 2 + 7 * 4, y0 + 1, color); } break; |
1202 | } | 1287 | } |
1288 | txt_drawc_small('%', x0 + 2 + 9 * 4, y0 + 1, color); | ||
1203 | } break; | 1289 | } break; |
1204 | case 1: { | 1290 | case 1: { draw_notif_param_env_vol(params->env_volume, x0, y0, color); } break; |
1205 | txt_drawf_small("VOL: ", x0 + 2, y0 + 1, color); | 1291 | case 2: { draw_notif_param_env_time(params->env_time, x0, y0, color); } break; |
1206 | switch (params->env_volume) { | 1292 | case 3: { draw_notif_param_env_dir(params->env_direction, x0, y0, color); } break; |
1207 | case 0: { txt_drawf_small("0", x0 + 2 + 5 * 4, y0 + 1, color); } break; | 1293 | case 4: { draw_notif_param_edit_prob(params->prob, x0, y0, color); } break; |
1208 | case 1: { txt_drawf_small("6", x0 + 2 + 5 * 4, y0 + 1, color); } break; | ||
1209 | case 2: { txt_drawf_small("13", x0 + 2 + 5 * 4, y0 + 1, color); } break; | ||
1210 | case 3: { txt_drawf_small("20", x0 + 2 + 5 * 4, y0 + 1, color); } break; | ||
1211 | case 4: { txt_drawf_small("26", x0 + 2 + 5 * 4, y0 + 1, color); } break; | ||
1212 | case 5: { txt_drawf_small("33", x0 + 2 + 5 * 4, y0 + 1, color); } break; | ||
1213 | case 6: { txt_drawf_small("40", x0 + 2 + 5 * 4, y0 + 1, color); } break; | ||
1214 | case 7: { txt_drawf_small("46", x0 + 2 + 5 * 4, y0 + 1, color); } break; | ||
1215 | case 8: { txt_drawf_small("53", x0 + 2 + 5 * 4, y0 + 1, color); } break; | ||
1216 | case 9: { txt_drawf_small("60", x0 + 2 + 5 * 4, y0 + 1, color); } break; | ||
1217 | case 10: { txt_drawf_small("66", x0 + 2 + 5 * 4, y0 + 1, color); } break; | ||
1218 | case 11: { txt_drawf_small("73", x0 + 2 + 5 * 4, y0 + 1, color); } break; | ||
1219 | case 12: { txt_drawf_small("80", x0 + 2 + 5 * 4, y0 + 1, color); } break; | ||
1220 | case 13: { txt_drawf_small("86", x0 + 2 + 5 * 4, y0 + 1, color); } break; | ||
1221 | case 14: { txt_drawf_small("93", x0 + 2 + 5 * 4, y0 + 1, color); } break; | ||
1222 | case 15: { txt_drawf_small("100", x0 + 2 + 5 * 4, y0 + 1, color); } break; | ||
1223 | } | ||
1224 | } break; | ||
1225 | case 2: { | ||
1226 | txt_drawf_small("TIME: ", x0 + 2, y0 + 1, color); | ||
1227 | switch (params->env_time) { | ||
1228 | case 0: { txt_drawf_small("off", x0 + 2 + 6 * 4, y0 + 1, color); } break; | ||
1229 | case 1: { txt_drawf_small("150ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; | ||
1230 | case 2: { txt_drawf_small("310ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; | ||
1231 | case 3: { txt_drawf_small("460ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; | ||
1232 | case 4: { txt_drawf_small("620ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; | ||
1233 | case 5: { txt_drawf_small("780ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; | ||
1234 | case 6: { txt_drawf_small("930ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; | ||
1235 | case 7: { txt_drawf_small("1s", x0 + 2 + 6 * 4, y0 + 1, color); } break; | ||
1236 | } | ||
1237 | } break; | ||
1238 | case 3: { | ||
1239 | txt_drawf_small("DIRECTION: ", x0 + 2, y0 + 1, color); | ||
1240 | switch (params->env_direction) { | ||
1241 | case 0: { txt_drawf_small("down", x0 + 2 + 11 * 4, y0 + 1, color); } break; | ||
1242 | case 1: { txt_drawf_small("up", x0 + 2 + 11 * 4, y0 + 1, color); } break; | ||
1243 | } | ||
1244 | } break; | ||
1245 | case 4: { | ||
1246 | txt_drawf_small("PROB/CONDITION: ", x0 + 2, y0 + 1, color); | ||
1247 | switch (params->prob) { | ||
1248 | case PROB_100: { txt_drawf_small("100", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1249 | case PROB_80: { txt_drawf_small("80", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1250 | case PROB_60: { txt_drawf_small("60", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1251 | case PROB_40: { txt_drawf_small("40", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1252 | case PROB_20: { txt_drawf_small("20", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1253 | case PROB_FIRST: { txt_drawf_small("first bar", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1254 | case PROB_NOT_FIRST: { txt_drawf_small("not first bar", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1255 | case PROB_ONE_TWO: { txt_drawf_small("1st bar out of 2", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1256 | case PROB_TWO_TWO: { txt_drawf_small("2nd bar out of 2", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1257 | case PROB_ONE_THREE: { txt_drawf_small("1st bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1258 | case PROB_TWO_THREE: { txt_drawf_small("2nd bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1259 | case PROB_THREE_THREE: { txt_drawf_small("3rd bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1260 | case PROB_ONE_FOUR: { txt_drawf_small("1st bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1261 | case PROB_TWO_FOUR: { txt_drawf_small("2nd bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1262 | case PROB_THREE_FOUR: { txt_drawf_small("3rd bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1263 | case PROB_FOUR_FOUR: { txt_drawf_small("4th bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1264 | } | ||
1265 | } break; | ||
1266 | case 5: { | 1294 | case 5: { |
1267 | txt_drawf_small("SWEEP BITS: ", x0 + 2, y0 + 1, color); | 1295 | txt_drawf_small("SWEEP BITS: ", x0 + 2, y0 + 1, color); |
1268 | switch (params->sweep_number) { | 1296 | switch (params->sweep_number) { |
@@ -1317,69 +1345,12 @@ draw_notif_bar() { | |||
1317 | case 2: { txt_drawf_small("50", x0 + 2 + 7 * 4, y0 + 1, color); } break; | 1345 | case 2: { txt_drawf_small("50", x0 + 2 + 7 * 4, y0 + 1, color); } break; |
1318 | case 3: { txt_drawf_small("75", x0 + 2 + 7 * 4, y0 + 1, color); } break; | 1346 | case 3: { txt_drawf_small("75", x0 + 2 + 7 * 4, y0 + 1, color); } break; |
1319 | } | 1347 | } |
1348 | txt_drawc_small('%', x0 + 2 + 9 * 4, y0 + 1, color); | ||
1320 | } break; | 1349 | } break; |
1321 | case 1: { | 1350 | case 1: { draw_notif_param_env_vol(params->env_volume, x0, y0, color); } break; |
1322 | txt_drawf_small("VOL: ", x0 + 2, y0 + 1, color); | 1351 | case 2: { draw_notif_param_env_time(params->env_time, x0, y0, color); } break; |
1323 | switch (params->env_volume) { | 1352 | case 3: { draw_notif_param_env_dir(params->env_direction, x0, y0, color); } break; |
1324 | case 0: { txt_drawf_small("0", x0 + 2 + 5 * 4, y0 + 1, color); } break; | 1353 | case 4: { draw_notif_param_edit_prob(params->prob, x0, y0, color); } break; |
1325 | case 1: { txt_drawf_small("6", x0 + 2 + 5 * 4, y0 + 1, color); } break; | ||
1326 | case 2: { txt_drawf_small("13", x0 + 2 + 5 * 4, y0 + 1, color); } break; | ||
1327 | case 3: { txt_drawf_small("20", x0 + 2 + 5 * 4, y0 + 1, color); } break; | ||
1328 | case 4: { txt_drawf_small("26", x0 + 2 + 5 * 4, y0 + 1, color); } break; | ||
1329 | case 5: { txt_drawf_small("33", x0 + 2 + 5 * 4, y0 + 1, color); } break; | ||
1330 | case 6: { txt_drawf_small("40", x0 + 2 + 5 * 4, y0 + 1, color); } break; | ||
1331 | case 7: { txt_drawf_small("46", x0 + 2 + 5 * 4, y0 + 1, color); } break; | ||
1332 | case 8: { txt_drawf_small("53", x0 + 2 + 5 * 4, y0 + 1, color); } break; | ||
1333 | case 9: { txt_drawf_small("60", x0 + 2 + 5 * 4, y0 + 1, color); } break; | ||
1334 | case 10: { txt_drawf_small("66", x0 + 2 + 5 * 4, y0 + 1, color); } break; | ||
1335 | case 11: { txt_drawf_small("73", x0 + 2 + 5 * 4, y0 + 1, color); } break; | ||
1336 | case 12: { txt_drawf_small("80", x0 + 2 + 5 * 4, y0 + 1, color); } break; | ||
1337 | case 13: { txt_drawf_small("86", x0 + 2 + 5 * 4, y0 + 1, color); } break; | ||
1338 | case 14: { txt_drawf_small("93", x0 + 2 + 5 * 4, y0 + 1, color); } break; | ||
1339 | case 15: { txt_drawf_small("100", x0 + 2 + 5 * 4, y0 + 1, color); } break; | ||
1340 | } | ||
1341 | } break; | ||
1342 | case 2: { | ||
1343 | txt_drawf_small("TIME: ", x0 + 2, y0 + 1, color); | ||
1344 | switch (params->env_time) { | ||
1345 | case 0: { txt_drawf_small("off", x0 + 2 + 6 * 4, y0 + 1, color); } break; | ||
1346 | case 1: { txt_drawf_small("150ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; | ||
1347 | case 2: { txt_drawf_small("310ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; | ||
1348 | case 3: { txt_drawf_small("460ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; | ||
1349 | case 4: { txt_drawf_small("620ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; | ||
1350 | case 5: { txt_drawf_small("780ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; | ||
1351 | case 6: { txt_drawf_small("930ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; | ||
1352 | case 7: { txt_drawf_small("1s", x0 + 2 + 6 * 4, y0 + 1, color); } break; | ||
1353 | } | ||
1354 | } break; | ||
1355 | case 3: { | ||
1356 | txt_drawf_small("DIRECTION: ", x0 + 2, y0 + 1, color); | ||
1357 | switch (params->env_direction) { | ||
1358 | case 0: { txt_drawf_small("down", x0 + 2 + 11 * 4, y0 + 1, color); } break; | ||
1359 | case 1: { txt_drawf_small("up", x0 + 2 + 11 * 4, y0 + 1, color); } break; | ||
1360 | } | ||
1361 | } break; | ||
1362 | case 4: { | ||
1363 | txt_drawf_small("PROB/CONDITION: ", x0 + 2, y0 + 1, color); | ||
1364 | switch (params->prob) { | ||
1365 | case PROB_100: { txt_drawf_small("100", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1366 | case PROB_80: { txt_drawf_small("80", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1367 | case PROB_60: { txt_drawf_small("60", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1368 | case PROB_40: { txt_drawf_small("40", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1369 | case PROB_20: { txt_drawf_small("20", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1370 | case PROB_FIRST: { txt_drawf_small("first bar", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1371 | case PROB_NOT_FIRST: { txt_drawf_small("not first bar", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1372 | case PROB_ONE_TWO: { txt_drawf_small("1st bar out of 2", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1373 | case PROB_TWO_TWO: { txt_drawf_small("2nd bar out of 2", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1374 | case PROB_ONE_THREE: { txt_drawf_small("1st bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1375 | case PROB_TWO_THREE: { txt_drawf_small("2nd bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1376 | case PROB_THREE_THREE: { txt_drawf_small("3rd bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1377 | case PROB_ONE_FOUR: { txt_drawf_small("1st bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1378 | case PROB_TWO_FOUR: { txt_drawf_small("2nd bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1379 | case PROB_THREE_FOUR: { txt_drawf_small("3rd bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1380 | case PROB_FOUR_FOUR: { txt_drawf_small("4th bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1381 | } | ||
1382 | } break; | ||
1383 | } | 1354 | } |
1384 | return; | 1355 | return; |
1385 | } | 1356 | } |
@@ -1435,27 +1406,7 @@ draw_notif_bar() { | |||
1435 | case 7: { txt_drawf_small("h", x0 + 2 + 8 * 4, y0 + 1, color); } break; | 1406 | case 7: { txt_drawf_small("h", x0 + 2 + 8 * 4, y0 + 1, color); } break; |
1436 | } | 1407 | } |
1437 | } break; | 1408 | } break; |
1438 | case 4: { | 1409 | case 4: { draw_notif_param_edit_prob(params->prob, x0, y0, color); } break; |
1439 | txt_drawf_small("PROB/CONDITION: ", x0 + 2, y0 + 1, color); | ||
1440 | switch (params->prob) { | ||
1441 | case PROB_100: { txt_drawf_small("100", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1442 | case PROB_80: { txt_drawf_small("80", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1443 | case PROB_60: { txt_drawf_small("60", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1444 | case PROB_40: { txt_drawf_small("40", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1445 | case PROB_20: { txt_drawf_small("20", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1446 | case PROB_FIRST: { txt_drawf_small("first bar", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1447 | case PROB_NOT_FIRST: { txt_drawf_small("not first bar", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1448 | case PROB_ONE_TWO: { txt_drawf_small("1st bar out of 2", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1449 | case PROB_TWO_TWO: { txt_drawf_small("2nd bar out of 2", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1450 | case PROB_ONE_THREE: { txt_drawf_small("1st bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1451 | case PROB_TWO_THREE: { txt_drawf_small("2nd bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1452 | case PROB_THREE_THREE: { txt_drawf_small("3rd bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1453 | case PROB_ONE_FOUR: { txt_drawf_small("1st bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1454 | case PROB_TWO_FOUR: { txt_drawf_small("2nd bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1455 | case PROB_THREE_FOUR: { txt_drawf_small("3rd bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1456 | case PROB_FOUR_FOUR: { txt_drawf_small("4th bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1457 | } | ||
1458 | } break; | ||
1459 | case 5: { | 1410 | case 5: { |
1460 | txt_drawf_small("MODE: ", x0 + 2, y0 + 1, color); | 1411 | txt_drawf_small("MODE: ", x0 + 2, y0 + 1, color); |
1461 | switch (params->wave_mode) { | 1412 | switch (params->wave_mode) { |
@@ -1467,11 +1418,11 @@ draw_notif_bar() { | |||
1467 | case 6: { | 1418 | case 6: { |
1468 | txt_drawf_small("VOLUME: ", x0 + 2, y0 + 1, color); | 1419 | txt_drawf_small("VOLUME: ", x0 + 2, y0 + 1, color); |
1469 | switch (params->wave_volume) { | 1420 | switch (params->wave_volume) { |
1470 | case 0: { txt_drawf_small("0", x0 + 2 + 8 * 4, y0 + 1, color); } break; | 1421 | case 0: { txt_drawf_small("0", x0 + 2 + 8 * 4, y0 + 1, color); txt_drawc_small('%', x0 + 2 + 9 * 4, y0 + 1, color); } break; |
1471 | case 1: { txt_drawf_small("25", x0 + 2 + 8 * 4, y0 + 1, color); } break; | 1422 | case 1: { txt_drawf_small("25", x0 + 2 + 8 * 4, y0 + 1, color); txt_drawc_small('%', x0 + 2 + 10 * 4, y0 + 1, color); } break; |
1472 | case 2: { txt_drawf_small("50", x0 + 2 + 8 * 4, y0 + 1, color); } break; | 1423 | case 2: { txt_drawf_small("50", x0 + 2 + 8 * 4, y0 + 1, color); txt_drawc_small('%', x0 + 2 + 10 * 4, y0 + 1, color); } break; |
1473 | case 3: { txt_drawf_small("75", x0 + 2 + 8 * 4, y0 + 1, color); } break; | 1424 | case 3: { txt_drawf_small("75", x0 + 2 + 8 * 4, y0 + 1, color); txt_drawc_small('%', x0 + 2 + 10 * 4, y0 + 1, color); } break; |
1474 | case 4: { txt_drawf_small("100", x0 + 2 + 8 * 4, y0 + 1, color); } break; | 1425 | case 4: { txt_drawf_small("100", x0 + 2 + 8 * 4, y0 + 1, color); txt_drawc_small('%', x0 + 2 + 11 * 4, y0 + 1, color); } break; |
1475 | } | 1426 | } |
1476 | } break; | 1427 | } break; |
1477 | } | 1428 | } |
@@ -1494,68 +1445,10 @@ draw_notif_bar() { | |||
1494 | case 1: { txt_drawf_small("b", x0 + 2 + 6 * 4, y0 + 1, color); } break; | 1445 | case 1: { txt_drawf_small("b", x0 + 2 + 6 * 4, y0 + 1, color); } break; |
1495 | } | 1446 | } |
1496 | } break; | 1447 | } break; |
1497 | case 1: { | 1448 | case 1: { draw_notif_param_env_vol(params->env_volume, x0, y0, color); } break; |
1498 | txt_drawf_small("VOL: ", x0 + 2, y0 + 1, color); | 1449 | case 2: { draw_notif_param_env_time(params->env_time, x0, y0, color); } break; |
1499 | switch (params->env_volume) { | 1450 | case 3: { draw_notif_param_env_dir(params->env_direction, x0, y0, color); } break; |
1500 | case 0: { txt_drawf_small("0", x0 + 2 + 5 * 4, y0 + 1, color); } break; | 1451 | case 4: { draw_notif_param_edit_prob(params->prob, x0, y0, color); } break; |
1501 | case 1: { txt_drawf_small("6", x0 + 2 + 5 * 4, y0 + 1, color); } break; | ||
1502 | case 2: { txt_drawf_small("13", x0 + 2 + 5 * 4, y0 + 1, color); } break; | ||
1503 | case 3: { txt_drawf_small("20", x0 + 2 + 5 * 4, y0 + 1, color); } break; | ||
1504 | case 4: { txt_drawf_small("26", x0 + 2 + 5 * 4, y0 + 1, color); } break; | ||
1505 | case 5: { txt_drawf_small("33", x0 + 2 + 5 * 4, y0 + 1, color); } break; | ||
1506 | case 6: { txt_drawf_small("40", x0 + 2 + 5 * 4, y0 + 1, color); } break; | ||
1507 | case 7: { txt_drawf_small("46", x0 + 2 + 5 * 4, y0 + 1, color); } break; | ||
1508 | case 8: { txt_drawf_small("53", x0 + 2 + 5 * 4, y0 + 1, color); } break; | ||
1509 | case 9: { txt_drawf_small("60", x0 + 2 + 5 * 4, y0 + 1, color); } break; | ||
1510 | case 10: { txt_drawf_small("66", x0 + 2 + 5 * 4, y0 + 1, color); } break; | ||
1511 | case 11: { txt_drawf_small("73", x0 + 2 + 5 * 4, y0 + 1, color); } break; | ||
1512 | case 12: { txt_drawf_small("80", x0 + 2 + 5 * 4, y0 + 1, color); } break; | ||
1513 | case 13: { txt_drawf_small("86", x0 + 2 + 5 * 4, y0 + 1, color); } break; | ||
1514 | case 14: { txt_drawf_small("93", x0 + 2 + 5 * 4, y0 + 1, color); } break; | ||
1515 | case 15: { txt_drawf_small("100", x0 + 2 + 5 * 4, y0 + 1, color); } break; | ||
1516 | } | ||
1517 | } break; | ||
1518 | case 2: { | ||
1519 | txt_drawf_small("TIME: ", x0 + 2, y0 + 1, color); | ||
1520 | switch (params->env_time) { | ||
1521 | case 0: { txt_drawf_small("off", x0 + 2 + 6 * 4, y0 + 1, color); } break; | ||
1522 | case 1: { txt_drawf_small("150ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; | ||
1523 | case 2: { txt_drawf_small("310ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; | ||
1524 | case 3: { txt_drawf_small("460ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; | ||
1525 | case 4: { txt_drawf_small("620ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; | ||
1526 | case 5: { txt_drawf_small("780ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; | ||
1527 | case 6: { txt_drawf_small("930ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; | ||
1528 | case 7: { txt_drawf_small("1s", x0 + 2 + 6 * 4, y0 + 1, color); } break; | ||
1529 | } | ||
1530 | } break; | ||
1531 | case 3: { | ||
1532 | txt_drawf_small("DIRECTION: ", x0 + 2, y0 + 1, color); | ||
1533 | switch (params->env_direction) { | ||
1534 | case 0: { txt_drawf_small("down", x0 + 2 + 11 * 4, y0 + 1, color); } break; | ||
1535 | case 1: { txt_drawf_small("up", x0 + 2 + 11 * 4, y0 + 1, color); } break; | ||
1536 | } | ||
1537 | } break; | ||
1538 | case 4: { | ||
1539 | txt_drawf_small("PROB/CONDITION: ", x0 + 2, y0 + 1, color); | ||
1540 | switch (params->prob) { | ||
1541 | case PROB_100: { txt_drawf_small("100", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1542 | case PROB_80: { txt_drawf_small("80", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1543 | case PROB_60: { txt_drawf_small("60", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1544 | case PROB_40: { txt_drawf_small("40", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1545 | case PROB_20: { txt_drawf_small("20", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1546 | case PROB_FIRST: { txt_drawf_small("first bar", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1547 | case PROB_NOT_FIRST: { txt_drawf_small("not first bar", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1548 | case PROB_ONE_TWO: { txt_drawf_small("1st bar out of 2", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1549 | case PROB_TWO_TWO: { txt_drawf_small("2nd bar out of 2", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1550 | case PROB_ONE_THREE: { txt_drawf_small("1st bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1551 | case PROB_TWO_THREE: { txt_drawf_small("2nd bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1552 | case PROB_THREE_THREE: { txt_drawf_small("3rd bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1553 | case PROB_ONE_FOUR: { txt_drawf_small("1st bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1554 | case PROB_TWO_FOUR: { txt_drawf_small("2nd bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1555 | case PROB_THREE_FOUR: { txt_drawf_small("3rd bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1556 | case PROB_FOUR_FOUR: { txt_drawf_small("4th bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; | ||
1557 | } | ||
1558 | } break; | ||
1559 | } | 1452 | } |
1560 | return; | 1453 | return; |
1561 | } | 1454 | } |