From eeeacde00c589cb227746b164a39372356d1eeec Mon Sep 17 00:00:00 2001 From: Bad Diode Date: Sun, 23 Apr 2023 19:43:33 +0200 Subject: Fix a couple of rendering corner cases --- src/sequencer.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'src/sequencer.c') diff --git a/src/sequencer.c b/src/sequencer.c index a560bcb..34e2695 100644 --- a/src/sequencer.c +++ b/src/sequencer.c @@ -749,16 +749,16 @@ handle_trigger_selection(void) { // Decrease note. if (trig->active) { trig->note = MAX(trig->note - 1, NOTE_C_2); - redraw_trigs = true; - redraw_piano_note = true; } + redraw_trigs = true; + redraw_piano_note = true; } else if (key_tap(KEY_R)) { // Increase note. if (trig->active) { trig->note = MIN( trig->note + 1, NOTE_C_8 - 1); - redraw_trigs = true; - redraw_piano_note = true; } + redraw_trigs = true; + redraw_piano_note = true; } // Move trigger cursor. @@ -766,30 +766,27 @@ handle_trigger_selection(void) { if (trig_selection_loc == 0 || trig_selection_loc == 8) { // We are at the boundary, switch to channel selection. input_handler = handle_channel_selection; - redraw_params = true; } else { trig_selection_loc = MAX(trig_selection_loc - 1, 0); - redraw_piano_note = true; - redraw_params = true; } + redraw_params = true; + redraw_piano_note = true; } else if (key_tap(KEY_RIGHT)) { if (trig_selection_loc != 7 && trig_selection_loc != 15) { trig_selection_loc = MIN(trig_selection_loc + 1, 15); - redraw_piano_note = true; - redraw_params = true; } else if (trig_selection_loc == 7) { input_handler = handle_right_col_selection; right_col_selection_loc = R_COL_STOP; - redraw_params = true; } else if (trig_selection_loc == 15) { right_col_selection_loc = R_COL_BPM; input_handler = handle_right_col_selection; - redraw_params = true; } + redraw_params = true; + redraw_piano_note = true; } else if (key_tap(KEY_UP) || key_tap(KEY_DOWN)) { trig_selection_loc = (trig_selection_loc + 8) % 16; - redraw_piano_note = true; redraw_params = true; + redraw_piano_note = true; } else if (key_tap(KEY_A)) { // Switch to parameter selection. switch (channel_selection_loc) { @@ -806,8 +803,8 @@ handle_trigger_selection(void) { input_handler = handle_param_selection_noise; } break; } - redraw_piano_note = true; redraw_params = true; + redraw_piano_note = true; } } @@ -817,7 +814,7 @@ handle_sequencer_input(void) { // Stop the sequencer or start playing from the beginning. toggle_playing(); } else if (key_hold(KEY_SELECT)) { - if (input_handler == handle_param_selection_sq1 || + if (input_handler == handle_param_selection_sq1 || input_handler == handle_param_selection_sq2 || input_handler == handle_param_selection_wave || input_handler == handle_param_selection_noise) { -- cgit v1.2.1