From 22225331c93b254aa926d76d2c50b5438f12586d Mon Sep 17 00:00:00 2001 From: Bad Diode Date: Sat, 22 Jul 2023 11:18:41 +0200 Subject: Add parameter notifications when editing --- src/drawing.c | 394 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 386 insertions(+), 8 deletions(-) (limited to 'src/drawing.c') diff --git a/src/drawing.c b/src/drawing.c index 8fef74f..c076886 100644 --- a/src/drawing.c +++ b/src/drawing.c @@ -486,9 +486,9 @@ draw_params_cursor_wave(size_t i, u8 clr) { txt_drawf_small("shape", x, y, COL_BG); } break; case 1: { - x += 4 + PARAMS_BOX_OFFSET_X * 1; + x += 6 + PARAMS_BOX_OFFSET_X * 1; y += PARAMS_BOX_H - 7; - txt_drawf_small("phase", x, y, COL_BG); + txt_drawf_small("type", x, y, COL_BG); } break; case 2: { x += 4 + PARAMS_BOX_OFFSET_X * 2; @@ -496,9 +496,9 @@ draw_params_cursor_wave(size_t i, u8 clr) { txt_drawf_small("shape", x, y, COL_BG); } break; case 3: { - x += 4 + PARAMS_BOX_OFFSET_X * 3; + x += 6 + PARAMS_BOX_OFFSET_X * 3; y += PARAMS_BOX_H - 7; - txt_drawf_small("phase", x, y, COL_BG); + txt_drawf_small("type", x, y, COL_BG); } break; case 4: { x += 6 + PARAMS_BOX_OFFSET_X * 4; @@ -724,8 +724,8 @@ draw_parameters_wave(ChannelWaveParams *params, bool global) { size_t y = PARAMS_START_Y; // Wave Patterns. - draw_wave_pattern(waves[params->shape_a][params->phase_a], x, y, COL_ACC_1); - draw_wave_pattern(waves[params->shape_b][params->phase_b], x + PARAMS_BOX_OFFSET_X * 2, y, COL_ACC_2); + draw_wave_pattern(waves[params->shape_a][params->type_a], x, y, COL_ACC_1); + draw_wave_pattern(waves[params->shape_b][params->type_b], x + PARAMS_BOX_OFFSET_X * 2, y, COL_ACC_2); } // Trig probability. @@ -760,9 +760,9 @@ draw_parameters_wave(ChannelWaveParams *params, bool global) { size_t x = PARAMS_START_X; size_t y = PARAMS_START_Y; txt_drawf_small("shape", x + 4 + PARAMS_BOX_OFFSET_X * 0, y + PARAMS_BOX_H - 7, col_fg); - txt_drawf_small("phase", x + 4 + PARAMS_BOX_OFFSET_X * 1, y + PARAMS_BOX_H - 7, col_fg); + txt_drawf_small("type", x + 6 + PARAMS_BOX_OFFSET_X * 1, y + PARAMS_BOX_H - 7, col_fg); txt_drawf_small("shape", x + 4 + PARAMS_BOX_OFFSET_X * 2, y + PARAMS_BOX_H - 7, col_fg); - txt_drawf_small("phase", x + 4 + PARAMS_BOX_OFFSET_X * 3, y + PARAMS_BOX_H - 7, col_fg); + txt_drawf_small("type", x + 6 + PARAMS_BOX_OFFSET_X * 3, y + PARAMS_BOX_H - 7, col_fg); txt_drawf_small("prob", x + 6 + PARAMS_BOX_OFFSET_X * 4, y + PARAMS_BOX_H - 7, col_fg); y += PARAMS_BOX_OFFSET_Y; txt_drawf_small("mode", x + 6 + PARAMS_BOX_OFFSET_X * 0, y + PARAMS_BOX_H - 7, col_fg); @@ -1182,6 +1182,384 @@ draw_notif_bar() { } txt_drawf_small(msg, x0 + 2, y0 + 1, color); } else { + Pattern *pat = &patterns[pattern_selection_loc]; + if (input_handler == handle_param_selection_sq1 + || input_handler == handle_param_selection_ch1) { + ChannelSquareParams *params; + if (input_handler == handle_param_selection_sq1) { + params = &pat->ch1.params[trig_selection_loc]; + } else { + params = &ch1_params; + } + switch (param_selection_loc) { + case 0: { + txt_drawf_small("SHAPE: ", x0 + 2, y0 + 1, color); + switch (params->duty_cycle) { + case 0: { txt_drawf_small("12", x0 + 2 + 7 * 4, y0 + 1, color); } break; + case 1: { txt_drawf_small("25", x0 + 2 + 7 * 4, y0 + 1, color); } break; + 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; + } + } 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 5: { + txt_drawf_small("SWEEP BITS: ", x0 + 2, y0 + 1, color); + switch (params->sweep_number) { + case 0: { txt_drawf_small("0", x0 + 2 + 12 * 4, y0 + 1, color); } break; + case 1: { txt_drawf_small("1", x0 + 2 + 12 * 4, y0 + 1, color); } break; + case 2: { txt_drawf_small("2", x0 + 2 + 12 * 4, y0 + 1, color); } break; + case 3: { txt_drawf_small("3", x0 + 2 + 12 * 4, y0 + 1, color); } break; + case 4: { txt_drawf_small("4", x0 + 2 + 12 * 4, y0 + 1, color); } break; + case 5: { txt_drawf_small("5", x0 + 2 + 12 * 4, y0 + 1, color); } break; + case 6: { txt_drawf_small("6", x0 + 2 + 12 * 4, y0 + 1, color); } break; + case 7: { txt_drawf_small("7", x0 + 2 + 12 * 4, y0 + 1, color); } break; + } + } break; + case 6: { + txt_drawf_small("SWEEP TIME: ", x0 + 2, y0 + 1, color); + switch (params->sweep_time) { + case 0: { txt_drawf_small("off", x0 + 2 + 12 * 4, y0 + 1, color); } break; + case 1: { txt_drawf_small("7ms", x0 + 2 + 12 * 4, y0 + 1, color); } break; + case 2: { txt_drawf_small("15ms", x0 + 2 + 12 * 4, y0 + 1, color); } break; + case 3: { txt_drawf_small("23ms", x0 + 2 + 12 * 4, y0 + 1, color); } break; + case 4: { txt_drawf_small("31ms", x0 + 2 + 12 * 4, y0 + 1, color); } break; + case 5: { txt_drawf_small("39ms", x0 + 2 + 12 * 4, y0 + 1, color); } break; + case 6: { txt_drawf_small("46ms", x0 + 2 + 12 * 4, y0 + 1, color); } break; + case 7: { txt_drawf_small("54ms", x0 + 2 + 12 * 4, y0 + 1, color); } break; + } + } break; + case 7: { + txt_drawf_small("SWEEP DIRECTION: ", x0 + 2, y0 + 1, color); + switch (params->sweep_direction) { + case 0: { txt_drawf_small("up", x0 + 2 + 17 * 4, y0 + 1, color); } break; + case 1: { txt_drawf_small("down", x0 + 2 + 17 * 4, y0 + 1, color); } break; + } + } break; + } + return; + } + + if (input_handler == handle_param_selection_sq2 + || input_handler == handle_param_selection_ch2) { + ChannelSquareParams *params; + if (input_handler == handle_param_selection_sq2) { + params = &pat->ch2.params[trig_selection_loc]; + } else { + params = &ch2_params; + } + switch (param_selection_loc) { + case 0: { + txt_drawf_small("SHAPE: ", x0 + 2, y0 + 1, color); + switch (params->duty_cycle) { + case 0: { txt_drawf_small("12", x0 + 2 + 7 * 4, y0 + 1, color); } break; + case 1: { txt_drawf_small("25", x0 + 2 + 7 * 4, y0 + 1, color); } break; + 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; + } + } 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; + } + return; + } + + if (input_handler == handle_param_selection_wave + || input_handler == handle_param_selection_ch3) { + ChannelWaveParams *params; + if (input_handler == handle_param_selection_wave) { + params = &pat->ch3.params[trig_selection_loc]; + } else { + params = &ch3_params; + } + switch (param_selection_loc) { + case 0: { + txt_drawf_small("SHAPE A: ", x0 + 2, y0 + 1, color); + switch (params->shape_a) { + case 0: { txt_drawf_small("sin", x0 + 2 + 9 * 4, y0 + 1, color); } break; + case 1: { txt_drawf_small("saw", x0 + 2 + 9 * 4, y0 + 1, color); } break; + case 2: { txt_drawf_small("square", x0 + 2 + 9 * 4, y0 + 1, color); } break; + } + } break; + case 1: { + txt_drawf_small("TYPE A: ", x0 + 2, y0 + 1, color); + switch (params->type_a) { + case 0: { txt_drawf_small("a", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 1: { txt_drawf_small("b", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 2: { txt_drawf_small("c", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 3: { txt_drawf_small("d", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 4: { txt_drawf_small("e", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 5: { txt_drawf_small("f", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 6: { txt_drawf_small("g", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 7: { txt_drawf_small("h", x0 + 2 + 8 * 4, y0 + 1, color); } break; + } + } break; + case 2: { + txt_drawf_small("SHAPE B: ", x0 + 2, y0 + 1, color); + switch (params->shape_b) { + case 0: { txt_drawf_small("sin", x0 + 2 + 9 * 4, y0 + 1, color); } break; + case 1: { txt_drawf_small("saw", x0 + 2 + 9 * 4, y0 + 1, color); } break; + case 2: { txt_drawf_small("square", x0 + 2 + 9 * 4, y0 + 1, color); } break; + } + } break; + case 3: { + txt_drawf_small("TYPE B: ", x0 + 2, y0 + 1, color); + switch (params->type_b) { + case 0: { txt_drawf_small("a", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 1: { txt_drawf_small("b", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 2: { txt_drawf_small("c", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 3: { txt_drawf_small("d", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 4: { txt_drawf_small("e", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 5: { txt_drawf_small("f", x0 + 2 + 8 * 4, y0 + 1, color); } break; + case 6: { txt_drawf_small("g", x0 + 2 + 8 * 4, y0 + 1, color); } break; + 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 5: { + txt_drawf_small("MODE: ", x0 + 2, y0 + 1, color); + switch (params->wave_mode) { + case 0: { txt_drawf_small("A", x0 + 2 + 6 * 4, y0 + 1, color); } break; + case 1: { txt_drawf_small("B", x0 + 2 + 6 * 4, y0 + 1, color); } break; + case 2: { txt_drawf_small("A + B", x0 + 2 + 6 * 4, y0 + 1, color); } break; + } + } break; + 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; + } + } break; + } + return; + } + + if (input_handler == handle_param_selection_noise + || input_handler == handle_param_selection_ch4) { + ChannelNoiseParams *params; + if (input_handler == handle_param_selection_noise) { + params = &pat->ch4.params[trig_selection_loc]; + } else { + params = &ch4_params; + } + switch (param_selection_loc) { + case 0: { + txt_drawf_small("MODE: ", x0 + 2, y0 + 1, color); + switch (params->bit_mode) { + case 0: { txt_drawf_small("a", x0 + 2 + 6 * 4, y0 + 1, color); } break; + 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; + } + return; + } + if (settings.help == HELP_ON) { if (input_handler == handle_trigger_selection || input_handler == handle_channel_selection) { -- cgit v1.2.1