Dateien hochladen nach „“

pull/87/head
positionhigh 3 years ago
parent abb605e0ea
commit fcdf6598cf
  1. 53
      UI.hpp

@ -6626,7 +6626,7 @@ void UI_func_save_performance(uint8_t param)
void UI_func_load_voiceconfig(uint8_t param) void UI_func_load_voiceconfig(uint8_t param)
{ {
#if NUMDEXED > 1 #if NUM_DEXED > 1
static int8_t selected_instance_id; static int8_t selected_instance_id;
#else #else
uint8_t selected_instance_id = 0; uint8_t selected_instance_id = 0;
@ -6636,15 +6636,14 @@ void UI_func_load_voiceconfig(uint8_t param)
if (LCDML.FUNC_setup()) // ****** SETUP ********* if (LCDML.FUNC_setup()) // ****** SETUP *********
{ {
char tmp[10];
selected_instance_id = 0; selected_instance_id = 0;
encoderDir[ENC_R].reset(); encoderDir[ENC_R].reset();
lcd.setCursor(0, 0); lcd.setCursor(0, 0);
lcd.print(F("Load VoiceCfg SD")); lcd.print(F("Load VoiceCfg SD"));
#if NUMDEXED > 1 #if NUM_DEXED > 1
mode = 0; mode = 0;
lcd.setCursor(0, 1); lcd.setCursor(0, 1);
lcd.print(F("Instance [0]")); lcd.print(F("Instance [0]"));
@ -6663,29 +6662,33 @@ void UI_func_load_voiceconfig(uint8_t param)
if (LCDML.BT_checkDown()) if (LCDML.BT_checkDown())
{ {
if (mode == 0) 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) 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); 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()) else if (LCDML.BT_checkUp())
{ {
if (mode == 0) 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) 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); 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()) else if (LCDML.BT_checkEnter())
{ {
mode = 0xff; if (mode > 0) {
lcd.setCursor(0, 1); mode = 0xff;
if (load_sd_voiceconfig_json(configuration.performance.voiceconfig_number[selected_instance_id], selected_instance_id) == false) lcd.setCursor(0, 1);
lcd.print("Does not exist. "); if (load_sd_voiceconfig_json(configuration.performance.voiceconfig_number[selected_instance_id], selected_instance_id) == false)
else lcd.print("Does not exist. ");
lcd.print("Done. "); else
lcd.print("Done. ");
delay(MESSAGE_WAIT_TIME); delay(MESSAGE_WAIT_TIME);
LCDML.FUNC_goBackToMenu(); LCDML.FUNC_goBackToMenu();
} else mode = 1;
} }
if (mode == 0) if (mode == 0)
@ -6727,7 +6730,7 @@ void UI_func_load_voiceconfig(uint8_t param)
void UI_func_save_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; static int8_t selected_instance_id;
#else #else
uint8_t selected_instance_id = 0; uint8_t selected_instance_id = 0;
@ -6739,8 +6742,6 @@ void UI_func_save_voiceconfig(uint8_t param)
if (LCDML.FUNC_setup()) // ****** SETUP ********* if (LCDML.FUNC_setup()) // ****** SETUP *********
{ {
char tmp[FILENAME_LEN];
yesno = false; yesno = false;
selected_instance_id = 0; selected_instance_id = 0;
@ -6748,7 +6749,7 @@ void UI_func_save_voiceconfig(uint8_t param)
lcd.setCursor(0, 0); lcd.setCursor(0, 0);
lcd.print(F("Save VoiceCfg SD")); lcd.print(F("Save VoiceCfg SD"));
#if NUMDEXED > 1 #if NUM_DEXED > 1
mode = 0; mode = 0;
lcd.setCursor(0, 1); lcd.setCursor(0, 1);
lcd.print(F("Instance [0]")); lcd.print(F("Instance [0]"));
@ -6773,7 +6774,8 @@ void UI_func_save_voiceconfig(uint8_t param)
if (LCDML.BT_checkDown()) if (LCDML.BT_checkDown())
{ {
if (mode == 0) 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) 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); 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 else
@ -6782,7 +6784,8 @@ void UI_func_save_voiceconfig(uint8_t param)
else if (LCDML.BT_checkUp()) else if (LCDML.BT_checkUp())
{ {
if (mode == 0) 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) 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); 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 else
@ -6796,7 +6799,7 @@ void UI_func_save_voiceconfig(uint8_t param)
lcd.setCursor(0, 1); lcd.setCursor(0, 1);
lcd.print(F("Overwrite: [ ]")); lcd.print(F("Overwrite: [ ]"));
} }
else else if (mode > 0 )
{ {
mode = 0xff; mode = 0xff;
if (overwrite == false || yesno == true) if (overwrite == false || yesno == true)
@ -6822,12 +6825,18 @@ void UI_func_save_voiceconfig(uint8_t param)
lcd.print(tmp); lcd.print(tmp);
} }
} }
else {
mode = 1;
lcd.setCursor(4, 1);
lcd.print(" ");
}
} }
if (mode == 0) if (mode == 0)
{ {
lcd.setCursor(10, 1); 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) else if (mode == 1)
{ {

Loading…
Cancel
Save