From abb605e0eacf33a581dfdaf2b73d724eee670d8e Mon Sep 17 00:00:00 2001 From: positionhigh Date: Wed, 18 Aug 2021 18:37:32 +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, 22 insertions(+), 31 deletions(-) diff --git a/UI.hpp b/UI.hpp index 2379480..3383dcd 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 NUM_DEXED > 1 +#if NUMDEXED > 1 static int8_t selected_instance_id; #else uint8_t selected_instance_id = 0; @@ -6636,14 +6636,15 @@ 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 NUM_DEXED > 1 +#if NUMDEXED > 1 mode = 0; lcd.setCursor(0, 1); lcd.print(F("Instance [0]")); @@ -6662,33 +6663,29 @@ void UI_func_load_voiceconfig(uint8_t param) if (LCDML.BT_checkDown()) { if (mode == 0) - selected_instance_id = 1; - //selected_instance_id = (selected_instance_id + 1) % 2; + 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 = 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 if (LCDML.BT_checkEnter()) { - 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. "); + 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(); - } else mode = 1; + LCDML.FUNC_goBackToMenu(); } if (mode == 0) @@ -6730,7 +6727,7 @@ void UI_func_load_voiceconfig(uint8_t param) void UI_func_save_voiceconfig(uint8_t param) { -#if NUM_DEXED > 1 +#if NUMDEXED > 1 static int8_t selected_instance_id; #else uint8_t selected_instance_id = 0; @@ -6742,6 +6739,8 @@ void UI_func_save_voiceconfig(uint8_t param) if (LCDML.FUNC_setup()) // ****** SETUP ********* { + char tmp[FILENAME_LEN]; + yesno = false; selected_instance_id = 0; @@ -6749,7 +6748,7 @@ void UI_func_save_voiceconfig(uint8_t param) lcd.setCursor(0, 0); lcd.print(F("Save VoiceCfg SD")); -#if NUM_DEXED > 1 +#if NUMDEXED > 1 mode = 0; lcd.setCursor(0, 1); lcd.print(F("Instance [0]")); @@ -6774,8 +6773,7 @@ void UI_func_save_voiceconfig(uint8_t param) if (LCDML.BT_checkDown()) { if (mode == 0) - selected_instance_id = 1; - // selected_instance_id = (selected_instance_id +1) % 2; + 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 @@ -6784,8 +6782,7 @@ void UI_func_save_voiceconfig(uint8_t param) else if (LCDML.BT_checkUp()) { if (mode == 0) - selected_instance_id = 0; - //selected_instance_id = (selected_instance_id - 1) % 2; + 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 @@ -6799,7 +6796,7 @@ void UI_func_save_voiceconfig(uint8_t param) lcd.setCursor(0, 1); lcd.print(F("Overwrite: [ ]")); } - else if (mode > 0 ) + else { mode = 0xff; if (overwrite == false || yesno == true) @@ -6825,18 +6822,12 @@ 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(selected_instance_id); + lcd.print(configuration.performance.voiceconfig_number[selected_instance_id]); } else if (mode == 1) {