From c7c789096ec6aa31ed98396fd066f1b39dfa8e01 Mon Sep 17 00:00:00 2001 From: Bad Diode Date: Mon, 24 Apr 2023 12:16:55 +0200 Subject: Fix copy-paste behaviour when copying channels --- src/clipboard.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/clipboard.c') diff --git a/src/clipboard.c b/src/clipboard.c index 7491d4b..d802645 100644 --- a/src/clipboard.c +++ b/src/clipboard.c @@ -175,11 +175,13 @@ clipboard_paste(void) { case 0: { for (size_t i = 0; i < 16; i++) { pat_dst->ch1.notes[i] = pat_src->ch1.notes[i]; + pat_dst->ch1.params[i] = pat_src->ch1.params[i]; } } break; case 1: { for (size_t i = 0; i < 16; i++) { pat_dst->ch2.notes[i] = pat_src->ch1.notes[i]; + pat_dst->ch2.params[i] = pat_src->ch1.params[i]; } } break; case 2: { @@ -199,11 +201,16 @@ clipboard_paste(void) { case 0: { for (size_t i = 0; i < 16; i++) { pat_dst->ch1.notes[i] = pat_src->ch2.notes[i]; + pat_dst->ch1.params[i].env_volume = pat_src->ch2.params[i].env_volume; + pat_dst->ch1.params[i].env_time = pat_src->ch2.params[i].env_time; + pat_dst->ch1.params[i].env_direction = pat_src->ch2.params[i].env_direction; + pat_dst->ch1.params[i].duty_cycle = pat_src->ch2.params[i].duty_cycle; } } break; case 1: { for (size_t i = 0; i < 16; i++) { pat_dst->ch2.notes[i] = pat_src->ch2.notes[i]; + pat_dst->ch2.params[i] = pat_src->ch2.params[i]; } } break; case 2: { @@ -233,6 +240,7 @@ clipboard_paste(void) { case 2: { for (size_t i = 0; i < 16; i++) { pat_dst->ch3.notes[i] = pat_src->ch3.notes[i]; + pat_dst->ch3.params[i] = pat_src->ch3.params[i]; } } break; case 3: { @@ -262,6 +270,7 @@ clipboard_paste(void) { case 3: { for (size_t i = 0; i < 16; i++) { pat_dst->ch4.notes[i] = pat_src->ch4.notes[i]; + pat_dst->ch4.params[i] = pat_src->ch4.params[i]; } } break; } -- cgit v1.2.1