Skip to content

Commit a99a38a

Browse files
committed
UI changes for page actions
1 parent 7b35dd2 commit a99a38a

File tree

2 files changed

+22
-8
lines changed

2 files changed

+22
-8
lines changed

v2/AciduinoV2/acid_ui_components.ino

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,7 @@ struct PatternControl : PageComponent {
582582
uint8_t pattern_index = 0;
583583
bool copy_state = false;
584584
bool select_all = false;
585+
bool save_as_state = false;
585586

586587
PatternControl()
587588
{
@@ -626,14 +627,17 @@ struct PatternControl : PageComponent {
626627
}
627628

628629
// shift goes to copy/paste function
629-
if (uCtrl.page->isShiftPressed()) {
630+
if (uCtrl.page->isShiftPressed() && !(copy_state || save_as_state)) {
630631
setF1("save as");
631632
setF2("save");
632633
} else {
633634
// shift f1 goes copy, if copy state then no shift f1 goes paste instead of clear
634635
if (copy_state) {
635636
setF1("cancel");
636637
setF2("paste");
638+
} else if (save_as_state) {
639+
setF1("cancel");
640+
setF2("save as");
637641
} else {
638642
setF1("copy");
639643
setF2("all", select_all ? true : false);
@@ -709,14 +713,13 @@ struct PatternControl : PageComponent {
709713
}
710714

711715
void function1() {
712-
if (uCtrl.page->isShiftPressed()) {
713-
// save as: gets all current memory and saves on selected pattern(all tracks)
714-
// save all memory current into selected pattern line
715-
savePattern(selected_line-2+pattern_index);
716+
if (uCtrl.page->isShiftPressed() && !(copy_state || save_as_state)) {
717+
save_as_state = true;
716718
} else {
717-
if (copy_state) {
719+
if (copy_state || save_as_state) {
718720
// cancel
719721
copy_state = false;
722+
save_as_state = false;
720723
} else {
721724
// copy
722725
if (select_all) {
@@ -733,14 +736,14 @@ struct PatternControl : PageComponent {
733736

734737
void function2() {
735738
// save: memory and pattern selected per track as it is on grid
736-
if (uCtrl.page->isShiftPressed()) {
739+
if (uCtrl.page->isShiftPressed() && !(copy_state || save_as_state)) {
737740
// save the grid as it is selected per track
738741
for (uint8_t i=0; i < max_elements; i++) {
739742
savePattern(_pattern_grid[i], i);
740743
}
741744
// save _mute_grid for current_pattern only
742745
saveMuteGrid(current_pattern);
743-
// paste/all
746+
// paste/all, save as selection
744747
} else {
745748
if (copy_state) {
746749
// paste all
@@ -755,6 +758,11 @@ struct PatternControl : PageComponent {
755758
}
756759
}
757760
copy_state = false;
761+
} else if (save_as_state) {
762+
// save as: gets all current memory and saves on selected pattern(all tracks)
763+
// save all memory current into selected pattern line
764+
savePattern(selected_line-2+pattern_index);
765+
save_as_state = false;
758766
} else {
759767
// copy all selection
760768
select_all = !select_all;
@@ -1605,6 +1613,11 @@ void playStop()
16051613
uClock.start();
16061614
}
16071615

1616+
void recToggle()
1617+
{
1618+
AcidSequencer.setRecStatus(!AcidSequencer.getRecStatus());
1619+
}
1620+
16081621
void previousTrack()
16091622
{
16101623
if (_selected_track == 0) {

v2/AciduinoV2/modules.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797
#define USE_AIN
9898
#if defined (USE_POT_8) || defined (USE_POT_16)
9999
#define USE_AIN_4051
100+
#define LEARN_ENABLED
100101
#endif
101102
#endif
102103

0 commit comments

Comments
 (0)