From 5f0fde17c2a5ae3178e59f096b0407eb83526708 Mon Sep 17 00:00:00 2001 From: Holger Wirtz Date: Tue, 31 Mar 2020 14:25:39 +0200 Subject: [PATCH] Rewrite of menu structure and parts of menu control. Not yet ready. --- MicroDexed.ino | 11 +- UI.hpp | 1299 ++++++++++++++++++------------------- UI_1_FX.h | 8 +- config.h | 4 +- doc/LCDMenu-functions.txt | 2 + 5 files changed, 635 insertions(+), 689 deletions(-) diff --git a/MicroDexed.ino b/MicroDexed.ino index 89ab682..3972ea8 100644 --- a/MicroDexed.ino +++ b/MicroDexed.ino @@ -219,7 +219,6 @@ uint32_t peak_r = 0; uint32_t peak_l = 0; bool eeprom_update_flag = false; config_t configuration; -uint8_t selected_dexed_instance = 0; const uint8_t cs_pins[] = { SDCARD_TEENSY_CS_PIN, SDCARD_AUDIO_CS_PIN }; const uint8_t mosi_pins[] = { SDCARD_TEENSY_MOSI_PIN, SDCARD_AUDIO_MOSI_PIN }; const uint8_t sck_pins[] = { SDCARD_TEENSY_SCK_PIN, SDCARD_AUDIO_SCK_PIN }; @@ -237,7 +236,6 @@ int16_t delayline_l[MOD_DELAY_SAMPLE_BUFFER]; LCDMenuLib2 ***********************************************************************/ extern LCDMenuLib2 LCDML; -extern uint8_t menu_state; #endif void setup() @@ -604,6 +602,8 @@ void setup() #ifdef DEBUG Serial.println(F("")); #endif + + LCDML.OTHER_jumpToFunc(UI_func_voice_select); } void loop() @@ -623,13 +623,6 @@ void loop() #ifdef ENABLE_LCD_UI // LCD Menu LCDML.loop(); - - // initial starts voice selection menu as default - if (menu_state == MENU_START) - { - menu_state = MENU_VOICE; - UI_func_voice_selection(0); - } #endif // EEPROM update handling diff --git a/UI.hpp b/UI.hpp index fb639b2..3ac9444 100644 --- a/UI.hpp +++ b/UI.hpp @@ -89,7 +89,6 @@ extern AudioSourceMicroDexed* MicroDexed[NUM_DEXED]; extern AudioAmplifier* dexed_level[NUM_DEXED]; extern AudioEffectMonoStereo* mono2stereo[NUM_DEXED]; extern AudioSynthWaveformDc* pan[NUM_DEXED]; -extern uint8_t selected_dexed_instance; extern char sd_string[LCD_cols + 1]; /*********************************************************************** @@ -140,24 +139,15 @@ const uint8_t meter_bar[5][8] = { enum { SCROLLBAR, BLOCKBAR, METERBAR }; enum { ENC_R, ENC_L }; -enum { MENU_START, MENU_VOICE, MENU_EDIT, MENU_VOLUME }; enum {MENU_VOICE_BANK, MENU_VOICE_SOUND}; -uint8_t menu_state = MENU_START; -uint8_t menu_voice = MENU_VOICE_SOUND; +uint8_t menu_voice_select = MENU_VOICE_SOUND; +uint8_t last_menu = 255; + void lcdml_menu_display(void); void lcdml_voice_menu_display(void); void lcdml_menu_clear(void); void lcdml_menu_control(void); -void encoder_right_up(void); -void encoder_right_down(void); -void encoder_right_button_long(void); -void encoder_right_button_short(void); -void encoder_left_up(void); -void encoder_left_down(void); -void encoder_left_button_long(void); -void encoder_left_button_short(void); void lcdml_voice_menu_control(void); -void UI_func_sound(uint8_t param); #ifdef USE_FX void UI_func_reverb_roomsize(uint8_t param); void UI_func_reverb_damping(uint8_t param); @@ -212,13 +202,13 @@ void UI_func_OP5(uint8_t param); void UI_func_OP6(uint8_t param); void UI_handle_OP(uint8_t param, uint8_t op, uint8_t instance_id); void UI_func_information(uint8_t param); -void UI_func_voice_selection(uint8_t param); void UI_func_volume(uint8_t param); void UI_func_load(uint8_t param); void UI_func_save(uint8_t param); void UI_func_midi_soft_thru(uint8_t param); void UI_func_velocity_level(uint8_t param); void UI_func_firmware_reset(uint8_t param); +void UI_func_voice_select(uint8_t param); void UI_function_not_enabled(void); void UI_function_not_implemented(uint8_t param); void lcd_display_int(int16_t var, uint8_t size, bool zeros, bool brackets, bool sign); @@ -249,11 +239,129 @@ LCDML_createMenu(_LCDML_DISP_cnt); /*********************************************************************** CONTROL ***********************************************************************/ +class EncoderDirection +{ + public: + EncoderDirection(void) + { + reset(); + } + + void reset(void) + { + button_short = false; + button_long = false; + left = false; + right = false; + up = false; + down = false; + } + + void ButtonShort(bool state) + { + button_short = state; + } + + bool ButtonShort(void) + { + if (button_short == true) + { + button_short = false; + return (true); + } + return (false); + } + + void ButtonLong(bool state) + { + button_long = state; + } + + bool ButtonLong(void) + { + if (button_long == true) + { + button_long = false; + return (true); + } + return (false); + } + + void Left(bool state) + { + left = state; + } + + bool Left(void) + { + if (left == true) + { + left = false; + return (true); + } + return (false); + } + + void Right(bool state) + { + right = state; + } + + bool Right(void) + { + if (right == true) + { + right = false; + return (true); + } + return (false); + } + + void Up(bool state) + { + up = state; + } + + bool Up(void) + { + if (up == true) + { + up = false; + return (true); + } + return (false); + } + + void Down(bool state) + { + down = state; + } + + bool Down(void) + { + if (down == true) + { + down = false; + return (true); + } + return (false); + } + + private: + bool button_short; + bool button_long; + bool left; + bool right; + bool up; + bool down; +}; + #define g_LCDML_CONTROL_button_long_press LONG_BUTTON_PRESS #define g_LCDML_CONTROL_button_short_press BUT_DEBOUNCE_MS //Encoder ENCODER[NUM_ENCODER] = {Encoder(ENC_R_PIN_B, ENC_R_PIN_A), Encoder(ENC_L_PIN_B, ENC_L_PIN_A)}; MD_REncoder ENCODER[NUM_ENCODER] = {MD_REncoder(ENC_R_PIN_B, ENC_R_PIN_A), MD_REncoder(ENC_L_PIN_B, ENC_L_PIN_A)}; +EncoderDirection encoderDir[NUM_ENCODER]; long g_LCDML_CONTROL_button_press_time[NUM_ENCODER] = {0, 0}; bool g_LCDML_CONTROL_button_prev[NUM_ENCODER] = {HIGH, HIGH}; @@ -263,7 +371,8 @@ uint8_t g_LCDML_CONTROL_prev[NUM_ENCODER] = {0, 0}; const uint8_t * flipped_scroll_bar[5]; const uint8_t * flipped_block_bar[5]; -uint8_t * rotTile(const uint8_t * tile) { +uint8_t * rotTile(const uint8_t * tile) +{ uint8_t * newt = new uint8_t[8]; for (int x = 0; x < 8; x++) { uint8_t newb = 0; @@ -277,7 +386,8 @@ uint8_t * rotTile(const uint8_t * tile) { } #endif -void setup_ui(void) { +void setup_ui(void) +{ // LCD Begin #ifdef I2C_DISPLAY lcd.init(); @@ -303,11 +413,12 @@ void setup_ui(void) { // Enable Menu Rollover //LCDML.MENU_enRollover(); // Enable Screensaver (screensaver menu function, time to activate in ms) - //LCDML.SCREEN_enable(UI_func_voice_selection, VOICE_SELECTION_MS); // set to 10 seconds + LCDML.SCREEN_enable(UI_func_voice_select, VOICE_SELECTION_MS); // set to 10 seconds } #ifdef DEBUG -void setup_debug_message(void) { +void setup_debug_message(void) +{ // LCD Begin lcd.clear(); lcd.setCursor(1, 0); @@ -329,61 +440,84 @@ void lcdml_menu_control(void) pinMode(BUT_R_PIN, INPUT_PULLUP); pinMode(BUT_L_PIN, INPUT_PULLUP); - ENCODER[ENC_L].begin(); ENCODER[ENC_R].begin(); + ENCODER[ENC_L].begin(); } - if (back_from_volume > BACK_FROM_VOLUME_MS && menu_state == MENU_VOLUME) + if (back_from_volume > BACK_FROM_VOLUME_MS && LCDML.FUNC_getID() == VOLUME_MENU_ID) { - lcd_special_chars(SCROLLBAR); - UI_func_voice_selection(0); + encoderDir[ENC_L].reset(); + encoderDir[ENC_R].reset(); + eeprom_write(); + //lcd_special_chars(SCROLLBAR); + + if (last_menu < 255) + LCDML.OTHER_jumpToID(last_menu); + else + LCDML.MENU_goRoot(); } - //Volatile Variable + // Volatile Variables long g_LCDML_CONTROL_Encoder_position[NUM_ENCODER] = {ENCODER[ENC_R].read(), ENCODER[ENC_L].read()}; bool button[NUM_ENCODER] = {digitalRead(BUT_R_PIN), digitalRead(BUT_L_PIN)}; /************************************************************************************ - Basic encoder handlying (from LCDMenuLib2) + Basic encoder handling (from LCDMenuLib2) ************************************************************************************/ + // RIGHT if (g_LCDML_CONTROL_Encoder_position[ENC_R] <= -3) { if (!button[ENC_R]) { - LCDML.BT_right(); + LCDML.BT_left(); +#ifdef DEBUG + Serial.println(F("ENC-R left")); +#endif + encoderDir[ENC_R].Left(true); g_LCDML_CONTROL_button_prev[ENC_R] = LOW; g_LCDML_CONTROL_button_press_time[ENC_R] = -1; } else { - encoder_right_up(); +#ifdef DEBUG + Serial.println(F("ENC-R down")); +#endif + encoderDir[ENC_R].Down(true); + LCDML.BT_down(); } ENCODER[ENC_R].write(g_LCDML_CONTROL_Encoder_position[ENC_R] + 4); } else if (g_LCDML_CONTROL_Encoder_position[ENC_R] >= 3) { - if (!button[ENC_R]) { +#ifdef DEBUG + Serial.println(F("ENC-R right")); +#endif + encoderDir[ENC_R].Right(true); LCDML.BT_right(); g_LCDML_CONTROL_button_prev[ENC_R] = LOW; g_LCDML_CONTROL_button_press_time[ENC_R] = -1; } else { - encoder_right_down(); +#ifdef DEBUG + Serial.println(F("ENC-R up")); +#endif + encoderDir[ENC_R].Up(true); + LCDML.BT_up(); } ENCODER[ENC_R].write(g_LCDML_CONTROL_Encoder_position[ENC_R] - 4); } else { - if (!button[ENC_R] && g_LCDML_CONTROL_button_prev[ENC_R]) // falling edge, button[ENC_R] pressed + if (!button[ENC_R] && g_LCDML_CONTROL_button_prev[ENC_R]) //falling edge, button pressed { g_LCDML_CONTROL_button_prev[ENC_R] = LOW; g_LCDML_CONTROL_button_press_time[ENC_R] = millis(); } - else if (button[ENC_R] && !g_LCDML_CONTROL_button_prev[ENC_R]) // rising edge, button[ENC_R] not active + else if (button[ENC_R] && !g_LCDML_CONTROL_button_prev[ENC_R]) //rising edge, button not active { g_LCDML_CONTROL_button_prev[ENC_R] = HIGH; @@ -394,52 +528,77 @@ void lcdml_menu_control(void) } else if ((millis() - g_LCDML_CONTROL_button_press_time[ENC_R]) >= g_LCDML_CONTROL_button_long_press) { - encoder_right_button_long(); +#ifdef DEBUG + Serial.println("ENC-R long"); +#endif + //LCDML.BT_quit(); + encoderDir[ENC_R].ButtonLong(true); + LCDML.OTHER_jumpToFunc(UI_func_voice_select); } else if ((millis() - g_LCDML_CONTROL_button_press_time[ENC_R]) >= g_LCDML_CONTROL_button_short_press) { - encoder_right_button_short(); +#ifdef DEBUG + Serial.println(F("ENC-R short")); +#endif + encoderDir[ENC_R].ButtonShort(true); + LCDML.BT_enter(); } } } + // LEFT if (g_LCDML_CONTROL_Encoder_position[ENC_L] <= -3) { if (!button[ENC_L]) { - //LCDML.BT_left(); +#ifdef DEBUG + Serial.println(F("ENC-L left")); +#endif + encoderDir[ENC_L].Left(true); + LCDML.BT_left(); g_LCDML_CONTROL_button_prev[ENC_L] = LOW; g_LCDML_CONTROL_button_press_time[ENC_L] = -1; } else { - encoder_left_up(); +#ifdef DEBUG + Serial.println(F("ENC-L down")); +#endif + encoderDir[ENC_L].Down(true); + LCDML.BT_down(); } ENCODER[ENC_L].write(g_LCDML_CONTROL_Encoder_position[ENC_L] + 4); } else if (g_LCDML_CONTROL_Encoder_position[ENC_L] >= 3) { - if (!button[ENC_L]) { - //LCDML.BT_right(); +#ifdef DEBUG + Serial.println(F("ENC-L right")); +#endif + encoderDir[ENC_L].Right(true); + LCDML.BT_right(); g_LCDML_CONTROL_button_prev[ENC_L] = LOW; g_LCDML_CONTROL_button_press_time[ENC_L] = -1; } else { - encoder_left_down(); +#ifdef DEBUG + Serial.println(F("ENC-L up")); +#endif + encoderDir[ENC_L].Up(true); + LCDML.BT_up(); } ENCODER[ENC_L].write(g_LCDML_CONTROL_Encoder_position[ENC_L] - 4); } else { - if (!button[ENC_L] && g_LCDML_CONTROL_button_prev[ENC_L]) // falling edge, button[ENC_L] pressed + if (!button[ENC_L] && g_LCDML_CONTROL_button_prev[ENC_L]) //falling edge, button pressed { g_LCDML_CONTROL_button_prev[ENC_L] = LOW; g_LCDML_CONTROL_button_press_time[ENC_L] = millis(); } - else if (button[ENC_L] && !g_LCDML_CONTROL_button_prev[ENC_L]) // rising edge, button[ENC_L] not active + else if (button[ENC_L] && !g_LCDML_CONTROL_button_prev[ENC_L]) //rising edge, button not active { g_LCDML_CONTROL_button_prev[ENC_L] = HIGH; @@ -450,240 +609,22 @@ void lcdml_menu_control(void) } else if ((millis() - g_LCDML_CONTROL_button_press_time[ENC_L]) >= g_LCDML_CONTROL_button_long_press) { +#ifdef DEBUG + Serial.println(F("ENC-L long")); +#endif //LCDML.BT_quit(); - encoder_left_button_long(); + //encoderDir[ENC_L].ButtonLong(true); } else if ((millis() - g_LCDML_CONTROL_button_press_time[ENC_L]) >= g_LCDML_CONTROL_button_short_press) { //LCDML.BT_enter(); - encoder_left_button_short(); - } - } - } -} - -/************************************************************************************ - RIGHT Encoder functions - ************************************************************************************/ -void encoder_right_up(void) -{ - uint8_t instance_id = 0; - int8_t voice_tmp; - uint8_t bank_tmp; - - if (LCDML.FUNC_getID() > MENU_ID_OF_INSTANCE_2 && LCDML.FUNC_getID() != 255) - instance_id = 1; - - switch (menu_state) - { - case MENU_EDIT: - case MENU_VOLUME: - menu_state = MENU_EDIT; - LCDML.BT_down(); - break; - case MENU_VOICE: #ifdef DEBUG - Serial.println(F("State: MENU_VOICE, Encoder right up")); -#endif - switch (menu_voice) - { - case MENU_VOICE_BANK: - bank_tmp = constrain(configuration.dexed[instance_id].bank + ENCODER[ENC_R].speed(), 0, MAX_BANKS - 1); - configuration.dexed[instance_id].bank = bank_tmp; -#ifdef DISPLAY_LCD_SPI - change_disp_sd(false); -#endif - load_sysex(configuration.dexed[instance_id].bank, configuration.dexed[instance_id].voice, instance_id); - get_voice_names_from_bank(configuration.dexed[instance_id].bank, instance_id); -#ifdef DISPLAY_LCD_SPI - change_disp_sd(true); -#endif - eeprom_write(); - break; - case MENU_VOICE_SOUND: - voice_tmp = configuration.dexed[instance_id].voice + ENCODER[ENC_R].speed(); - if (voice_tmp >= MAX_VOICES && configuration.dexed[instance_id].bank + 1 < MAX_BANKS) - { - voice_tmp %= MAX_VOICES; - configuration.dexed[instance_id].bank++; - configuration.dexed[instance_id].bank = constrain(configuration.dexed[instance_id].bank, 0, MAX_BANKS - 1); - } - else if (voice_tmp >= MAX_VOICES && configuration.dexed[instance_id].bank + 1 >= MAX_BANKS) - { - voice_tmp = MAX_VOICES - 1; - } - configuration.dexed[instance_id].voice = voice_tmp; - -#ifdef DISPLAY_LCD_SPI - change_disp_sd(false); -#endif - load_sysex(configuration.dexed[instance_id].bank, configuration.dexed[instance_id].voice, instance_id); - get_voice_names_from_bank(configuration.dexed[instance_id].bank, instance_id); -#ifdef DISPLAY_LCD_SPI - change_disp_sd(true); + Serial.println(F("ENC-L short")); #endif - eeprom_write(); - break; + encoderDir[ENC_L].ButtonShort(true); + LCDML.BT_quit(); } - UI_func_voice_selection(0); - break; - } -} - -void encoder_right_down(void) -{ - uint8_t instance_id = 0; - int8_t voice_tmp; - uint8_t bank_tmp; - - if (LCDML.FUNC_getID() > MENU_ID_OF_INSTANCE_2 && LCDML.FUNC_getID() != 255) - instance_id = 1; - - switch (menu_state) - { - case MENU_EDIT: - case MENU_VOLUME: - menu_state = MENU_EDIT; - LCDML.BT_up(); - break; - case MENU_VOICE: -#ifdef DEBUG - Serial.println(F("State: MENU_VOICE, Encoder right down")); -#endif - switch (menu_voice) - { - case MENU_VOICE_BANK: - bank_tmp = constrain(configuration.dexed[instance_id].bank - ENCODER[ENC_R].speed(), 0, MAX_BANKS - 1); - configuration.dexed[instance_id].bank = bank_tmp; -#ifdef DISPLAY_LCD_SPI - change_disp_sd(false); -#endif - load_sysex(configuration.dexed[instance_id].bank, configuration.dexed[instance_id].voice, instance_id); - get_voice_names_from_bank(configuration.dexed[instance_id].bank, instance_id); -#ifdef DISPLAY_LCD_SPI - change_disp_sd(true); -#endif - eeprom_write(); - break; - case MENU_VOICE_SOUND: - voice_tmp = configuration.dexed[instance_id].voice - ENCODER[ENC_R].speed(); - if (voice_tmp < 0 && configuration.dexed[instance_id].bank - 1 >= 0) - { - configuration.dexed[instance_id].bank--; - configuration.dexed[instance_id].bank = constrain(configuration.dexed[instance_id].bank, 0, MAX_BANKS - 1); - } - else if (voice_tmp < 0 && configuration.dexed[instance_id].bank - 1 <= 0) - { - voice_tmp = 0; - } - if (voice_tmp < 0) - voice_tmp = MAX_VOICES + voice_tmp; - configuration.dexed[instance_id].voice = voice_tmp; - -#ifdef DISPLAY_LCD_SPI - change_disp_sd(false); -#endif - load_sysex(configuration.dexed[instance_id].bank, configuration.dexed[instance_id].voice, instance_id); - get_voice_names_from_bank(configuration.dexed[instance_id].bank, instance_id); -#ifdef DISPLAY_LCD_SPI - change_disp_sd(true); -#endif - eeprom_write(); - break; - } - UI_func_voice_selection(0); - break; - } -} - -void encoder_right_button_long(void) -{ -#ifdef DEBUG - Serial.println(F("Encoder right long press")); -#endif - LCDML.BT_quit(); -} - -void encoder_right_button_short(void) -{ -#ifdef DEBUG - Serial.println(F("Encoder right short press")); -#endif - if (menu_state == MENU_EDIT) - { - LCDML.BT_enter(); - } - else if (menu_state == MENU_VOICE) - { -#ifdef DEBUG - Serial.println(F("State: MENU_VOICE, button short press")); -#endif - if (menu_voice == MENU_VOICE_BANK) - menu_voice = MENU_VOICE_SOUND; - else - menu_voice = MENU_VOICE_BANK; - UI_func_voice_selection(0); - } -} - -/************************************************************************************ - LEFT Encoder functions - ************************************************************************************/ -void encoder_left_up(void) -{ -#ifdef DEBUG - Serial.println(F("Volume +")); -#endif - configuration.vol = constrain(configuration.vol + ENCODER[ENC_L].speed(), VOLUME_MIN, VOLUME_MAX); - //eeprom_write(); - //set_volume(configuration.vol, configuration.mono); - - UI_func_volume(0); -} - -void encoder_left_down(void) -{ -#ifdef DEBUG - Serial.println(F("Volume -")); -#endif - configuration.vol = constrain(configuration.vol - ENCODER[ENC_L].speed(), VOLUME_MIN, VOLUME_MAX); - //eeprom_write(); - //set_volume(configuration.vol, configuration.mono); - - UI_func_volume(0); -} - -void encoder_left_button_long(void) -{ -#ifdef DEBUG - Serial.println(F("Encoder left long press")); -#endif - if (menu_state == MENU_EDIT) - { - menu_state = MENU_VOICE; - UI_func_voice_selection(0); - } - else if (menu_state == MENU_VOICE) - { - menu_state = MENU_EDIT; - LCDML.MENU_goRoot(); - } -} - -void encoder_left_button_short(void) -{ -#ifdef DEBUG - Serial.println(F("Encoder left short press")); -#endif - if (menu_state == MENU_EDIT) - { - //LCDML.FUNC_goBackToMenu(); - LCDML.BT_quit(); - } - else if (menu_state == MENU_VOICE) - { - menu_state = MENU_EDIT; - LCDML.MENU_goRoot(); + } } } @@ -836,18 +777,16 @@ void UI_func_reverb_roomsize(uint8_t param) { if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + last_menu = LCDML.FUNC_getID(); + lcd_special_chars(BLOCKBAR); lcd_display_bar_int("Reverb Room", configuration.reverb_roomsize, 1.0, REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX, 3, false, false, false, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) configuration.reverb_roomsize = constrain(configuration.reverb_roomsize + ENCODER[ENC_R].speed(), REVERB_ROOMSIZE_MIN, REVERB_ROOMSIZE_MAX); @@ -865,6 +804,8 @@ void UI_func_reverb_roomsize(uint8_t param) { lcd_special_chars(SCROLLBAR); eeprom_write(); + encoderDir[ENC_R].reset(); + last_menu = 255; } } @@ -872,18 +813,15 @@ void UI_func_reverb_damping(uint8_t param) { if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + lcd_special_chars(BLOCKBAR); lcd_display_bar_int("Reverb Damp.", configuration.reverb_damping, 1.0, REVERB_DAMPING_MIN, REVERB_DAMPING_MAX, 3, false, false, false, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) configuration.reverb_damping = constrain(configuration.reverb_damping + ENCODER[ENC_R].speed(), REVERB_DAMPING_MIN, REVERB_DAMPING_MAX); @@ -901,6 +839,7 @@ void UI_func_reverb_damping(uint8_t param) { lcd_special_chars(SCROLLBAR); eeprom_write(); + encoderDir[ENC_R].reset(); } } @@ -913,18 +852,15 @@ void UI_func_reverb_send(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + lcd_special_chars(BLOCKBAR); lcd_display_bar_int("Reverb Send", configuration.dexed[instance_id].reverb_send, 1.0, REVERB_SEND_MIN, REVERB_SEND_MAX, 3, false, false, false, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) configuration.dexed[instance_id].reverb_send = constrain(configuration.dexed[instance_id].reverb_send + ENCODER[ENC_R].speed(), REVERB_SEND_MIN, REVERB_SEND_MAX); @@ -942,6 +878,7 @@ void UI_func_reverb_send(uint8_t param) { lcd_special_chars(SCROLLBAR); eeprom_write(); + encoderDir[ENC_R].reset(); } } @@ -949,18 +886,15 @@ void UI_func_reverb_level(uint8_t param) { if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + lcd_special_chars(BLOCKBAR); lcd_display_bar_int("Reverb Level", configuration.reverb_level, 1.0, REVERB_LEVEL_MIN, REVERB_LEVEL_MAX, 3, false, false, false, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) configuration.reverb_level = constrain(configuration.reverb_level + ENCODER[ENC_R].speed(), REVERB_LEVEL_MIN, REVERB_LEVEL_MAX); @@ -978,6 +912,7 @@ void UI_func_reverb_level(uint8_t param) { lcd_special_chars(SCROLLBAR); eeprom_write(); + encoderDir[ENC_R].reset(); } } @@ -985,18 +920,15 @@ void UI_func_chorus_frequency(uint8_t param) { if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + lcd_special_chars(BLOCKBAR); lcd_display_bar_float("Chorus Frq.", configuration.chorus_frequency, 0.1, CHORUS_FREQUENCY_MIN, CHORUS_FREQUENCY_MAX, 2, 1, false, false, false, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) configuration.chorus_frequency = constrain(configuration.chorus_frequency + ENCODER[ENC_R].speed(), CHORUS_FREQUENCY_MIN, CHORUS_FREQUENCY_MAX); @@ -1013,6 +945,7 @@ void UI_func_chorus_frequency(uint8_t param) { lcd_special_chars(SCROLLBAR); eeprom_write(); + encoderDir[ENC_R].reset(); } } @@ -1020,16 +953,15 @@ void UI_func_chorus_waveform(uint8_t param) { if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + lcd.setCursor(0, 0); lcd.print(F("Chorus Waveform")); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - LCDML.FUNC_goBackToMenu(); - else if (LCDML.BT_checkDown()) + if (LCDML.BT_checkDown()) configuration.chorus_waveform = constrain(configuration.chorus_waveform + 1, CHORUS_WAVEFORM_MIN, CHORUS_WAVEFORM_MAX); else if (LCDML.BT_checkUp()) configuration.chorus_waveform = constrain(configuration.chorus_waveform - 1, CHORUS_WAVEFORM_MIN, CHORUS_WAVEFORM_MAX); @@ -1056,6 +988,7 @@ void UI_func_chorus_waveform(uint8_t param) { // you can here reset some global vars or do nothing eeprom_write(); + encoderDir[ENC_R].reset(); } } @@ -1063,18 +996,15 @@ void UI_func_chorus_depth(uint8_t param) { if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + lcd_special_chars(BLOCKBAR); lcd_display_bar_int("Chorus Dpt.", configuration.chorus_depth, 1.0, CHORUS_DEPTH_MIN, CHORUS_DEPTH_MAX, 3, false, false, false, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) configuration.chorus_depth = constrain(configuration.chorus_depth + ENCODER[ENC_R].speed(), CHORUS_DEPTH_MIN, CHORUS_DEPTH_MAX); @@ -1091,6 +1021,7 @@ void UI_func_chorus_depth(uint8_t param) { lcd_special_chars(SCROLLBAR); eeprom_write(); + encoderDir[ENC_R].reset(); } } @@ -1103,18 +1034,15 @@ void UI_func_chorus_send(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + lcd_special_chars(BLOCKBAR); lcd_display_bar_int("Chorus Send", configuration.dexed[instance_id].chorus_send, 1.0, CHORUS_SEND_MIN, CHORUS_SEND_MAX, 3, false, false, false, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) configuration.dexed[instance_id].chorus_send = constrain(configuration.dexed[instance_id].chorus_send + ENCODER[ENC_R].speed(), CHORUS_SEND_MIN, CHORUS_SEND_MAX); @@ -1132,6 +1060,7 @@ void UI_func_chorus_send(uint8_t param) { lcd_special_chars(SCROLLBAR); eeprom_write(); + encoderDir[ENC_R].reset(); } } @@ -1139,18 +1068,15 @@ void UI_func_chorus_level(uint8_t param) { if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + lcd_special_chars(BLOCKBAR); lcd_display_bar_int("Chorus Lvl.", configuration.chorus_level, 1.0, CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX, 3, false, false, false, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) configuration.chorus_level = constrain(configuration.chorus_level + ENCODER[ENC_R].speed(), CHORUS_LEVEL_MIN, CHORUS_LEVEL_MAX); @@ -1168,6 +1094,7 @@ void UI_func_chorus_level(uint8_t param) { lcd_special_chars(SCROLLBAR); eeprom_write(); + encoderDir[ENC_R].reset(); } } @@ -1175,18 +1102,15 @@ void UI_func_delay_time(uint8_t param) { if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + lcd_special_chars(BLOCKBAR); lcd_display_bar_int("Delay Time", configuration.delay_time, 10.0, DELAY_TIME_MIN, DELAY_TIME_MAX, 3, false, false, false, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) configuration.delay_time = constrain(configuration.delay_time + ENCODER[ENC_R].speed(), DELAY_TIME_MIN, DELAY_TIME_MAX); @@ -1204,6 +1128,7 @@ void UI_func_delay_time(uint8_t param) { lcd_special_chars(SCROLLBAR); eeprom_write(); + encoderDir[ENC_R].reset(); } } @@ -1211,18 +1136,15 @@ void UI_func_delay_feedback(uint8_t param) { if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + lcd_special_chars(BLOCKBAR); lcd_display_bar_int("Delay Feedb.", configuration.delay_feedback, 1.0, DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX, 3, false, false, false, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) configuration.delay_feedback = constrain(configuration.delay_feedback + ENCODER[ENC_R].speed(), DELAY_FEEDBACK_MIN, DELAY_FEEDBACK_MAX); @@ -1241,6 +1163,7 @@ void UI_func_delay_feedback(uint8_t param) { lcd_special_chars(SCROLLBAR); eeprom_write(); + encoderDir[ENC_R].reset(); } } @@ -1253,18 +1176,15 @@ void UI_func_delay_send(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + lcd_special_chars(BLOCKBAR); lcd_display_bar_int("Delay Send", configuration.dexed[instance_id].delay_send, 1.0, DELAY_SEND_MIN, DELAY_SEND_MAX, 3, false, false, false, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) configuration.dexed[instance_id].delay_send = constrain(configuration.dexed[instance_id].delay_send + ENCODER[ENC_R].speed(), DELAY_SEND_MIN, DELAY_SEND_MAX); @@ -1282,6 +1202,7 @@ void UI_func_delay_send(uint8_t param) { lcd_special_chars(SCROLLBAR); eeprom_write(); + encoderDir[ENC_R].reset(); } } @@ -1289,18 +1210,15 @@ void UI_func_delay_level(uint8_t param) { if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + lcd_special_chars(BLOCKBAR); lcd_display_bar_int("Delay Lvl.", configuration.delay_level, 1.0, DELAY_LEVEL_MIN, DELAY_LEVEL_MAX, 3, false, false, false, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) configuration.delay_level = constrain(configuration.delay_level + ENCODER[ENC_R].speed(), DELAY_LEVEL_MIN, DELAY_LEVEL_MAX); @@ -1318,6 +1236,7 @@ void UI_func_delay_level(uint8_t param) { lcd_special_chars(SCROLLBAR); eeprom_write(); + encoderDir[ENC_R].reset(); } } @@ -1330,18 +1249,14 @@ void UI_func_filter_cutoff(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + lcd_special_chars(BLOCKBAR); lcd_display_bar_int("Filter Cut", configuration.dexed[instance_id].filter_cutoff, 1.0, FILTER_CUTOFF_MIN, FILTER_CUTOFF_MAX, 3, false, false, false, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* - { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) + { if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) configuration.dexed[instance_id].filter_cutoff = constrain(configuration.dexed[instance_id].filter_cutoff + ENCODER[ENC_R].speed(), FILTER_CUTOFF_MIN, FILTER_CUTOFF_MAX); @@ -1358,6 +1273,7 @@ void UI_func_filter_cutoff(uint8_t param) { lcd_special_chars(SCROLLBAR); eeprom_write(); + encoderDir[ENC_R].reset(); } } @@ -1370,18 +1286,15 @@ void UI_func_filter_resonance(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + lcd_special_chars(BLOCKBAR); lcd_display_bar_int("Filter Res", configuration.dexed[instance_id].filter_resonance, 1.0, FILTER_RESONANCE_MIN, FILTER_RESONANCE_MAX, 3, false, false, false, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) configuration.dexed[instance_id].filter_resonance = constrain(configuration.dexed[instance_id].filter_resonance + ENCODER[ENC_R].speed(), FILTER_RESONANCE_MIN, FILTER_RESONANCE_MAX); @@ -1398,6 +1311,7 @@ void UI_func_filter_resonance(uint8_t param) { lcd_special_chars(SCROLLBAR); eeprom_write(); + encoderDir[ENC_R].reset(); } } #endif @@ -1411,18 +1325,15 @@ void UI_func_transpose(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + lcd_special_chars(METERBAR); lcd_display_meter_int("Transpose", configuration.dexed[instance_id].transpose, 1.0, -24.0, TRANSPOSE_MIN, TRANSPOSE_MAX, 3, false, false, true, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) configuration.dexed[instance_id].transpose = constrain(configuration.dexed[instance_id].transpose + ENCODER[ENC_R].speed(), TRANSPOSE_MIN, TRANSPOSE_MAX); @@ -1440,6 +1351,7 @@ void UI_func_transpose(uint8_t param) { lcd_special_chars(SCROLLBAR); eeprom_write(); + encoderDir[ENC_R].reset(); } } @@ -1452,18 +1364,15 @@ void UI_func_tune(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + lcd_special_chars(METERBAR); lcd_display_meter_int("Tune", configuration.dexed[instance_id].tune, 1.0, -100.0, TUNE_MIN, TUNE_MAX, 3, false, false, true, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) configuration.dexed[instance_id].tune = constrain(configuration.dexed[instance_id].tune + ENCODER[ENC_R].speed(), TUNE_MIN, TUNE_MAX); @@ -1481,6 +1390,7 @@ void UI_func_tune(uint8_t param) { lcd_special_chars(SCROLLBAR); eeprom_write(); + encoderDir[ENC_R].reset(); } } @@ -1493,18 +1403,15 @@ void UI_func_midi_channel(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + lcd.setCursor(0, 0); lcd.print(F("MIDI Channel")); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkDown()) + if (LCDML.BT_checkDown()) configuration.dexed[instance_id].midi_channel = constrain(configuration.dexed[instance_id].midi_channel + ENCODER[ENC_R].speed(), MIDI_CHANNEL_MIN, MIDI_CHANNEL_MAX); else if (LCDML.BT_checkUp()) configuration.dexed[instance_id].midi_channel = constrain(configuration.dexed[instance_id].midi_channel - ENCODER[ENC_R].speed(), MIDI_CHANNEL_MIN, MIDI_CHANNEL_MAX); @@ -1524,6 +1431,7 @@ void UI_func_midi_channel(uint8_t param) { // you can here reset some global vars or do nothing eeprom_write(); + encoderDir[ENC_R].reset(); } } @@ -1546,7 +1454,8 @@ void UI_func_lowest_note(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + getNoteName(note_name, configuration.dexed[instance_id].lowest_note); lcd.setCursor(0, 0); lcd.print(F("Lowest Note")); @@ -1558,11 +1467,7 @@ void UI_func_lowest_note(uint8_t param) if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) configuration.dexed[instance_id].lowest_note = constrain(configuration.dexed[instance_id].lowest_note + ENCODER[ENC_R].speed(), INSTANCE_LOWEST_NOTE_MIN, INSTANCE_LOWEST_NOTE_MAX); @@ -1578,6 +1483,7 @@ void UI_func_lowest_note(uint8_t param) if (LCDML.FUNC_close()) // ****** STABLE END ********* { eeprom_write(); + encoderDir[ENC_R].reset(); } } @@ -1591,7 +1497,8 @@ void UI_func_highest_note(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + getNoteName(note_name, configuration.dexed[instance_id].highest_note); lcd.setCursor(0, 0); lcd.print(F("Highest Note")); @@ -1603,11 +1510,7 @@ void UI_func_highest_note(uint8_t param) if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) configuration.dexed[instance_id].highest_note = constrain(configuration.dexed[instance_id].highest_note + ENCODER[ENC_R].speed(), INSTANCE_HIGHEST_NOTE_MIN, INSTANCE_HIGHEST_NOTE_MAX); @@ -1623,6 +1526,7 @@ void UI_func_highest_note(uint8_t param) if (LCDML.FUNC_close()) // ****** STABLE END ********* { eeprom_write(); + encoderDir[ENC_R].reset(); } } @@ -1635,18 +1539,15 @@ void UI_func_sound_intensity(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + lcd_special_chars(BLOCKBAR); lcd_display_bar_float("Volume", float(configuration.dexed[instance_id].sound_intensity), 1.0, SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX, 3, 0, false, false, false, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) configuration.dexed[instance_id].sound_intensity = constrain(configuration.dexed[instance_id].sound_intensity + ENCODER[ENC_R].speed(), SOUND_INTENSITY_MIN, SOUND_INTENSITY_MAX); @@ -1662,9 +1563,9 @@ void UI_func_sound_intensity(uint8_t param) if (LCDML.FUNC_close()) // ****** STABLE END ********* { - // you can here reset some global vars or do nothing lcd_special_chars(SCROLLBAR); eeprom_write(); + encoderDir[ENC_R].reset(); } } @@ -1677,7 +1578,8 @@ void UI_func_panorama(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + if (configuration.mono > 0) { lcd.setCursor(0, 0); @@ -1692,11 +1594,7 @@ void UI_func_panorama(uint8_t param) if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkDown() && configuration.mono == 0) + if (LCDML.BT_checkDown() && configuration.mono == 0) configuration.dexed[instance_id].pan = constrain(configuration.dexed[instance_id].pan + ENCODER[ENC_R].speed(), PANORAMA_MIN, PANORAMA_MAX); else if (LCDML.BT_checkUp() && configuration.mono == 0) configuration.dexed[instance_id].pan = constrain(configuration.dexed[instance_id].pan - ENCODER[ENC_R].speed(), PANORAMA_MIN, PANORAMA_MAX); @@ -1712,6 +1610,7 @@ void UI_func_panorama(uint8_t param) { lcd_special_chars(SCROLLBAR); eeprom_write(); + encoderDir[ENC_R].reset(); } } @@ -1719,7 +1618,8 @@ void UI_func_stereo_mono(uint8_t param) { if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + lcd.setCursor(0, 0); lcd.print(F("Stereo/Mono")); lcd.setCursor(0, 1); @@ -1746,9 +1646,7 @@ void UI_func_stereo_mono(uint8_t param) if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - LCDML.FUNC_goBackToMenu(); - else if (LCDML.BT_checkDown()) + if (LCDML.BT_checkDown()) configuration.mono = constrain(configuration.mono + 1, MONO_MIN, MONO_MAX); else if (LCDML.BT_checkUp()) configuration.mono = constrain(configuration.mono - 1, MONO_MIN, MONO_MAX); @@ -1778,8 +1676,8 @@ void UI_func_stereo_mono(uint8_t param) if (LCDML.FUNC_close()) // ****** STABLE END ********* { - // you can here reset some global vars or do nothing eeprom_write(); + encoderDir[ENC_R].reset(); } } @@ -1792,18 +1690,15 @@ void UI_func_polyphony(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + lcd_special_chars(BLOCKBAR); lcd_display_bar_int("Polyphony", configuration.dexed[instance_id].polyphony, 1.0, POLYPHONY_MIN, POLYPHONY_MAX, 3, false, false, false, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) configuration.dexed[instance_id].polyphony = constrain(configuration.dexed[instance_id].polyphony + ENCODER[ENC_R].speed(), POLYPHONY_MIN, POLYPHONY_MAX); @@ -1820,6 +1715,7 @@ void UI_func_polyphony(uint8_t param) { lcd_special_chars(SCROLLBAR); eeprom_write(); + encoderDir[ENC_R].reset(); } } @@ -1832,18 +1728,15 @@ void UI_func_engine(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + lcd.setCursor(0, 0); lcd.print(F("Engine")); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) configuration.dexed[instance_id].engine = constrain(configuration.dexed[instance_id].engine + 1, ENGINE_MIN, ENGINE_MAX); @@ -1870,8 +1763,8 @@ void UI_func_engine(uint8_t param) if (LCDML.FUNC_close()) // ****** STABLE END ********* { - // you can here reset some global vars or do nothing eeprom_write(); + encoderDir[ENC_R].reset(); } } @@ -1884,26 +1777,24 @@ void UI_func_mono_poly(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + lcd.setCursor(0, 0); lcd.print(F("Mono/Polyphonic")); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) - { - if (LCDML.BT_checkDown()) - configuration.dexed[instance_id].monopoly = constrain(configuration.dexed[instance_id].monopoly + 1, MONOPOLY_MIN, MONOPOLY_MAX); - else if (LCDML.BT_checkUp()) - configuration.dexed[instance_id].monopoly = constrain(configuration.dexed[instance_id].monopoly - 1, MONOPOLY_MIN, MONOPOLY_MAX); + if (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort()) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) + { + if (LCDML.BT_checkDown()) + configuration.dexed[instance_id].monopoly = constrain(configuration.dexed[instance_id].monopoly + 1, MONOPOLY_MIN, MONOPOLY_MAX); + else if (LCDML.BT_checkUp()) + configuration.dexed[instance_id].monopoly = constrain(configuration.dexed[instance_id].monopoly - 1, MONOPOLY_MIN, MONOPOLY_MAX); - MicroDexed[instance_id]->setMonoMode(!configuration.dexed[instance_id].monopoly); - } + MicroDexed[instance_id]->setMonoMode(!configuration.dexed[instance_id].monopoly); + } lcd.setCursor(0, 1); switch (configuration.dexed[instance_id].monopoly) @@ -1919,8 +1810,8 @@ void UI_func_mono_poly(uint8_t param) if (LCDML.FUNC_close()) // ****** STABLE END ********* { - // you can here reset some global vars or do nothing eeprom_write(); + encoderDir[ENC_R].reset(); } } @@ -1933,18 +1824,15 @@ void UI_func_note_refresh(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + lcd.setCursor(0, 0); lcd.print(F("Note Refresh")); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) configuration.dexed[instance_id].note_refresh = constrain(configuration.dexed[instance_id].note_refresh + 1, NOTE_REFRESH_MIN, NOTE_REFRESH_MAX); @@ -1968,8 +1856,8 @@ void UI_func_note_refresh(uint8_t param) if (LCDML.FUNC_close()) // ****** STABLE END ********* { - // you can here reset some global vars or do nothing eeprom_write(); + encoderDir[ENC_R].reset(); } } @@ -1982,18 +1870,15 @@ void UI_func_pb_range(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + lcd_special_chars(BLOCKBAR); lcd_display_bar_int("PB Range", configuration.dexed[instance_id].pb_range, 1.0, PB_RANGE_MIN, PB_RANGE_MAX, 2, false, false, false, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) configuration.dexed[instance_id].pb_range = constrain(configuration.dexed[instance_id].pb_range + ENCODER[ENC_R].speed(), PB_RANGE_MIN, PB_RANGE_MAX); @@ -2010,6 +1895,7 @@ void UI_func_pb_range(uint8_t param) { lcd_special_chars(SCROLLBAR); eeprom_write(); + encoderDir[ENC_R].reset(); } } @@ -2022,18 +1908,14 @@ void UI_func_pb_step(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); lcd_special_chars(BLOCKBAR); lcd_display_bar_int("PB Step", configuration.dexed[instance_id].pb_step, 1.0, PB_STEP_MIN, PB_STEP_MAX, 2, false, false, false, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) configuration.dexed[instance_id].pb_step = constrain(configuration.dexed[instance_id].pb_step + ENCODER[ENC_R].speed(), PB_STEP_MIN, PB_STEP_MAX); @@ -2048,9 +1930,9 @@ void UI_func_pb_step(uint8_t param) if (LCDML.FUNC_close()) // ****** STABLE END ********* { - // you can here reset some global vars or do nothing lcd_special_chars(SCROLLBAR); eeprom_write(); + encoderDir[ENC_R].reset(); } } @@ -2063,18 +1945,14 @@ void UI_func_mw_range(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); lcd_special_chars(BLOCKBAR); lcd_display_bar_int("MW Range", configuration.dexed[instance_id].mw_range, 1.0, MW_RANGE_MIN, MW_RANGE_MAX, 2, false, false, false, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) configuration.dexed[instance_id].mw_range = constrain(configuration.dexed[instance_id].mw_range + ENCODER[ENC_R].speed(), MW_RANGE_MIN, MW_RANGE_MAX); @@ -2089,9 +1967,9 @@ void UI_func_mw_range(uint8_t param) if (LCDML.FUNC_close()) // ****** STABLE END ********* { - // you can here reset some global vars or do nothing lcd_special_chars(SCROLLBAR); eeprom_write(); + encoderDir[ENC_R].reset(); } } @@ -2104,18 +1982,15 @@ void UI_func_mw_assign(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + lcd.setCursor(0, 0); lcd.print(F("MW Assign")); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) configuration.dexed[instance_id].mw_assign = constrain(configuration.dexed[instance_id].mw_assign + 1, MW_ASSIGN_MIN, MW_ASSIGN_MAX); @@ -2157,8 +2032,8 @@ void UI_func_mw_assign(uint8_t param) if (LCDML.FUNC_close()) // ****** STABLE END ********* { - // you can here reset some global vars or do nothing eeprom_write(); + encoderDir[ENC_R].reset(); } } @@ -2171,18 +2046,15 @@ void UI_func_mw_mode(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + lcd.setCursor(0, 0); lcd.print(F("MW Mode")); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) configuration.dexed[instance_id].mw_mode = constrain(configuration.dexed[instance_id].mw_mode + 1, MW_MODE_MIN, MW_MODE_MAX); @@ -2210,8 +2082,8 @@ void UI_func_mw_mode(uint8_t param) if (LCDML.FUNC_close()) // ****** STABLE END ********* { - // you can here reset some global vars or do nothing eeprom_write(); + encoderDir[ENC_R].reset(); } } @@ -2224,18 +2096,15 @@ void UI_func_fc_range(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + lcd_special_chars(BLOCKBAR); lcd_display_bar_int("FC Range", configuration.dexed[instance_id].fc_range, 1.0, FC_RANGE_MIN, FC_RANGE_MAX, 2, false, false, false, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) configuration.dexed[instance_id].fc_range = constrain(configuration.dexed[instance_id].fc_range + ENCODER[ENC_R].speed(), FC_RANGE_MIN, FC_RANGE_MAX); @@ -2253,6 +2122,7 @@ void UI_func_fc_range(uint8_t param) // you can here reset some global vars or do nothing lcd_special_chars(SCROLLBAR); eeprom_write(); + encoderDir[ENC_R].reset(); } } @@ -2265,18 +2135,15 @@ void UI_func_fc_assign(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + lcd.setCursor(0, 0); lcd.print(F("FC Assign")); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) configuration.dexed[instance_id].fc_assign = constrain(configuration.dexed[instance_id].fc_assign + 1, FC_ASSIGN_MIN, FC_ASSIGN_MAX); @@ -2318,8 +2185,8 @@ void UI_func_fc_assign(uint8_t param) if (LCDML.FUNC_close()) // ****** STABLE END ********* { - // you can here reset some global vars or do nothing eeprom_write(); + encoderDir[ENC_R].reset(); } } @@ -2332,18 +2199,15 @@ void UI_func_fc_mode(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + lcd.setCursor(0, 0); lcd.print(F("FC Mode")); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) configuration.dexed[instance_id].fc_mode = constrain(configuration.dexed[instance_id].fc_mode + 1, FC_MODE_MIN, FC_MODE_MAX); @@ -2371,8 +2235,8 @@ void UI_func_fc_mode(uint8_t param) if (LCDML.FUNC_close()) // ****** STABLE END ********* { - // you can here reset some global vars or do nothing eeprom_write(); + encoderDir[ENC_R].reset(); } } @@ -2385,18 +2249,15 @@ void UI_func_bc_range(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + lcd_special_chars(BLOCKBAR); lcd_display_bar_int("BC Range", configuration.dexed[instance_id].bc_range, 1.0, BC_RANGE_MIN, BC_RANGE_MAX, 2, false, false, false, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) configuration.dexed[instance_id].bc_range = constrain(configuration.dexed[instance_id].bc_range + ENCODER[ENC_R].speed(), BC_RANGE_MIN, BC_RANGE_MAX); @@ -2411,9 +2272,9 @@ void UI_func_bc_range(uint8_t param) if (LCDML.FUNC_close()) // ****** STABLE END ********* { - // you can here reset some global vars or do nothing lcd_special_chars(SCROLLBAR); eeprom_write(); + encoderDir[ENC_R].reset(); } } @@ -2426,18 +2287,15 @@ void UI_func_bc_assign(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + lcd.setCursor(0, 0); lcd.print(F("BC Assign")); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) configuration.dexed[instance_id].bc_assign = constrain(configuration.dexed[instance_id].bc_assign + 1, BC_ASSIGN_MIN, BC_ASSIGN_MAX); @@ -2479,8 +2337,8 @@ void UI_func_bc_assign(uint8_t param) if (LCDML.FUNC_close()) // ****** STABLE END ********* { - // you can here reset some global vars or do nothing eeprom_write(); + encoderDir[ENC_R].reset(); } } @@ -2493,18 +2351,15 @@ void UI_func_bc_mode(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + lcd.setCursor(0, 0); lcd.print(F("BC Mode")); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) configuration.dexed[instance_id].bc_mode = constrain(configuration.dexed[instance_id].bc_mode + 1, BC_MODE_MIN, BC_MODE_MAX); @@ -2532,8 +2387,8 @@ void UI_func_bc_mode(uint8_t param) if (LCDML.FUNC_close()) // ****** STABLE END ********* { - // you can here reset some global vars or do nothing eeprom_write(); + encoderDir[ENC_R].reset(); } } @@ -2546,18 +2401,15 @@ void UI_func_at_range(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + lcd_special_chars(BLOCKBAR); lcd_display_bar_int("AT Range", configuration.dexed[instance_id].at_range, 1.0, AT_RANGE_MIN, AT_RANGE_MAX, 2, false, false, false, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) configuration.dexed[instance_id].at_range = constrain(configuration.dexed[instance_id].at_range + ENCODER[ENC_R].speed(), AT_RANGE_MIN, AT_RANGE_MAX); @@ -2572,9 +2424,9 @@ void UI_func_at_range(uint8_t param) if (LCDML.FUNC_close()) // ****** STABLE END ********* { - // you can here reset some global vars or do nothing lcd_special_chars(SCROLLBAR); eeprom_write(); + encoderDir[ENC_R].reset(); } } @@ -2587,18 +2439,15 @@ void UI_func_at_assign(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + lcd.setCursor(0, 0); lcd.print(F("AT Assign")); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) configuration.dexed[instance_id].at_assign = constrain(configuration.dexed[instance_id].at_assign + 1, AT_ASSIGN_MIN, AT_ASSIGN_MAX); @@ -2640,8 +2489,8 @@ void UI_func_at_assign(uint8_t param) if (LCDML.FUNC_close()) // ****** STABLE END ********* { - // you can here reset some global vars or do nothing eeprom_write(); + encoderDir[ENC_R].reset(); } } @@ -2654,18 +2503,15 @@ void UI_func_at_mode(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + lcd.setCursor(0, 0); lcd.print(F("AT Mode")); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) configuration.dexed[instance_id].at_mode = constrain(configuration.dexed[instance_id].at_mode + 1, AT_MODE_MIN, AT_MODE_MAX); @@ -2693,8 +2539,8 @@ void UI_func_at_mode(uint8_t param) if (LCDML.FUNC_close()) // ****** STABLE END ********* { - // you can here reset some global vars or do nothing eeprom_write(); + encoderDir[ENC_R].reset(); } } @@ -2707,18 +2553,15 @@ void UI_func_portamento_mode(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + lcd.setCursor(0, 0); lcd.print(F("Portamento Mode")); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) configuration.dexed[instance_id].portamento_mode = constrain(configuration.dexed[instance_id].portamento_mode + 1, PORTAMENTO_MODE_MIN, PORTAMENTO_MODE_MAX); @@ -2748,8 +2591,8 @@ void UI_func_portamento_mode(uint8_t param) if (LCDML.FUNC_close()) // ****** STABLE END ********* { - // you can here reset some global vars or do nothing eeprom_write(); + encoderDir[ENC_R].reset(); } } @@ -2762,18 +2605,15 @@ void UI_func_portamento_glissando(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + lcd.setCursor(0, 0); lcd.print(F("Portam. Gliss.")); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) configuration.dexed[instance_id].portamento_glissando = constrain(configuration.dexed[instance_id].portamento_glissando + 1, PORTAMENTO_GLISSANDO_MIN, PORTAMENTO_GLISSANDO_MAX); @@ -2797,8 +2637,8 @@ void UI_func_portamento_glissando(uint8_t param) if (LCDML.FUNC_close()) // ****** STABLE END ********* { - // you can here reset some global vars or do nothing eeprom_write(); + encoderDir[ENC_R].reset(); } } @@ -2811,17 +2651,15 @@ void UI_func_portamento_time(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { + encoderDir[ENC_R].reset(); + lcd_special_chars(BLOCKBAR); lcd_display_bar_int("Portam. Time", configuration.dexed[instance_id].portamento_time, 1.0, PORTAMENTO_TIME_MIN, PORTAMENTO_TIME_MAX, 2, false, false, false, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) configuration.dexed[instance_id].portamento_time = constrain(configuration.dexed[instance_id].portamento_time + ENCODER[ENC_R].speed(), PORTAMENTO_TIME_MIN, PORTAMENTO_TIME_MAX); @@ -2836,9 +2674,9 @@ void UI_func_portamento_time(uint8_t param) if (LCDML.FUNC_close()) // ****** STABLE END ********* { - // you can here reset some global vars or do nothing lcd_special_chars(SCROLLBAR); eeprom_write(); + encoderDir[ENC_R].reset(); } } @@ -2908,7 +2746,8 @@ void UI_handle_OP(uint8_t param, uint8_t op, uint8_t instance_id) if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + lcd.setCursor(0, 0); lcd.print(F("Operator ")); lcd.print(op + 1); @@ -2925,11 +2764,7 @@ void UI_handle_OP(uint8_t param, uint8_t op, uint8_t instance_id) if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkUp() && state == true) + if (LCDML.BT_checkUp() && state == true) { bitClear(configuration.dexed[instance_id].op_enabled, op); state = false; @@ -2940,7 +2775,7 @@ void UI_handle_OP(uint8_t param, uint8_t op, uint8_t instance_id) state = true; } - if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { lcd.setCursor(0, 1); if (state == true) @@ -2958,8 +2793,8 @@ void UI_handle_OP(uint8_t param, uint8_t op, uint8_t instance_id) if (LCDML.FUNC_close()) // ****** STABLE END ********* { - // you can here reset some global vars or do nothing eeprom_write(); + encoderDir[ENC_R].reset(); } } @@ -2969,6 +2804,8 @@ void UI_func_information(uint8_t param) { char version_string[LCD_cols + 1]; + encoderDir[ENC_R].reset(); + generate_version_string(version_string, sizeof(version_string)); // setup function @@ -2980,17 +2817,12 @@ void UI_func_information(uint8_t param) if (LCDML.FUNC_loop()) // ****** LOOP ********* { - // loop function, can be run in a loop when LCDML_DISP_triggerMenu(xx) is set - // the quit button works in every DISP function without any checks; it starts the loop_end function - if (LCDML.BT_checkEnter()) { // check if any button is pressed (enter, up, down, left, right) - // LCDML_goToMenu stops a running menu function and goes to the menu - LCDML.FUNC_goBackToMenu(); - } + ; } if (LCDML.FUNC_close()) // ****** STABLE END ********* { - // you can here reset some global vars or do nothing + encoderDir[ENC_R].reset(); } } @@ -2998,18 +2830,15 @@ void UI_func_midi_soft_thru(uint8_t param) { if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + lcd.setCursor(0, 0); lcd.print(F("MIDI Soft THRU")); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) configuration.soft_midi_thru = constrain(configuration.soft_midi_thru + 1, SOFT_MIDI_THRU_MIN, SOFT_MIDI_THRU_MAX); @@ -3030,8 +2859,8 @@ void UI_func_midi_soft_thru(uint8_t param) if (LCDML.FUNC_close()) // ****** STABLE END ********* { - // you can here reset some global vars or do nothing eeprom_write(); + encoderDir[ENC_R].reset(); } } @@ -3044,18 +2873,15 @@ void UI_func_velocity_level(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + lcd_special_chars(BLOCKBAR); lcd_display_bar_int("Velocity Lvl", configuration.dexed[instance_id].velocity_level, 1.0, VELOCITY_LEVEL_MIN, VELOCITY_LEVEL_MAX, 3, false, false, false, true); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) configuration.dexed[instance_id].velocity_level = constrain(configuration.dexed[instance_id].velocity_level + ENCODER[ENC_R].speed(), VELOCITY_LEVEL_MIN, VELOCITY_LEVEL_MAX); @@ -3071,6 +2897,7 @@ void UI_func_velocity_level(uint8_t param) // you can here reset some global vars or do nothing lcd_special_chars(SCROLLBAR); eeprom_write(); + encoderDir[ENC_R].reset(); } } @@ -3080,8 +2907,9 @@ void UI_func_firmware_reset(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { + encoderDir[ENC_R].reset(); + // setup function - LCDML.DISP_clear(); lcd.print("Firmware reset?"); lcd.setCursor(0, 1); lcd.print("[NO ]"); @@ -3089,11 +2917,7 @@ void UI_func_firmware_reset(uint8_t param) if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) yesno = true; @@ -3126,112 +2950,242 @@ void UI_func_firmware_reset(uint8_t param) lcd.print("Done."); delay(500); } + + encoderDir[ENC_R].reset(); } } -void UI_func_voice_selection(uint8_t param) +void UI_func_voice_select(uint8_t param) { -#ifdef DEBUG - Serial.println(F("UI_func_voice_selection()")); -#endif + uint8_t instance_id = 0; + static uint8_t menu_voice_select = MENU_VOICE_SOUND; - menu_state = MENU_VOICE; + if (LCDML.FUNC_getID() > MENU_ID_OF_INSTANCE_2) + instance_id = 1; - strip_extension(bank_names[selected_dexed_instance][configuration.dexed[selected_dexed_instance].bank], bank_name[selected_dexed_instance]); + if (LCDML.FUNC_setup()) // ****** SETUP ********* + { + encoderDir[ENC_R].reset(); + last_menu = LCDML.FUNC_getID(); - //LCDML.DISP_clear(); + strip_extension(bank_names[instance_id][configuration.dexed[instance_id].bank], bank_name[instance_id]); - // display bank and voice number - lcd.show(0, 0, 2, configuration.dexed[selected_dexed_instance].bank); - lcd.show(1, 0, 2, configuration.dexed[selected_dexed_instance].voice + 1); + lcd.show(0, 0, 2, configuration.dexed[instance_id].bank); + lcd.show(1, 0, 2, configuration.dexed[instance_id].voice + 1); + lcd.show(0, 4, 10, bank_name[instance_id]); + lcd.show(1, 4, 10, voice_names[instance_id][configuration.dexed[instance_id].voice]); - // display names - lcd.show(0, 4, 10, bank_name[selected_dexed_instance]); - lcd.show(1, 4, 10, voice_names[selected_dexed_instance][configuration.dexed[selected_dexed_instance].voice]); + switch (menu_voice_select) + { + case MENU_VOICE_BANK: + lcd.show(0, 2, 2, " ["); + lcd.show(0, 14, 1, "]"); + lcd.show(1, 2, 2, " "); + lcd.show(1, 14, 1, " "); + break; + case MENU_VOICE_SOUND: + lcd.show(0, 2, 2, " "); + lcd.show(0, 14, 1, " "); + lcd.show(1, 2, 2, " ["); + lcd.show(1, 14, 1, "]"); + break; + } + } - // display selected Dexed instance - /* if (selected_dexed_instance == 1) + if (LCDML.FUNC_loop()) // ****** LOOP ********* + { + if ((LCDML.BT_checkDown() && encoderDir[ENC_L].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_L].Up())) { - #if NUM_DEXED > 1 - lcd.show(0, 15, 1, "o"); - #else - lcd.show(0, 15, 1, " "); - #endif - lcd.show(1, 15, 1, "*"); + LCDML.OTHER_jumpToFunc(UI_func_volume); } - else + else if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) { - selected_dexed_instance = 0; - lcd.show(0, 15, 1, "*"); - #if NUM_DEXED > 1 - lcd.show(1, 15, 1, "o"); - #else - lcd.show(1, 15, 1, " "); - #endif - } */ - - lcd.show(0, 15, 1, " "); - lcd.show(1, 15, 1, " "); - - // display selections - switch (menu_voice) - { - case MENU_VOICE_BANK: - lcd.show(0, 2, 2, " ["); - lcd.show(0, 14, 1, "]"); - lcd.show(1, 2, 2, " "); - lcd.show(1, 14, 1, " "); - break; - case MENU_VOICE_SOUND: - lcd.show(0, 2, 2, " "); - lcd.show(0, 14, 1, " "); - lcd.show(1, 2, 2, " ["); - lcd.show(1, 14, 1, "]"); - break; - } - for (int x = 2; x < LCD_rows; x++) { - lcd.show(x, 0, LCD_cols, " "); + uint8_t bank_tmp; + int8_t voice_tmp; + + if (LCDML.BT_checkUp()) + switch (menu_voice_select) + { + case MENU_VOICE_BANK: + bank_tmp = constrain(configuration.dexed[instance_id].bank - ENCODER[ENC_R].speed(), 0, MAX_BANKS - 1); + configuration.dexed[instance_id].bank = bank_tmp; +#ifdef DISPLAY_LCD_SPI + change_disp_sd(false); +#endif + load_sysex(configuration.dexed[instance_id].bank, configuration.dexed[instance_id].voice, instance_id); + get_voice_names_from_bank(configuration.dexed[instance_id].bank, instance_id); +#ifdef DISPLAY_LCD_SPI + change_disp_sd(true); +#endif + eeprom_write(); + break; + case MENU_VOICE_SOUND: + voice_tmp = configuration.dexed[instance_id].voice - ENCODER[ENC_R].speed(); + if (voice_tmp < 0 && configuration.dexed[instance_id].bank - 1 >= 0) + { + configuration.dexed[instance_id].bank--; + configuration.dexed[instance_id].bank = constrain(configuration.dexed[instance_id].bank, 0, MAX_BANKS - 1); + } + else if (voice_tmp < 0 && configuration.dexed[instance_id].bank - 1 <= 0) + { + voice_tmp = 0; + } + if (voice_tmp < 0) + voice_tmp = MAX_VOICES + voice_tmp; + configuration.dexed[instance_id].voice = voice_tmp; + +#ifdef DISPLAY_LCD_SPI + change_disp_sd(false); +#endif + load_sysex(configuration.dexed[instance_id].bank, configuration.dexed[instance_id].voice, instance_id); + get_voice_names_from_bank(configuration.dexed[instance_id].bank, instance_id); +#ifdef DISPLAY_LCD_SPI + change_disp_sd(true); +#endif + eeprom_write(); + break; + } + else if (LCDML.BT_checkDown()) + { + switch (menu_voice_select) + { + case MENU_VOICE_BANK: + bank_tmp = constrain(configuration.dexed[instance_id].bank + ENCODER[ENC_R].speed(), 0, MAX_BANKS - 1); + configuration.dexed[instance_id].bank = bank_tmp; +#ifdef DISPLAY_LCD_SPI + change_disp_sd(false); +#endif + load_sysex(configuration.dexed[instance_id].bank, configuration.dexed[instance_id].voice, instance_id); + get_voice_names_from_bank(configuration.dexed[instance_id].bank, instance_id); +#ifdef DISPLAY_LCD_SPI + change_disp_sd(true); +#endif + eeprom_write(); + break; + case MENU_VOICE_SOUND: + voice_tmp = configuration.dexed[instance_id].voice + ENCODER[ENC_R].speed(); + if (voice_tmp >= MAX_VOICES && configuration.dexed[instance_id].bank + 1 < MAX_BANKS) + { + voice_tmp %= MAX_VOICES; + configuration.dexed[instance_id].bank++; + configuration.dexed[instance_id].bank = constrain(configuration.dexed[instance_id].bank, 0, MAX_BANKS - 1); + } + else if (voice_tmp >= MAX_VOICES && configuration.dexed[instance_id].bank + 1 >= MAX_BANKS) + { + voice_tmp = MAX_VOICES - 1; + } + configuration.dexed[instance_id].voice = voice_tmp; + +#ifdef DISPLAY_LCD_SPI + change_disp_sd(false); +#endif + load_sysex(configuration.dexed[instance_id].bank, configuration.dexed[instance_id].voice, instance_id); + get_voice_names_from_bank(configuration.dexed[instance_id].bank, instance_id); +#ifdef DISPLAY_LCD_SPI + change_disp_sd(true); +#endif + eeprom_write(); + break; + + } + } + else if (LCDML.BT_checkEnter()) + { + if (menu_voice_select == MENU_VOICE_BANK) + menu_voice_select = MENU_VOICE_SOUND; + else + menu_voice_select = MENU_VOICE_BANK; + } + + strip_extension(bank_names[instance_id][configuration.dexed[instance_id].bank], bank_name[instance_id]); + + lcd.show(0, 0, 2, configuration.dexed[instance_id].bank); + lcd.show(1, 0, 2, configuration.dexed[instance_id].voice + 1); + lcd.show(0, 4, 10, bank_name[instance_id]); + lcd.show(1, 4, 10, voice_names[instance_id][configuration.dexed[instance_id].voice]); + + switch (menu_voice_select) + { + case MENU_VOICE_BANK: + lcd.show(0, 2, 2, " ["); + lcd.show(0, 14, 1, "]"); + lcd.show(1, 2, 2, " "); + lcd.show(1, 14, 1, " "); + break; + case MENU_VOICE_SOUND: + lcd.show(0, 2, 2, " "); + lcd.show(0, 14, 1, " "); + lcd.show(1, 2, 2, " ["); + lcd.show(1, 14, 1, "]"); + break; + } + } + + if (LCDML.FUNC_close()) // ****** STABLE END ********* + { + eeprom_write(); + encoderDir[ENC_R].reset(); + last_menu = 255; + } } } void UI_func_volume(uint8_t param) { -#ifdef DEBUG - Serial.println(F("UI_func_volume()")); -#endif - - back_from_volume = 0; - - if (menu_state != MENU_VOLUME) + if (LCDML.FUNC_setup()) // ****** SETUP ********* { - LCDML.DISP_clear(); + encoderDir[ENC_L].reset(); + lcd_special_chars(BLOCKBAR); lcd_display_bar_int("Master Vol.", configuration.vol, 1.0, VOLUME_MIN, VOLUME_MAX, 3, false, false, false, true); - menu_state = MENU_VOLUME; + + back_from_volume = 0; } - else + + if (LCDML.FUNC_loop()) // ****** LOOP ********* + { + if ((LCDML.BT_checkDown() && encoderDir[ENC_L].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_L].Up())) + { + back_from_volume = 0; + + if (LCDML.BT_checkDown()) + { + configuration.vol = constrain(configuration.vol + ENCODER[ENC_L].speed(), VOLUME_MIN, VOLUME_MAX); + } + else if (LCDML.BT_checkUp()) + { + configuration.vol = constrain(configuration.vol - ENCODER[ENC_L].speed(), VOLUME_MIN, VOLUME_MAX); + } + } + lcd_display_bar_int("Master Vol.", configuration.vol, 1.0, VOLUME_MIN, VOLUME_MAX, 3, false, false, false, false); + } + + if (LCDML.FUNC_close()) // ****** STABLE END ********* + { + lcd_special_chars(SCROLLBAR); + + eeprom_write(); + encoderDir[ENC_L].reset(); - set_volume(configuration.vol, configuration.mono); - eeprom_write(); + if (last_menu < 255) + LCDML.OTHER_jumpToID(last_menu); + } } void UI_func_load(uint8_t param) { if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + lcd.setCursor(0, 0); lcd.print(F("Load setup")); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) { @@ -3257,8 +3211,8 @@ void UI_func_load(uint8_t param) if (LCDML.FUNC_close()) // ****** STABLE END ********* { - // you can here reset some global vars or do nothing eeprom_write(); + encoderDir[ENC_R].reset(); } } @@ -3266,18 +3220,15 @@ void UI_func_save(uint8_t param) { if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + lcd.setCursor(0, 0); lcd.print(F("Save setup")); } if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } - else if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) + if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up())) { if (LCDML.BT_checkDown()) { @@ -3303,8 +3254,8 @@ void UI_func_save(uint8_t param) if (LCDML.FUNC_close()) // ****** STABLE END ********* { - // you can here reset some global vars or do nothing eeprom_write(); + encoderDir[ENC_R].reset(); } } @@ -3312,7 +3263,8 @@ void UI_function_not_enabled(void) { if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + lcd.setCursor(0, 0); lcd.print(F("Function not")); lcd.setCursor(0, 1); @@ -3321,15 +3273,12 @@ void UI_function_not_enabled(void) if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } + ; } if (LCDML.FUNC_close()) // ****** STABLE END ********* { - // you can here reset some global vars or do nothing + encoderDir[ENC_R].reset(); } } @@ -3337,7 +3286,8 @@ void UI_function_not_implemented(uint8_t param) { if (LCDML.FUNC_setup()) // ****** SETUP ********* { - // setup function + encoderDir[ENC_R].reset(); + lcd.setCursor(0, 0); lcd.print(F("Function not")); lcd.setCursor(0, 1); @@ -3346,15 +3296,12 @@ void UI_function_not_implemented(uint8_t param) if (LCDML.FUNC_loop()) // ****** LOOP ********* { - if (LCDML.BT_checkEnter()) - { - LCDML.FUNC_goBackToMenu(); - } + ; } if (LCDML.FUNC_close()) // ****** STABLE END ********* { - // you can here reset some global vars or do nothing + encoderDir[ENC_R].reset(); } } diff --git a/UI_1_FX.h b/UI_1_FX.h index 4c4580c..61f32dc 100644 --- a/UI_1_FX.h +++ b/UI_1_FX.h @@ -26,7 +26,7 @@ #define _UI_H_ LCDML_add(0, LCDML_0, 1, "Voice", NULL); -LCDML_add(1, LCDML_0_1, 1, "Select", NULL); // UI_func_voice_select +LCDML_add(1, LCDML_0_1, 1, "Select", UI_func_voice_select); LCDML_add(2, LCDML_0_1, 2, "Audio", NULL); LCDML_add(3, LCDML_0_1_2, 1, "Volume", UI_func_sound_intensity); LCDML_add(4, LCDML_0_1_2, 2, "Panorama", UI_func_panorama); @@ -102,7 +102,9 @@ LCDML_add(73, LCDML_0_3, 3, "Firmware Reset", UI_func_firmware_reset); LCDML_add(74, LCDML_0, 4, "System", NULL); LCDML_add(75, LCDML_0_4, 1, "Stereo/Mono", UI_func_stereo_mono); LCDML_add(76, LCDML_0_4, 2, "MIDI Soft THRU", UI_func_midi_soft_thru); -LCDML_add(77, LCDML_0, 5, "Info", UI_func_information); -#define _LCDML_DISP_cnt 77 +LCDML_add(77, LCDML_0, 5, "Volume", UI_func_volume); +LCDML_add(78, LCDML_0, 6, "Info", UI_func_information); +#define _LCDML_DISP_cnt 78 #define MENU_ID_OF_INSTANCE_2 56 +#define VOLUME_MENU_ID 77 #endif diff --git a/config.h b/config.h index a8fe9b6..ff52a63 100644 --- a/config.h +++ b/config.h @@ -174,7 +174,7 @@ #define U8X8_RESET_PIN 14 #endif -#define CONTROL_RATE_MS 30 +#define VOICE_SELECTION_MS 60000 #define BACK_FROM_VOLUME_MS 2000 //************************************************************************************************* @@ -234,6 +234,8 @@ #define CPU_OVERLOAD_THROTTLE_TIMER 100 // timer (in ms) when next throttling is possible enum { DEXED, CHORUS, DELAY, REVERB}; +#define CONTROL_RATE_MS 30 + // MIDI #ifdef MIDI_DEVICE_USB #define USBCON 1 diff --git a/doc/LCDMenu-functions.txt b/doc/LCDMenu-functions.txt index 1b116c4..69dc6ed 100644 --- a/doc/LCDMenu-functions.txt +++ b/doc/LCDMenu-functions.txt @@ -9,3 +9,5 @@ void OTHER_setCursorToID(uint8_t p_search); // set the cursor to a defined function based on the function name void OTHER_setCursorToFunc(LCDML_FuncPtr_pu8 p_search); + +LCDML.MENU_goRoot()