From 8585ffba82eab7f8e80bdac12773aa1f2e9e6915 Mon Sep 17 00:00:00 2001 From: Bad Diode Date: Sat, 22 Jul 2023 11:44:35 +0200 Subject: Add percent drawing when needed on notif params --- src/drawing.c | 347 ++++++++++++++++++++-------------------------------------- 1 file changed, 120 insertions(+), 227 deletions(-) (limited to 'src') 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) { // Wave volume. { - size_t x = PARAMS_START_X + PARAMS_BOX_OFFSET_X; - size_t y = PARAMS_START_Y + PARAMS_BOX_OFFSET_Y; + size_t x = PARAMS_START_X + PARAMS_BOX_OFFSET_X + 3; + size_t y = PARAMS_START_Y + PARAMS_BOX_OFFSET_Y + 5; switch (params->wave_volume) { - case 0: { txt_drawf("0", x + 12, y + 5, col_fg); } break; - case 1: { txt_drawf("25", x + 9, y + 5, col_fg); } break; - case 2: { txt_drawf("50", x + 9, y + 5, col_fg); } break; - case 3: { txt_drawf("75", x + 9, y + 5, col_fg); } break; - case 4: { txt_drawf("100", x + 6, y + 5, col_fg); } break; + case 0: { + txt_drawf("0", x + 6, y, col_fg); + txt_drawc('%', x + 12, y, col_fg); + } break; + case 1: { + txt_drawf("25", x + 3, y, col_fg); + txt_drawc('%', x + 15, y, col_fg); + } break; + case 2: { + txt_drawf("50", x + 3, y, col_fg); + txt_drawc('%', x + 15, y, col_fg); + } break; + case 3: { + txt_drawf("75", x + 3, y, col_fg); + txt_drawc('%', x + 15, y, col_fg); + } break; + case 4: { + txt_drawf("100", x, y, col_fg); + txt_drawc('%', x + 18, y, col_fg); + } break; } } @@ -892,14 +907,14 @@ draw_parameters_square(ChannelSquareParams *params, bool sweep, bool global) { // Time. x += PARAMS_BOX_OFFSET_X; switch (params->sweep_time) { - case 0: { txt_drawf("0", x + 12, y + 5, col_fg); } break; - case 1: { txt_drawf("1", x + 12, y + 5, col_fg); } break; - case 2: { txt_drawf("2", x + 12, y + 5, col_fg); } break; - case 3: { txt_drawf("3", x + 12, y + 5, col_fg); } break; - case 4: { txt_drawf("4", x + 12, y + 5, col_fg); } break; - case 5: { txt_drawf("5", x + 12, y + 5, col_fg); } break; - case 6: { txt_drawf("6", x + 12, y + 5, col_fg); } break; - case 7: { txt_drawf("7", x + 12, y + 5, col_fg); } break; + case 0: { txt_drawf("Off", x + 6, y + 5, col_fg); } break; + case 1: { txt_drawf("7ms", x + 6, y + 5, col_fg); } break; + case 2: { txt_drawf("15ms", x + 3, y + 5, col_fg); } break; + case 3: { txt_drawf("23ms", x + 3, y + 5, col_fg); } break; + case 4: { txt_drawf("31ms", x + 3, y + 5, col_fg); } break; + case 5: { txt_drawf("39ms", x + 3, y + 5, col_fg); } break; + case 6: { txt_drawf("46ms", x + 3, y + 5, col_fg); } break; + case 7: { txt_drawf("54ms", x + 3, y + 5, col_fg); } break; } // Direction. @@ -1160,6 +1175,76 @@ draw_piano_notes(void) { } } +void +draw_notif_param_edit_prob(u8 prob, u8 x, u8 y, u8 color) { + txt_drawf_small("PROB/CONDITION: ", x + 2, y + 1, color); + switch (prob) { + 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; + 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; + 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; + 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; + 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; + case PROB_FIRST: { txt_drawf_small("first bar", x + 2 + 16 * 4, y + 1, color); } break; + case PROB_NOT_FIRST: { txt_drawf_small("not first bar", x + 2 + 16 * 4, y + 1, color); } break; + case PROB_ONE_TWO: { txt_drawf_small("1st bar out of 2", x + 2 + 16 * 4, y + 1, color); } break; + case PROB_TWO_TWO: { txt_drawf_small("2nd bar out of 2", x + 2 + 16 * 4, y + 1, color); } break; + case PROB_ONE_THREE: { txt_drawf_small("1st bar out of 3", x + 2 + 16 * 4, y + 1, color); } break; + case PROB_TWO_THREE: { txt_drawf_small("2nd bar out of 3", x + 2 + 16 * 4, y + 1, color); } break; + case PROB_THREE_THREE: { txt_drawf_small("3rd bar out of 3", x + 2 + 16 * 4, y + 1, color); } break; + case PROB_ONE_FOUR: { txt_drawf_small("1st bar out of 4", x + 2 + 16 * 4, y + 1, color); } break; + case PROB_TWO_FOUR: { txt_drawf_small("2nd bar out of 4", x + 2 + 16 * 4, y + 1, color); } break; + case PROB_THREE_FOUR: { txt_drawf_small("3rd bar out of 4", x + 2 + 16 * 4, y + 1, color); } break; + case PROB_FOUR_FOUR: { txt_drawf_small("4th bar out of 4", x + 2 + 16 * 4, y + 1, color); } break; + } +} + +void +draw_notif_param_env_vol(u8 vol, u8 x, u8 y, u8 color) { + txt_drawf_small("VOL: ", x + 2, y + 1, color); + switch (vol) { + case 0: { txt_drawf_small("0", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 6 * 4, y + 1, color); } break; + case 1: { txt_drawf_small("6", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 6 * 4, y + 1, color); } break; + case 2: { txt_drawf_small("13", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; + case 3: { txt_drawf_small("20", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; + case 4: { txt_drawf_small("26", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; + case 5: { txt_drawf_small("33", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; + case 6: { txt_drawf_small("40", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; + case 7: { txt_drawf_small("46", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; + case 8: { txt_drawf_small("53", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; + case 9: { txt_drawf_small("60", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; + case 10: { txt_drawf_small("66", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; + case 11: { txt_drawf_small("73", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; + case 12: { txt_drawf_small("80", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; + case 13: { txt_drawf_small("86", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; + case 14: { txt_drawf_small("93", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 7 * 4, y + 1, color); } break; + case 15: { txt_drawf_small("100", x + 2 + 5 * 4, y + 1, color); txt_drawc_small('%', x + 2 + 8 * 4, y + 1, color); } break; + } +} + +void +draw_notif_param_env_time(u8 time, u8 x, u8 y, u8 color) { + txt_drawf_small("TIME: ", x + 2, y + 1, color); + switch (time) { + case 0: { txt_drawf_small("off", x + 2 + 6 * 4, y + 1, color); } break; + case 1: { txt_drawf_small("150ms", x + 2 + 6 * 4, y + 1, color); } break; + case 2: { txt_drawf_small("310ms", x + 2 + 6 * 4, y + 1, color); } break; + case 3: { txt_drawf_small("460ms", x + 2 + 6 * 4, y + 1, color); } break; + case 4: { txt_drawf_small("620ms", x + 2 + 6 * 4, y + 1, color); } break; + case 5: { txt_drawf_small("780ms", x + 2 + 6 * 4, y + 1, color); } break; + case 6: { txt_drawf_small("930ms", x + 2 + 6 * 4, y + 1, color); } break; + case 7: { txt_drawf_small("1s", x + 2 + 6 * 4, y + 1, color); } break; + } +} + +void +draw_notif_param_env_dir(u8 dir, u8 x, u8 y, u8 color) { + txt_drawf_small("DIRECTION: ", x + 2, y + 1, color); + switch (dir) { + case 0: { txt_drawf_small("down", x + 2 + 11 * 4, y + 1, color); } break; + case 1: { txt_drawf_small("up", x + 2 + 11 * 4, y + 1, color); } break; + } +} + void draw_notif_bar() { u8 x0 = NOTIF_START_X; @@ -1200,69 +1285,12 @@ draw_notif_bar() { case 2: { txt_drawf_small("50", x0 + 2 + 7 * 4, y0 + 1, color); } break; case 3: { txt_drawf_small("75", x0 + 2 + 7 * 4, y0 + 1, color); } break; } + txt_drawc_small('%', x0 + 2 + 9 * 4, y0 + 1, color); } break; - case 1: { - txt_drawf_small("VOL: ", x0 + 2, y0 + 1, color); - switch (params->env_volume) { - case 0: { txt_drawf_small("0", x0 + 2 + 5 * 4, y0 + 1, color); } break; - case 1: { txt_drawf_small("6", x0 + 2 + 5 * 4, y0 + 1, color); } break; - case 2: { txt_drawf_small("13", x0 + 2 + 5 * 4, y0 + 1, color); } break; - case 3: { txt_drawf_small("20", x0 + 2 + 5 * 4, y0 + 1, color); } break; - case 4: { txt_drawf_small("26", x0 + 2 + 5 * 4, y0 + 1, color); } break; - case 5: { txt_drawf_small("33", x0 + 2 + 5 * 4, y0 + 1, color); } break; - case 6: { txt_drawf_small("40", x0 + 2 + 5 * 4, y0 + 1, color); } break; - case 7: { txt_drawf_small("46", x0 + 2 + 5 * 4, y0 + 1, color); } break; - case 8: { txt_drawf_small("53", x0 + 2 + 5 * 4, y0 + 1, color); } break; - case 9: { txt_drawf_small("60", x0 + 2 + 5 * 4, y0 + 1, color); } break; - case 10: { txt_drawf_small("66", x0 + 2 + 5 * 4, y0 + 1, color); } break; - case 11: { txt_drawf_small("73", x0 + 2 + 5 * 4, y0 + 1, color); } break; - case 12: { txt_drawf_small("80", x0 + 2 + 5 * 4, y0 + 1, color); } break; - case 13: { txt_drawf_small("86", x0 + 2 + 5 * 4, y0 + 1, color); } break; - case 14: { txt_drawf_small("93", x0 + 2 + 5 * 4, y0 + 1, color); } break; - case 15: { txt_drawf_small("100", x0 + 2 + 5 * 4, y0 + 1, color); } break; - } - } break; - case 2: { - txt_drawf_small("TIME: ", x0 + 2, y0 + 1, color); - switch (params->env_time) { - case 0: { txt_drawf_small("off", x0 + 2 + 6 * 4, y0 + 1, color); } break; - case 1: { txt_drawf_small("150ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; - case 2: { txt_drawf_small("310ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; - case 3: { txt_drawf_small("460ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; - case 4: { txt_drawf_small("620ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; - case 5: { txt_drawf_small("780ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; - case 6: { txt_drawf_small("930ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; - case 7: { txt_drawf_small("1s", x0 + 2 + 6 * 4, y0 + 1, color); } break; - } - } break; - case 3: { - txt_drawf_small("DIRECTION: ", x0 + 2, y0 + 1, color); - switch (params->env_direction) { - case 0: { txt_drawf_small("down", x0 + 2 + 11 * 4, y0 + 1, color); } break; - case 1: { txt_drawf_small("up", x0 + 2 + 11 * 4, y0 + 1, color); } break; - } - } break; - case 4: { - txt_drawf_small("PROB/CONDITION: ", x0 + 2, y0 + 1, color); - switch (params->prob) { - case PROB_100: { txt_drawf_small("100", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_80: { txt_drawf_small("80", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_60: { txt_drawf_small("60", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_40: { txt_drawf_small("40", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_20: { txt_drawf_small("20", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_FIRST: { txt_drawf_small("first bar", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_NOT_FIRST: { txt_drawf_small("not first bar", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_ONE_TWO: { txt_drawf_small("1st bar out of 2", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_TWO_TWO: { txt_drawf_small("2nd bar out of 2", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_ONE_THREE: { txt_drawf_small("1st bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_TWO_THREE: { txt_drawf_small("2nd bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_THREE_THREE: { txt_drawf_small("3rd bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_ONE_FOUR: { txt_drawf_small("1st bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_TWO_FOUR: { txt_drawf_small("2nd bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_THREE_FOUR: { txt_drawf_small("3rd bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_FOUR_FOUR: { txt_drawf_small("4th bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; - } - } break; + case 1: { draw_notif_param_env_vol(params->env_volume, x0, y0, color); } break; + case 2: { draw_notif_param_env_time(params->env_time, x0, y0, color); } break; + case 3: { draw_notif_param_env_dir(params->env_direction, x0, y0, color); } break; + case 4: { draw_notif_param_edit_prob(params->prob, x0, y0, color); } break; case 5: { txt_drawf_small("SWEEP BITS: ", x0 + 2, y0 + 1, color); switch (params->sweep_number) { @@ -1317,69 +1345,12 @@ draw_notif_bar() { case 2: { txt_drawf_small("50", x0 + 2 + 7 * 4, y0 + 1, color); } break; case 3: { txt_drawf_small("75", x0 + 2 + 7 * 4, y0 + 1, color); } break; } + txt_drawc_small('%', x0 + 2 + 9 * 4, y0 + 1, color); } break; - case 1: { - txt_drawf_small("VOL: ", x0 + 2, y0 + 1, color); - switch (params->env_volume) { - case 0: { txt_drawf_small("0", x0 + 2 + 5 * 4, y0 + 1, color); } break; - case 1: { txt_drawf_small("6", x0 + 2 + 5 * 4, y0 + 1, color); } break; - case 2: { txt_drawf_small("13", x0 + 2 + 5 * 4, y0 + 1, color); } break; - case 3: { txt_drawf_small("20", x0 + 2 + 5 * 4, y0 + 1, color); } break; - case 4: { txt_drawf_small("26", x0 + 2 + 5 * 4, y0 + 1, color); } break; - case 5: { txt_drawf_small("33", x0 + 2 + 5 * 4, y0 + 1, color); } break; - case 6: { txt_drawf_small("40", x0 + 2 + 5 * 4, y0 + 1, color); } break; - case 7: { txt_drawf_small("46", x0 + 2 + 5 * 4, y0 + 1, color); } break; - case 8: { txt_drawf_small("53", x0 + 2 + 5 * 4, y0 + 1, color); } break; - case 9: { txt_drawf_small("60", x0 + 2 + 5 * 4, y0 + 1, color); } break; - case 10: { txt_drawf_small("66", x0 + 2 + 5 * 4, y0 + 1, color); } break; - case 11: { txt_drawf_small("73", x0 + 2 + 5 * 4, y0 + 1, color); } break; - case 12: { txt_drawf_small("80", x0 + 2 + 5 * 4, y0 + 1, color); } break; - case 13: { txt_drawf_small("86", x0 + 2 + 5 * 4, y0 + 1, color); } break; - case 14: { txt_drawf_small("93", x0 + 2 + 5 * 4, y0 + 1, color); } break; - case 15: { txt_drawf_small("100", x0 + 2 + 5 * 4, y0 + 1, color); } break; - } - } break; - case 2: { - txt_drawf_small("TIME: ", x0 + 2, y0 + 1, color); - switch (params->env_time) { - case 0: { txt_drawf_small("off", x0 + 2 + 6 * 4, y0 + 1, color); } break; - case 1: { txt_drawf_small("150ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; - case 2: { txt_drawf_small("310ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; - case 3: { txt_drawf_small("460ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; - case 4: { txt_drawf_small("620ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; - case 5: { txt_drawf_small("780ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; - case 6: { txt_drawf_small("930ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; - case 7: { txt_drawf_small("1s", x0 + 2 + 6 * 4, y0 + 1, color); } break; - } - } break; - case 3: { - txt_drawf_small("DIRECTION: ", x0 + 2, y0 + 1, color); - switch (params->env_direction) { - case 0: { txt_drawf_small("down", x0 + 2 + 11 * 4, y0 + 1, color); } break; - case 1: { txt_drawf_small("up", x0 + 2 + 11 * 4, y0 + 1, color); } break; - } - } break; - case 4: { - txt_drawf_small("PROB/CONDITION: ", x0 + 2, y0 + 1, color); - switch (params->prob) { - case PROB_100: { txt_drawf_small("100", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_80: { txt_drawf_small("80", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_60: { txt_drawf_small("60", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_40: { txt_drawf_small("40", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_20: { txt_drawf_small("20", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_FIRST: { txt_drawf_small("first bar", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_NOT_FIRST: { txt_drawf_small("not first bar", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_ONE_TWO: { txt_drawf_small("1st bar out of 2", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_TWO_TWO: { txt_drawf_small("2nd bar out of 2", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_ONE_THREE: { txt_drawf_small("1st bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_TWO_THREE: { txt_drawf_small("2nd bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_THREE_THREE: { txt_drawf_small("3rd bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_ONE_FOUR: { txt_drawf_small("1st bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_TWO_FOUR: { txt_drawf_small("2nd bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_THREE_FOUR: { txt_drawf_small("3rd bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_FOUR_FOUR: { txt_drawf_small("4th bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; - } - } break; + case 1: { draw_notif_param_env_vol(params->env_volume, x0, y0, color); } break; + case 2: { draw_notif_param_env_time(params->env_time, x0, y0, color); } break; + case 3: { draw_notif_param_env_dir(params->env_direction, x0, y0, color); } break; + case 4: { draw_notif_param_edit_prob(params->prob, x0, y0, color); } break; } return; } @@ -1435,27 +1406,7 @@ draw_notif_bar() { case 7: { txt_drawf_small("h", x0 + 2 + 8 * 4, y0 + 1, color); } break; } } break; - case 4: { - txt_drawf_small("PROB/CONDITION: ", x0 + 2, y0 + 1, color); - switch (params->prob) { - case PROB_100: { txt_drawf_small("100", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_80: { txt_drawf_small("80", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_60: { txt_drawf_small("60", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_40: { txt_drawf_small("40", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_20: { txt_drawf_small("20", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_FIRST: { txt_drawf_small("first bar", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_NOT_FIRST: { txt_drawf_small("not first bar", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_ONE_TWO: { txt_drawf_small("1st bar out of 2", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_TWO_TWO: { txt_drawf_small("2nd bar out of 2", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_ONE_THREE: { txt_drawf_small("1st bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_TWO_THREE: { txt_drawf_small("2nd bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_THREE_THREE: { txt_drawf_small("3rd bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_ONE_FOUR: { txt_drawf_small("1st bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_TWO_FOUR: { txt_drawf_small("2nd bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_THREE_FOUR: { txt_drawf_small("3rd bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_FOUR_FOUR: { txt_drawf_small("4th bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; - } - } break; + case 4: { draw_notif_param_edit_prob(params->prob, x0, y0, color); } break; case 5: { txt_drawf_small("MODE: ", x0 + 2, y0 + 1, color); switch (params->wave_mode) { @@ -1467,11 +1418,11 @@ draw_notif_bar() { case 6: { txt_drawf_small("VOLUME: ", x0 + 2, y0 + 1, color); switch (params->wave_volume) { - case 0: { txt_drawf_small("0", x0 + 2 + 8 * 4, y0 + 1, color); } break; - case 1: { txt_drawf_small("25", x0 + 2 + 8 * 4, y0 + 1, color); } break; - case 2: { txt_drawf_small("50", x0 + 2 + 8 * 4, y0 + 1, color); } break; - case 3: { txt_drawf_small("75", x0 + 2 + 8 * 4, y0 + 1, color); } break; - case 4: { txt_drawf_small("100", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 0: { txt_drawf_small("0", x0 + 2 + 8 * 4, y0 + 1, color); txt_drawc_small('%', x0 + 2 + 9 * 4, y0 + 1, color); } break; + case 1: { txt_drawf_small("25", x0 + 2 + 8 * 4, y0 + 1, color); txt_drawc_small('%', x0 + 2 + 10 * 4, y0 + 1, color); } break; + case 2: { txt_drawf_small("50", x0 + 2 + 8 * 4, y0 + 1, color); txt_drawc_small('%', x0 + 2 + 10 * 4, y0 + 1, color); } break; + case 3: { txt_drawf_small("75", x0 + 2 + 8 * 4, y0 + 1, color); txt_drawc_small('%', x0 + 2 + 10 * 4, y0 + 1, color); } break; + case 4: { txt_drawf_small("100", x0 + 2 + 8 * 4, y0 + 1, color); txt_drawc_small('%', x0 + 2 + 11 * 4, y0 + 1, color); } break; } } break; } @@ -1494,68 +1445,10 @@ draw_notif_bar() { case 1: { txt_drawf_small("b", x0 + 2 + 6 * 4, y0 + 1, color); } break; } } break; - case 1: { - txt_drawf_small("VOL: ", x0 + 2, y0 + 1, color); - switch (params->env_volume) { - case 0: { txt_drawf_small("0", x0 + 2 + 5 * 4, y0 + 1, color); } break; - case 1: { txt_drawf_small("6", x0 + 2 + 5 * 4, y0 + 1, color); } break; - case 2: { txt_drawf_small("13", x0 + 2 + 5 * 4, y0 + 1, color); } break; - case 3: { txt_drawf_small("20", x0 + 2 + 5 * 4, y0 + 1, color); } break; - case 4: { txt_drawf_small("26", x0 + 2 + 5 * 4, y0 + 1, color); } break; - case 5: { txt_drawf_small("33", x0 + 2 + 5 * 4, y0 + 1, color); } break; - case 6: { txt_drawf_small("40", x0 + 2 + 5 * 4, y0 + 1, color); } break; - case 7: { txt_drawf_small("46", x0 + 2 + 5 * 4, y0 + 1, color); } break; - case 8: { txt_drawf_small("53", x0 + 2 + 5 * 4, y0 + 1, color); } break; - case 9: { txt_drawf_small("60", x0 + 2 + 5 * 4, y0 + 1, color); } break; - case 10: { txt_drawf_small("66", x0 + 2 + 5 * 4, y0 + 1, color); } break; - case 11: { txt_drawf_small("73", x0 + 2 + 5 * 4, y0 + 1, color); } break; - case 12: { txt_drawf_small("80", x0 + 2 + 5 * 4, y0 + 1, color); } break; - case 13: { txt_drawf_small("86", x0 + 2 + 5 * 4, y0 + 1, color); } break; - case 14: { txt_drawf_small("93", x0 + 2 + 5 * 4, y0 + 1, color); } break; - case 15: { txt_drawf_small("100", x0 + 2 + 5 * 4, y0 + 1, color); } break; - } - } break; - case 2: { - txt_drawf_small("TIME: ", x0 + 2, y0 + 1, color); - switch (params->env_time) { - case 0: { txt_drawf_small("off", x0 + 2 + 6 * 4, y0 + 1, color); } break; - case 1: { txt_drawf_small("150ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; - case 2: { txt_drawf_small("310ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; - case 3: { txt_drawf_small("460ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; - case 4: { txt_drawf_small("620ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; - case 5: { txt_drawf_small("780ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; - case 6: { txt_drawf_small("930ms", x0 + 2 + 6 * 4, y0 + 1, color); } break; - case 7: { txt_drawf_small("1s", x0 + 2 + 6 * 4, y0 + 1, color); } break; - } - } break; - case 3: { - txt_drawf_small("DIRECTION: ", x0 + 2, y0 + 1, color); - switch (params->env_direction) { - case 0: { txt_drawf_small("down", x0 + 2 + 11 * 4, y0 + 1, color); } break; - case 1: { txt_drawf_small("up", x0 + 2 + 11 * 4, y0 + 1, color); } break; - } - } break; - case 4: { - txt_drawf_small("PROB/CONDITION: ", x0 + 2, y0 + 1, color); - switch (params->prob) { - case PROB_100: { txt_drawf_small("100", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_80: { txt_drawf_small("80", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_60: { txt_drawf_small("60", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_40: { txt_drawf_small("40", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_20: { txt_drawf_small("20", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_FIRST: { txt_drawf_small("first bar", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_NOT_FIRST: { txt_drawf_small("not first bar", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_ONE_TWO: { txt_drawf_small("1st bar out of 2", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_TWO_TWO: { txt_drawf_small("2nd bar out of 2", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_ONE_THREE: { txt_drawf_small("1st bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_TWO_THREE: { txt_drawf_small("2nd bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_THREE_THREE: { txt_drawf_small("3rd bar out of 3", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_ONE_FOUR: { txt_drawf_small("1st bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_TWO_FOUR: { txt_drawf_small("2nd bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_THREE_FOUR: { txt_drawf_small("3rd bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; - case PROB_FOUR_FOUR: { txt_drawf_small("4th bar out of 4", x0 + 2 + 16 * 4, y0 + 1, color); } break; - } - } break; + case 1: { draw_notif_param_env_vol(params->env_volume, x0, y0, color); } break; + case 2: { draw_notif_param_env_time(params->env_time, x0, y0, color); } break; + case 3: { draw_notif_param_env_dir(params->env_direction, x0, y0, color); } break; + case 4: { draw_notif_param_edit_prob(params->prob, x0, y0, color); } break; } return; } -- cgit v1.2.1