aboutsummaryrefslogtreecommitdiffstats
path: root/src/clipboard.c
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2023-04-24 15:24:41 +0200
committerBad Diode <bd@badd10de.dev>2023-04-24 15:24:41 +0200
commit183c43fe2d85be24e43f09e62c07911e82935b1d (patch)
treeedf5077020499179fb909b98935f7971d3e37ace /src/clipboard.c
parentac038887279d43f0a8c346b4392619dfe2e6084a (diff)
downloadstepper-183c43fe2d85be24e43f09e62c07911e82935b1d.tar.gz
stepper-183c43fe2d85be24e43f09e62c07911e82935b1d.zip
Add initial copy-paste of trig to ch
Diffstat (limited to 'src/clipboard.c')
-rw-r--r--src/clipboard.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/clipboard.c b/src/clipboard.c
index d802645..97e083f 100644
--- a/src/clipboard.c
+++ b/src/clipboard.c
@@ -279,6 +279,40 @@ clipboard_paste(void) {
279 } 279 }
280 draw_channels(); 280 draw_channels();
281 draw_triggers(); 281 draw_triggers();
282 } else if (input_handler == handle_channel_selection) {
283 if (clipboard.type == CLIP_TRIG ||
284 clipboard.type == CLIP_PARAM_CH1 ||
285 clipboard.type == CLIP_PARAM_CH2 ||
286 clipboard.type == CLIP_PARAM_CH3 ||
287 clipboard.type == CLIP_PARAM_CH4) {
288 if (clipboard.src_chan == channel_selection_loc) {
289 switch (channel_selection_loc) {
290 case 0: {
291 for (size_t i = 0; i < 17; i++) {
292 pat_dst->ch1.params[i] = pat_src->ch1.params[clipboard.src_trig];
293 }
294 } break;
295 case 1: {
296 for (size_t i = 0; i < 17; i++) {
297 pat_dst->ch2.params[i] = pat_src->ch2.params[clipboard.src_trig];
298 }
299 } break;
300 case 2: {
301 for (size_t i = 0; i < 17; i++) {
302 pat_dst->ch3.params[i] = pat_src->ch3.params[clipboard.src_trig];
303 }
304 } break;
305 case 3: {
306 for (size_t i = 0; i < 17; i++) {
307 pat_dst->ch4.params[i] = pat_src->ch4.params[clipboard.src_trig];
308 }
309 } break;
310 }
311 }
312 // TODO: copy params to position 16 (per-channel) if it matches the
313 // channel type.
314 // TODO: update all parameters in the rest of the triggers.
315 }
282 } else if (input_handler == handle_pattern_selection && clipboard.type == CLIP_PATTERN) { 316 } else if (input_handler == handle_pattern_selection && clipboard.type == CLIP_PATTERN) {
283 // Copy an entire pattern. 317 // Copy an entire pattern.
284 if (pattern_selection_loc != clipboard.src_pat) { 318 if (pattern_selection_loc != clipboard.src_pat) {