Added display of selection function for drum midi notes.

dev
Holger Wirtz 2 years ago
parent 30624db43b
commit 9e5e171fec
  1. 53
      UI.hpp

@ -3856,6 +3856,49 @@ void UI_handle_OP(uint8_t param) {
} }
#if NUM_DRUMS > 0 #if NUM_DRUMS > 0
void _check_yes_no_back(uint8_t state) {
if (state == 0) { // BACK
display.setCursor(0, 1);
display.print(F(" "));
display.setCursor(3, 1);
display.print(F(" "));
display.setCursor(4, 1);
display.print(F(" "));
display.setCursor(8, 1);
display.print(F(" "));
display.setCursor(9, 1);
display.print(F("["));
display.setCursor(14, 1);
display.print(F("] "));
} else if (state == 1) { // NO
display.setCursor(0, 1);
display.print(F("["));
display.setCursor(3, 1);
display.print(F("]"));
display.setCursor(4, 1);
display.print(F(" "));
display.setCursor(8, 1);
display.print(F(" "));
display.setCursor(9, 1);
display.print(F(" "));
display.setCursor(14, 1);
display.print(F(" "));
} else { // YES
display.setCursor(0, 1);
display.print(F(" "));
display.setCursor(3, 1);
display.print(F(" "));
display.setCursor(4, 1);
display.print(F("["));
display.setCursor(8, 1);
display.print(F("]"));
display.setCursor(9, 1);
display.print(F(" "));
display.setCursor(14, 1);
display.print(F(" "));
}
}
void _check_display_name(bool display_name, uint8_t digits) { void _check_display_name(bool display_name, uint8_t digits) {
if (display_name == true) { if (display_name == true) {
display.setCursor(0, 1); display.setCursor(0, 1);
@ -4413,9 +4456,8 @@ void UI_func_drum_midi_note(uint8_t param) {
num_changes++; num_changes++;
} }
if (num_changes > 0) { if (num_changes > 0) {
display.show(0, 0, LCD_cols, "Store changes?");
display.show(1, 0, LCD_cols, " NO YES [BACK]");
ask_before_quit_mode = 0; ask_before_quit_mode = 0;
_check_yes_no_back(ask_before_quit_mode);
} else { } else {
ask_before_quit = false; ask_before_quit = false;
LCDML.FUNC_goBackToMenu(); LCDML.FUNC_goBackToMenu();
@ -4432,24 +4474,23 @@ void UI_func_drum_midi_note(uint8_t param) {
active_sample++; active_sample++;
} else if (ask_before_quit_mode >= 0) { } else if (ask_before_quit_mode >= 0) {
++ask_before_quit_mode %= 3; ++ask_before_quit_mode %= 3;
// TODO: Display selection is missing _check_yes_no_back(ask_before_quit_mode);
} else { } else {
configuration.drums.midinote[active_sample] = constrain(configuration.drums.midinote[active_sample] + ENCODER[ENC_L].speed(), DRUMS_MIDI_NOTE_MIN, DRUMS_MIDI_NOTE_MAX); configuration.drums.midinote[active_sample] = constrain(configuration.drums.midinote[active_sample] + ENCODER[ENC_L].speed(), DRUMS_MIDI_NOTE_MIN, DRUMS_MIDI_NOTE_MAX);
} }
} else if (LCDML.BT_checkUp()) { } else if (LCDML.BT_checkUp()) {
if (display_name == true) { if (display_name == true) {
if (active_sample > 0) if (active_sample > 0)
active_sample--; active_sample--;
} else if (ask_before_quit_mode >= 0) { } else if (ask_before_quit_mode >= 0) {
--ask_before_quit_mode %= 3; --ask_before_quit_mode %= 3;
// TODO: Display selection is missing _check_yes_no_back(ask_before_quit_mode);
} else { } else {
configuration.drums.midinote[active_sample] = constrain(configuration.drums.midinote[active_sample] - ENCODER[ENC_L].speed(), DRUMS_MIDI_NOTE_MIN, DRUMS_MIDI_NOTE_MAX); configuration.drums.midinote[active_sample] = constrain(configuration.drums.midinote[active_sample] - ENCODER[ENC_L].speed(), DRUMS_MIDI_NOTE_MIN, DRUMS_MIDI_NOTE_MAX);
} }
} else if (LCDML.BT_checkEnter()) { } else if (LCDML.BT_checkEnter()) {
if (ask_before_quit_mode >= 0) { if (ask_before_quit_mode >= 0) {
if (ask_before_quit_mode == 0) { //NO if (ask_before_quit_mode == 0) { // NO
ask_before_quit = false; ask_before_quit = false;
LCDML.FUNC_goBackToMenu(); LCDML.FUNC_goBackToMenu();
} else if (ask_before_quit_mode == 1) { // YES } else if (ask_before_quit_mode == 1) { // YES

Loading…
Cancel
Save