diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/sequencer.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/sequencer.c b/src/sequencer.c index 6944b39..285b4ef 100644 --- a/src/sequencer.c +++ b/src/sequencer.c | |||
@@ -16,6 +16,8 @@ sram_write(u8 *src, u16 pos, u16 n_bytes) { | |||
16 | } | 16 | } |
17 | 17 | ||
18 | void set_time(int bpm); | 18 | void set_time(int bpm); |
19 | void clipboard_paste(void); | ||
20 | void clipboard_copy(void); | ||
19 | 21 | ||
20 | // | 22 | // |
21 | // Color indexes. | 23 | // Color indexes. |
@@ -2130,10 +2132,11 @@ handle_pattern_selection(void) { | |||
2130 | void | 2132 | void |
2131 | handle_param_selection_sq1(void) { | 2133 | handle_param_selection_sq1(void) { |
2132 | // Go back to trigger selection. | 2134 | // Go back to trigger selection. |
2133 | if (key_tap(KEY_A)) { | 2135 | if (key_released(KEY_A)) { |
2134 | draw_params_cursor(param_selection_loc, COL_BG); | 2136 | draw_params_cursor(param_selection_loc, COL_BG); |
2135 | input_handler = handle_trigger_selection; | 2137 | input_handler = handle_trigger_selection; |
2136 | draw_trig_cursor(trig_selection_loc, COL_CURSOR); | 2138 | draw_trig_cursor(trig_selection_loc, COL_CURSOR); |
2139 | return; | ||
2137 | } | 2140 | } |
2138 | 2141 | ||
2139 | // Cursor movement. | 2142 | // Cursor movement. |
@@ -2223,10 +2226,11 @@ handle_param_selection_sq1(void) { | |||
2223 | void | 2226 | void |
2224 | handle_param_selection_sq2(void) { | 2227 | handle_param_selection_sq2(void) { |
2225 | // Go back to trigger selection. | 2228 | // Go back to trigger selection. |
2226 | if (key_tap(KEY_A)) { | 2229 | if (key_released(KEY_A)) { |
2227 | draw_params_cursor(param_selection_loc, COL_BG); | 2230 | draw_params_cursor(param_selection_loc, COL_BG); |
2228 | input_handler = handle_trigger_selection; | 2231 | input_handler = handle_trigger_selection; |
2229 | draw_trig_cursor(trig_selection_loc, COL_CURSOR); | 2232 | draw_trig_cursor(trig_selection_loc, COL_CURSOR); |
2233 | return; | ||
2230 | } | 2234 | } |
2231 | 2235 | ||
2232 | // Cursor movement. | 2236 | // Cursor movement. |
@@ -2277,10 +2281,11 @@ handle_param_selection_wave(void) { | |||
2277 | Pattern *pat = &patterns[pattern_selection_loc]; | 2281 | Pattern *pat = &patterns[pattern_selection_loc]; |
2278 | 2282 | ||
2279 | // Go back to trigger selection. | 2283 | // Go back to trigger selection. |
2280 | if (key_tap(KEY_A)) { | 2284 | if (key_released(KEY_A)) { |
2281 | draw_params_cursor(param_selection_loc, COL_BG); | 2285 | draw_params_cursor(param_selection_loc, COL_BG); |
2282 | input_handler = handle_trigger_selection; | 2286 | input_handler = handle_trigger_selection; |
2283 | draw_trig_cursor(trig_selection_loc, COL_CURSOR); | 2287 | draw_trig_cursor(trig_selection_loc, COL_CURSOR); |
2288 | return; | ||
2284 | } | 2289 | } |
2285 | 2290 | ||
2286 | // Cursor movement. | 2291 | // Cursor movement. |
@@ -2452,10 +2457,11 @@ handle_param_selection_wave(void) { | |||
2452 | void | 2457 | void |
2453 | handle_param_selection_noise(void) { | 2458 | handle_param_selection_noise(void) { |
2454 | // Go back to trigger selection. | 2459 | // Go back to trigger selection. |
2455 | if (key_tap(KEY_A)) { | 2460 | if (key_released(KEY_A)) { |
2456 | draw_params_cursor(param_selection_loc, COL_BG); | 2461 | draw_params_cursor(param_selection_loc, COL_BG); |
2457 | input_handler = handle_trigger_selection; | 2462 | input_handler = handle_trigger_selection; |
2458 | draw_trig_cursor(trig_selection_loc, COL_CURSOR); | 2463 | draw_trig_cursor(trig_selection_loc, COL_CURSOR); |
2464 | return; | ||
2459 | } | 2465 | } |
2460 | 2466 | ||
2461 | // Cursor movement. | 2467 | // Cursor movement. |
@@ -2922,8 +2928,15 @@ handle_sequencer_input(void) { | |||
2922 | // Stop the sequencer or start playing from the beginning. | 2928 | // Stop the sequencer or start playing from the beginning. |
2923 | toggle_playing(); | 2929 | toggle_playing(); |
2924 | } else if (key_hold(KEY_SELECT)) { | 2930 | } else if (key_hold(KEY_SELECT)) { |
2931 | if (input_handler == handle_param_selection_sq1 || | ||
2932 | input_handler == handle_param_selection_sq2 || | ||
2933 | input_handler == handle_param_selection_wave || | ||
2934 | input_handler == handle_param_selection_noise) { | ||
2935 | clipboard_copy(); | ||
2936 | input_handler(); | ||
2937 | } | ||
2925 | // Clipboard combo. | 2938 | // Clipboard combo. |
2926 | if (key_tap(KEY_A)) { | 2939 | else if (key_tap(KEY_A)) { |
2927 | clipboard_paste(); | 2940 | clipboard_paste(); |
2928 | } else if (key_tap(KEY_B)){ | 2941 | } else if (key_tap(KEY_B)){ |
2929 | clipboard_copy(); | 2942 | clipboard_copy(); |