From fcdf6598cf016465786a175072e026edbbd4d6dc Mon Sep 17 00:00:00 2001 From: positionhigh Date: Wed, 18 Aug 2021 18:40:48 +0200 Subject: [PATCH] =?UTF-8?q?Dateien=20hochladen=20nach=20=E2=80=9E=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- UI.hpp | 53 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 22 deletions(-) diff --git a/UI.hpp b/UI.hpp index 3383dcd..2379480 100644 --- a/UI.hpp +++ b/UI.hpp @@ -6626,7 +6626,7 @@ void UI_func_save_performance(uint8_t param) void UI_func_load_voiceconfig(uint8_t param) { -#if NUMDEXED > 1 +#if NUM_DEXED > 1 static int8_t selected_instance_id; #else uint8_t selected_instance_id = 0; @@ -6636,15 +6636,14 @@ void UI_func_load_voiceconfig(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { - char tmp[10]; - + selected_instance_id = 0; encoderDir[ENC_R].reset(); lcd.setCursor(0, 0); lcd.print(F("Load VoiceCfg SD")); -#if NUMDEXED > 1 +#if NUM_DEXED > 1 mode = 0; lcd.setCursor(0, 1); lcd.print(F("Instance [0]")); @@ -6663,29 +6662,33 @@ void UI_func_load_voiceconfig(uint8_t param) if (LCDML.BT_checkDown()) { if (mode == 0) - selected_instance_id = (selected_instance_id + 1) % 2; + selected_instance_id = 1; + //selected_instance_id = (selected_instance_id + 1) % 2; else if (mode == 1) configuration.performance.voiceconfig_number[selected_instance_id] = constrain(configuration.performance.voiceconfig_number[selected_instance_id] + ENCODER[ENC_L].speed(), VOICECONFIG_NUM_MIN, VOICECONFIG_NUM_MAX); } else if (LCDML.BT_checkUp()) { if (mode == 0) - selected_instance_id = (selected_instance_id - 1) % 2; + //selected_instance_id = (selected_instance_id - 1) % 2; + selected_instance_id = 0; else if (mode == 1) configuration.performance.voiceconfig_number[selected_instance_id] = constrain(configuration.performance.voiceconfig_number[selected_instance_id] - ENCODER[ENC_L].speed(), VOICECONFIG_NUM_MIN, VOICECONFIG_NUM_MAX); } else if (LCDML.BT_checkEnter()) { - mode = 0xff; - lcd.setCursor(0, 1); - if (load_sd_voiceconfig_json(configuration.performance.voiceconfig_number[selected_instance_id], selected_instance_id) == false) - lcd.print("Does not exist. "); - else - lcd.print("Done. "); + if (mode > 0) { + mode = 0xff; + lcd.setCursor(0, 1); + if (load_sd_voiceconfig_json(configuration.performance.voiceconfig_number[selected_instance_id], selected_instance_id) == false) + lcd.print("Does not exist. "); + else + lcd.print("Done. "); - delay(MESSAGE_WAIT_TIME); + delay(MESSAGE_WAIT_TIME); - LCDML.FUNC_goBackToMenu(); + LCDML.FUNC_goBackToMenu(); + } else mode = 1; } if (mode == 0) @@ -6727,7 +6730,7 @@ void UI_func_load_voiceconfig(uint8_t param) void UI_func_save_voiceconfig(uint8_t param) { -#if NUMDEXED > 1 +#if NUM_DEXED > 1 static int8_t selected_instance_id; #else uint8_t selected_instance_id = 0; @@ -6739,8 +6742,6 @@ void UI_func_save_voiceconfig(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { - char tmp[FILENAME_LEN]; - yesno = false; selected_instance_id = 0; @@ -6748,7 +6749,7 @@ void UI_func_save_voiceconfig(uint8_t param) lcd.setCursor(0, 0); lcd.print(F("Save VoiceCfg SD")); -#if NUMDEXED > 1 +#if NUM_DEXED > 1 mode = 0; lcd.setCursor(0, 1); lcd.print(F("Instance [0]")); @@ -6773,7 +6774,8 @@ void UI_func_save_voiceconfig(uint8_t param) if (LCDML.BT_checkDown()) { if (mode == 0) - selected_instance_id = (selected_instance_id + 1) % 2; + selected_instance_id = 1; + // selected_instance_id = (selected_instance_id +1) % 2; else if (mode == 1) configuration.performance.voiceconfig_number[selected_instance_id] = constrain(configuration.performance.voiceconfig_number[selected_instance_id] + ENCODER[ENC_L].speed(), VOICECONFIG_NUM_MIN, VOICECONFIG_NUM_MAX); else @@ -6782,7 +6784,8 @@ void UI_func_save_voiceconfig(uint8_t param) else if (LCDML.BT_checkUp()) { if (mode == 0) - selected_instance_id = (selected_instance_id - 1) % 2; + selected_instance_id = 0; + //selected_instance_id = (selected_instance_id - 1) % 2; else if (mode == 1) configuration.performance.voiceconfig_number[selected_instance_id] = constrain(configuration.performance.voiceconfig_number[selected_instance_id] - ENCODER[ENC_L].speed(), VOICECONFIG_NUM_MIN, VOICECONFIG_NUM_MAX); else @@ -6796,7 +6799,7 @@ void UI_func_save_voiceconfig(uint8_t param) lcd.setCursor(0, 1); lcd.print(F("Overwrite: [ ]")); } - else + else if (mode > 0 ) { mode = 0xff; if (overwrite == false || yesno == true) @@ -6822,12 +6825,18 @@ void UI_func_save_voiceconfig(uint8_t param) lcd.print(tmp); } } + else { + mode = 1; + lcd.setCursor(4, 1); + lcd.print(" "); + } } if (mode == 0) { lcd.setCursor(10, 1); - lcd.print(configuration.performance.voiceconfig_number[selected_instance_id]); + //lcd.print(configuration.performance.voiceconfig_number[selected_instance_id]); + lcd.print(selected_instance_id); } else if (mode == 1) {