|
|
|
@ -313,19 +313,13 @@ void UI_func_seq_mute_matrix(uint8_t param); |
|
|
|
|
void UI_func_seq_track_setup(uint8_t param); |
|
|
|
|
void UI_func_dexed_assign(uint8_t param); |
|
|
|
|
void UI_func_seq_display_style(uint8_t param); |
|
|
|
|
void UI_func_seq_state_load(uint8_t param); |
|
|
|
|
void UI_func_seq_state_save(uint8_t param); |
|
|
|
|
void UI_func_set_sequence_name(uint8_t param); |
|
|
|
|
void UI_func_volume(uint8_t param); |
|
|
|
|
void UI_func_smart_filter(uint8_t param); |
|
|
|
|
void UI_func_drum_midi_channel(uint8_t param); |
|
|
|
|
void UI_func_load_performance(uint8_t param); |
|
|
|
|
void UI_func_save_performance(uint8_t param); |
|
|
|
|
void UI_func_load_voiceconfig(uint8_t param); |
|
|
|
|
void UI_func_save_voiceconfig(uint8_t param); |
|
|
|
|
void UI_func_save_voice(uint8_t param); |
|
|
|
|
void UI_func_load_fx(uint8_t param); |
|
|
|
|
void UI_func_save_fx(uint8_t param); |
|
|
|
|
void UI_func_eeprom_reset(uint8_t param); |
|
|
|
|
void UI_func_midi_soft_thru(uint8_t param); |
|
|
|
|
void UI_func_velocity_level(uint8_t param); |
|
|
|
@ -6357,7 +6351,7 @@ void UI_func_dexed_assign(uint8_t param) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void UI_func_seq_state_load(uint8_t param) |
|
|
|
|
void UI_func_load_performance(uint8_t param) |
|
|
|
|
{ |
|
|
|
|
static uint8_t mode; |
|
|
|
|
if (LCDML.FUNC_setup()) // ****** SETUP *********
|
|
|
|
@ -6426,7 +6420,7 @@ void UI_func_seq_state_load(uint8_t param) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void UI_func_seq_state_save(uint8_t param) |
|
|
|
|
void UI_func_save_performance(uint8_t param) |
|
|
|
|
{ |
|
|
|
|
static bool overwrite; |
|
|
|
|
static bool yesno; |
|
|
|
@ -7281,656 +7275,6 @@ void UI_func_volume(uint8_t param) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void UI_func_load_performance(uint8_t param) |
|
|
|
|
{ |
|
|
|
|
static uint8_t mode; |
|
|
|
|
|
|
|
|
|
if (LCDML.FUNC_setup()) // ****** SETUP *********
|
|
|
|
|
{ |
|
|
|
|
char tmp[10]; |
|
|
|
|
|
|
|
|
|
mode = 0; |
|
|
|
|
|
|
|
|
|
encoderDir[ENC_R].reset(); |
|
|
|
|
|
|
|
|
|
lcd.setCursor(0, 0); |
|
|
|
|
lcd.print(F("Load Perf. SD")); |
|
|
|
|
lcd.setCursor(0, 1); |
|
|
|
|
sprintf(tmp, "[%2d]", configuration.sys.performance_number); |
|
|
|
|
lcd.print(tmp); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (LCDML.FUNC_loop()) // ****** LOOP *********
|
|
|
|
|
{ |
|
|
|
|
if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) |
|
|
|
|
{ |
|
|
|
|
if (LCDML.BT_checkDown()) |
|
|
|
|
{ |
|
|
|
|
configuration.sys.performance_number = constrain(configuration.sys.performance_number + ENCODER[ENC_L].speed(), PERFORMANCE_NUM_MIN, PERFORMANCE_NUM_MAX); |
|
|
|
|
} |
|
|
|
|
else if (LCDML.BT_checkUp()) |
|
|
|
|
{ |
|
|
|
|
configuration.sys.performance_number = constrain(configuration.sys.performance_number - ENCODER[ENC_L].speed(), PERFORMANCE_NUM_MIN, PERFORMANCE_NUM_MAX); |
|
|
|
|
} |
|
|
|
|
else if (LCDML.BT_checkEnter()) |
|
|
|
|
{ |
|
|
|
|
mode = 0xff; |
|
|
|
|
|
|
|
|
|
lcd.setCursor(0, 1); |
|
|
|
|
if (load_sd_performance_json(configuration.sys.performance_number) == false) |
|
|
|
|
lcd.print("Does not exist."); |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
load_sd_voiceconfig_json(configuration.performance.voiceconfig_number[0], 0, 0); |
|
|
|
|
set_voiceconfig_params(0); |
|
|
|
|
#if NUM_DEXED > 1 |
|
|
|
|
load_sd_voiceconfig_json(configuration.performance.voiceconfig_number[1], 1, 0); |
|
|
|
|
set_voiceconfig_params(1); |
|
|
|
|
#endif |
|
|
|
|
load_sd_fx_json(configuration.performance.fx_number, 0); |
|
|
|
|
set_fx_params(); |
|
|
|
|
|
|
|
|
|
lcd.print("Done. "); |
|
|
|
|
} |
|
|
|
|
delay(MESSAGE_WAIT_TIME); |
|
|
|
|
|
|
|
|
|
LCDML.FUNC_goBackToMenu(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
lcd.setCursor(0, 1); |
|
|
|
|
char tmp[10]; |
|
|
|
|
sprintf(tmp, "[%2d]", configuration.sys.performance_number); |
|
|
|
|
lcd.print(tmp); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (LCDML.FUNC_close()) // ****** STABLE END *********
|
|
|
|
|
{ |
|
|
|
|
if (mode < 0xff) |
|
|
|
|
{ |
|
|
|
|
lcd.show(1, 0, 16, "Canceled."); |
|
|
|
|
delay(MESSAGE_WAIT_TIME); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
eeprom_update_performance(); |
|
|
|
|
|
|
|
|
|
encoderDir[ENC_R].reset(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void UI_func_save_performance(uint8_t param) |
|
|
|
|
{ |
|
|
|
|
static bool overwrite; |
|
|
|
|
static bool yesno; |
|
|
|
|
static uint8_t mode; |
|
|
|
|
|
|
|
|
|
if (LCDML.FUNC_setup()) // ****** SETUP *********
|
|
|
|
|
{ |
|
|
|
|
char tmp[FILENAME_LEN]; |
|
|
|
|
|
|
|
|
|
yesno = false; |
|
|
|
|
mode = 0; |
|
|
|
|
|
|
|
|
|
encoderDir[ENC_R].reset(); |
|
|
|
|
|
|
|
|
|
lcd.setCursor(0, 0); |
|
|
|
|
lcd.print(F("Save Perf. SD")); |
|
|
|
|
lcd.setCursor(0, 1); |
|
|
|
|
sprintf(tmp, "[%2d]", configuration.sys.performance_number); |
|
|
|
|
lcd.print(tmp); |
|
|
|
|
|
|
|
|
|
sprintf(tmp, "/%s/%s%d.json", PERFORMANCE_CONFIG_PATH, PERFORMANCE_CONFIG_NAME, configuration.sys.performance_number); |
|
|
|
|
if (SD.exists(tmp)) |
|
|
|
|
overwrite = true; |
|
|
|
|
else |
|
|
|
|
overwrite = false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (LCDML.FUNC_loop()) // ****** LOOP *********
|
|
|
|
|
{ |
|
|
|
|
if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) |
|
|
|
|
{ |
|
|
|
|
if (LCDML.BT_checkDown()) |
|
|
|
|
{ |
|
|
|
|
if (mode == 0) |
|
|
|
|
configuration.sys.performance_number = constrain(configuration.sys.performance_number + ENCODER[ENC_L].speed(), PERFORMANCE_NUM_MIN, PERFORMANCE_NUM_MAX); |
|
|
|
|
else |
|
|
|
|
yesno = true; |
|
|
|
|
} |
|
|
|
|
else if (LCDML.BT_checkUp()) |
|
|
|
|
{ |
|
|
|
|
if (mode == 0) |
|
|
|
|
configuration.sys.performance_number = constrain(configuration.sys.performance_number - ENCODER[ENC_L].speed(), PERFORMANCE_NUM_MIN, PERFORMANCE_NUM_MAX); |
|
|
|
|
else |
|
|
|
|
yesno = false; |
|
|
|
|
} |
|
|
|
|
else if (LCDML.BT_checkEnter()) |
|
|
|
|
{ |
|
|
|
|
if (mode == 0 && overwrite == true) |
|
|
|
|
{ |
|
|
|
|
mode = 1; |
|
|
|
|
lcd.setCursor(0, 1); |
|
|
|
|
lcd.print(F("Overwrite: [ ]")); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
mode = 0xff; |
|
|
|
|
if (overwrite == false || yesno == true) |
|
|
|
|
{ |
|
|
|
|
if (yesno == true) |
|
|
|
|
{ |
|
|
|
|
char tmp[FILENAME_LEN]; |
|
|
|
|
sprintf(tmp, "/%s/%s%d.json", PERFORMANCE_CONFIG_PATH, PERFORMANCE_CONFIG_NAME, configuration.sys.performance_number); |
|
|
|
|
SD.remove(tmp); |
|
|
|
|
} |
|
|
|
|
save_sd_performance_json(configuration.sys.performance_number); |
|
|
|
|
lcd.show(1, 0, 16, "Done."); |
|
|
|
|
delay(MESSAGE_WAIT_TIME); |
|
|
|
|
LCDML.FUNC_goBackToMenu(); |
|
|
|
|
} |
|
|
|
|
else if (overwrite == true && yesno == false) |
|
|
|
|
{ |
|
|
|
|
char tmp[17]; |
|
|
|
|
|
|
|
|
|
mode = 0; |
|
|
|
|
lcd.setCursor(0, 1); |
|
|
|
|
sprintf(tmp, "[%2d] ", configuration.sys.performance_number); |
|
|
|
|
lcd.print(tmp); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (mode == 0) |
|
|
|
|
{ |
|
|
|
|
char tmp[FILENAME_LEN]; |
|
|
|
|
sprintf(tmp, "/%s/%s%d.json", PERFORMANCE_CONFIG_PATH, PERFORMANCE_CONFIG_NAME, configuration.sys.performance_number); |
|
|
|
|
if (SD.exists(tmp)) |
|
|
|
|
overwrite = true; |
|
|
|
|
else |
|
|
|
|
overwrite = false; |
|
|
|
|
|
|
|
|
|
lcd.setCursor(0, 1); |
|
|
|
|
sprintf(tmp, "[%2d]", configuration.sys.performance_number); |
|
|
|
|
lcd.print(tmp); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
lcd.setCursor(12, 1); |
|
|
|
|
if (yesno == true) |
|
|
|
|
lcd.print(F("YES")); |
|
|
|
|
else |
|
|
|
|
lcd.print(F("NO ")); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
encoderDir[ENC_R].reset(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (LCDML.FUNC_close()) // ****** STABLE END *********
|
|
|
|
|
{ |
|
|
|
|
if (mode < 0xff) |
|
|
|
|
{ |
|
|
|
|
lcd.show(1, 0, 16, "Canceled."); |
|
|
|
|
delay(MESSAGE_WAIT_TIME); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, sys.performance_number), configuration.sys.performance_number); |
|
|
|
|
|
|
|
|
|
encoderDir[ENC_R].reset(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void UI_func_load_voiceconfig(uint8_t param) |
|
|
|
|
{ |
|
|
|
|
#if NUM_DEXED > 1 |
|
|
|
|
static int8_t selected_instance_id; |
|
|
|
|
#else |
|
|
|
|
char tmp[4]; |
|
|
|
|
uint8_t selected_instance_id = 0; |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
static uint8_t mode; |
|
|
|
|
|
|
|
|
|
if (LCDML.FUNC_setup()) // ****** SETUP *********
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
selected_instance_id = 0; |
|
|
|
|
|
|
|
|
|
encoderDir[ENC_R].reset(); |
|
|
|
|
|
|
|
|
|
lcd.setCursor(0, 0); |
|
|
|
|
lcd.print(F("Load VoiceCfg SD")); |
|
|
|
|
#if NUM_DEXED > 1 |
|
|
|
|
mode = 0; |
|
|
|
|
lcd.setCursor(0, 1); |
|
|
|
|
lcd.print(F("Instance [0]")); |
|
|
|
|
#else |
|
|
|
|
mode = 1; |
|
|
|
|
lcd.setCursor(0, 1); |
|
|
|
|
sprintf(tmp, "[%2d]", configuration.performance.voiceconfig_number[selected_instance_id]); |
|
|
|
|
lcd.print(tmp); |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (LCDML.FUNC_loop()) // ****** LOOP *********
|
|
|
|
|
{ |
|
|
|
|
if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) |
|
|
|
|
{ |
|
|
|
|
if (LCDML.BT_checkDown()) |
|
|
|
|
{ |
|
|
|
|
if (mode == 0) |
|
|
|
|
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 = 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()) |
|
|
|
|
{ |
|
|
|
|
if (mode > 0) { |
|
|
|
|
mode = 0xff; |
|
|
|
|
lcd.setCursor(0, 1); |
|
|
|
|
if (load_sd_voiceconfig_json(configuration.performance.voiceconfig_number[selected_instance_id], selected_instance_id, 0) == false) |
|
|
|
|
lcd.print("Does not exist. "); |
|
|
|
|
else |
|
|
|
|
lcd.print("Done. "); |
|
|
|
|
|
|
|
|
|
delay(MESSAGE_WAIT_TIME); |
|
|
|
|
|
|
|
|
|
LCDML.FUNC_goBackToMenu(); |
|
|
|
|
} else mode = 1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (mode == 0) |
|
|
|
|
{ |
|
|
|
|
lcd.setCursor(10, 1); |
|
|
|
|
lcd.print(selected_instance_id); |
|
|
|
|
} |
|
|
|
|
else if (mode == 1) |
|
|
|
|
{ |
|
|
|
|
lcd.setCursor(0, 1); |
|
|
|
|
char tmp[10]; |
|
|
|
|
sprintf(tmp, "[%2d]", configuration.performance.voiceconfig_number[selected_instance_id]); |
|
|
|
|
lcd.print(tmp); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
encoderDir[ENC_R].reset(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (LCDML.FUNC_close()) // ****** STABLE END *********
|
|
|
|
|
{ |
|
|
|
|
if (mode < 0xff) |
|
|
|
|
{ |
|
|
|
|
lcd.show(1, 0, 16, "Canceled."); |
|
|
|
|
delay(MESSAGE_WAIT_TIME); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
eeprom_update_dexed(selected_instance_id); |
|
|
|
|
|
|
|
|
|
#if NUM_DEXED > 1 |
|
|
|
|
if (selected_instance_id > 0) |
|
|
|
|
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, performance.voiceconfig_number[1]), configuration.performance.voiceconfig_number[1]); |
|
|
|
|
else |
|
|
|
|
#endif |
|
|
|
|
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, performance.voiceconfig_number[0]), configuration.performance.voiceconfig_number[0]); |
|
|
|
|
|
|
|
|
|
encoderDir[ENC_R].reset(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void UI_func_save_voiceconfig(uint8_t param) |
|
|
|
|
{ |
|
|
|
|
#if NUM_DEXED > 1 |
|
|
|
|
static int8_t selected_instance_id; |
|
|
|
|
#else |
|
|
|
|
char tmp[5]; |
|
|
|
|
uint8_t selected_instance_id = 0; |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
static bool overwrite; |
|
|
|
|
static bool yesno; |
|
|
|
|
static uint8_t mode; |
|
|
|
|
|
|
|
|
|
if (LCDML.FUNC_setup()) // ****** SETUP *********
|
|
|
|
|
{ |
|
|
|
|
yesno = false; |
|
|
|
|
selected_instance_id = 0; |
|
|
|
|
|
|
|
|
|
encoderDir[ENC_R].reset(); |
|
|
|
|
|
|
|
|
|
lcd.setCursor(0, 0); |
|
|
|
|
lcd.print(F("Save VoiceCfg SD")); |
|
|
|
|
#if NUM_DEXED > 1 |
|
|
|
|
mode = 0; |
|
|
|
|
lcd.setCursor(0, 1); |
|
|
|
|
lcd.print(F("Instance [0]")); |
|
|
|
|
#else |
|
|
|
|
mode = 1; |
|
|
|
|
lcd.setCursor(0, 1); |
|
|
|
|
sprintf(tmp, "[%2d]", configuration.performance.voiceconfig_number[selected_instance_id]); |
|
|
|
|
lcd.print(tmp); |
|
|
|
|
|
|
|
|
|
sprintf(tmp, "/%s/%s%d.json", VOICE_CONFIG_PATH, VOICE_CONFIG_NAME, configuration.performance.voiceconfig_number[selected_instance_id]); |
|
|
|
|
if (SD.exists(tmp)) |
|
|
|
|
overwrite = true; |
|
|
|
|
else |
|
|
|
|
overwrite = false; |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (LCDML.FUNC_loop()) // ****** LOOP *********
|
|
|
|
|
{ |
|
|
|
|
if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) |
|
|
|
|
{ |
|
|
|
|
if (LCDML.BT_checkDown()) |
|
|
|
|
{ |
|
|
|
|
if (mode == 0) |
|
|
|
|
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 |
|
|
|
|
yesno = true; |
|
|
|
|
} |
|
|
|
|
else if (LCDML.BT_checkUp()) |
|
|
|
|
{ |
|
|
|
|
if (mode == 0) |
|
|
|
|
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 |
|
|
|
|
yesno = false; |
|
|
|
|
} |
|
|
|
|
else if (LCDML.BT_checkEnter()) |
|
|
|
|
{ |
|
|
|
|
if (mode == 1 && overwrite == true) |
|
|
|
|
{ |
|
|
|
|
mode = 2; |
|
|
|
|
lcd.setCursor(0, 1); |
|
|
|
|
lcd.print(F("Overwrite: [ ]")); |
|
|
|
|
} |
|
|
|
|
else if (mode > 0 ) |
|
|
|
|
{ |
|
|
|
|
mode = 0xff; |
|
|
|
|
if (overwrite == false || yesno == true) |
|
|
|
|
{ |
|
|
|
|
if (yesno == true) |
|
|
|
|
{ |
|
|
|
|
char tmp[FILENAME_LEN]; |
|
|
|
|
sprintf(tmp, "/%s/%s%d.json", VOICE_CONFIG_PATH, VOICE_CONFIG_NAME, configuration.performance.voiceconfig_number[selected_instance_id]); |
|
|
|
|
SD.remove(tmp); |
|
|
|
|
} |
|
|
|
|
save_sd_voiceconfig_json(configuration.performance.voiceconfig_number[selected_instance_id], selected_instance_id, 0); |
|
|
|
|
lcd.show(1, 0, 16, "Done."); |
|
|
|
|
delay(MESSAGE_WAIT_TIME); |
|
|
|
|
LCDML.FUNC_goBackToMenu(); |
|
|
|
|
} |
|
|
|
|
else if (overwrite == true && yesno == false) |
|
|
|
|
{ |
|
|
|
|
char tmp[17]; |
|
|
|
|
|
|
|
|
|
mode = 1; |
|
|
|
|
lcd.setCursor(0, 1); |
|
|
|
|
sprintf(tmp, "[%2d] ", configuration.performance.voiceconfig_number[selected_instance_id]); |
|
|
|
|
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); |
|
|
|
|
} |
|
|
|
|
else if (mode == 1) |
|
|
|
|
{ |
|
|
|
|
char tmp[FILENAME_LEN]; |
|
|
|
|
|
|
|
|
|
sprintf(tmp, "/%s/%s%d.json", VOICE_CONFIG_PATH, VOICE_CONFIG_NAME, configuration.performance.voiceconfig_number[selected_instance_id]); |
|
|
|
|
if (SD.exists(tmp)) |
|
|
|
|
overwrite = true; |
|
|
|
|
else |
|
|
|
|
overwrite = false; |
|
|
|
|
|
|
|
|
|
lcd.setCursor(0, 1); |
|
|
|
|
sprintf(tmp, "[%2d]", configuration.performance.voiceconfig_number[selected_instance_id]); |
|
|
|
|
lcd.print(tmp); |
|
|
|
|
} |
|
|
|
|
else if (mode == 2) |
|
|
|
|
{ |
|
|
|
|
lcd.setCursor(12, 1); |
|
|
|
|
if (yesno == true) |
|
|
|
|
lcd.print(F("YES")); |
|
|
|
|
else |
|
|
|
|
lcd.print(F("NO ")); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
encoderDir[ENC_R].reset(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (LCDML.FUNC_close()) // ****** STABLE END *********
|
|
|
|
|
{ |
|
|
|
|
if (mode < 0xff) |
|
|
|
|
{ |
|
|
|
|
lcd.show(1, 0, 16, "Canceled."); |
|
|
|
|
delay(MESSAGE_WAIT_TIME); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#if NUM_DEXED > 1 |
|
|
|
|
if (selected_instance_id > 0) |
|
|
|
|
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, performance.voiceconfig_number[1]), configuration.performance.voiceconfig_number[1]); |
|
|
|
|
else |
|
|
|
|
#endif |
|
|
|
|
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, performance.voiceconfig_number[0]), configuration.performance.voiceconfig_number[0]); |
|
|
|
|
|
|
|
|
|
encoderDir[ENC_R].reset(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void UI_func_load_fx(uint8_t param) |
|
|
|
|
{ |
|
|
|
|
static uint8_t mode; |
|
|
|
|
|
|
|
|
|
if (LCDML.FUNC_setup()) // ****** SETUP *********
|
|
|
|
|
{ |
|
|
|
|
char tmp[10]; |
|
|
|
|
|
|
|
|
|
mode = 0; |
|
|
|
|
|
|
|
|
|
encoderDir[ENC_R].reset(); |
|
|
|
|
|
|
|
|
|
lcd.setCursor(0, 0); |
|
|
|
|
lcd.print(F("Load FX SD")); |
|
|
|
|
lcd.setCursor(0, 1); |
|
|
|
|
sprintf(tmp, "[%2d]", configuration.performance.fx_number); |
|
|
|
|
lcd.print(tmp); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (LCDML.FUNC_loop()) // ****** LOOP *********
|
|
|
|
|
{ |
|
|
|
|
if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) |
|
|
|
|
{ |
|
|
|
|
if (LCDML.BT_checkDown()) |
|
|
|
|
{ |
|
|
|
|
configuration.performance.fx_number = constrain(configuration.performance.fx_number + ENCODER[ENC_L].speed(), FX_NUM_MIN, FX_NUM_MAX); |
|
|
|
|
} |
|
|
|
|
else if (LCDML.BT_checkUp()) |
|
|
|
|
{ |
|
|
|
|
configuration.performance.fx_number = constrain(configuration.performance.fx_number - ENCODER[ENC_L].speed(), FX_NUM_MIN, FX_NUM_MAX); |
|
|
|
|
} |
|
|
|
|
else if (LCDML.BT_checkEnter()) |
|
|
|
|
{ |
|
|
|
|
mode = 0xff; |
|
|
|
|
|
|
|
|
|
lcd.setCursor(0, 1); |
|
|
|
|
if (load_sd_fx_json(configuration.performance.fx_number, 0) == false) |
|
|
|
|
lcd.print("Does not exist. "); |
|
|
|
|
else |
|
|
|
|
lcd.print("Done. "); |
|
|
|
|
|
|
|
|
|
delay(MESSAGE_WAIT_TIME); |
|
|
|
|
|
|
|
|
|
LCDML.FUNC_goBackToMenu(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
lcd.setCursor(0, 1); |
|
|
|
|
char tmp[10]; |
|
|
|
|
sprintf(tmp, "[%2d]", configuration.performance.fx_number); |
|
|
|
|
lcd.print(tmp); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (LCDML.FUNC_close()) // ****** STABLE END *********
|
|
|
|
|
{ |
|
|
|
|
if (mode < 0xff) |
|
|
|
|
{ |
|
|
|
|
lcd.show(1, 0, 16, "Canceled."); |
|
|
|
|
delay(MESSAGE_WAIT_TIME); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
eeprom_update_fx(); |
|
|
|
|
|
|
|
|
|
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, performance.fx_number), configuration.performance.fx_number); |
|
|
|
|
|
|
|
|
|
encoderDir[ENC_R].reset(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void UI_func_save_fx(uint8_t param) |
|
|
|
|
{ |
|
|
|
|
static bool overwrite; |
|
|
|
|
static bool yesno; |
|
|
|
|
static uint8_t mode; |
|
|
|
|
|
|
|
|
|
if (LCDML.FUNC_setup()) // ****** SETUP *********
|
|
|
|
|
{ |
|
|
|
|
char tmp[FILENAME_LEN]; |
|
|
|
|
|
|
|
|
|
yesno = false; |
|
|
|
|
mode = 0; |
|
|
|
|
|
|
|
|
|
encoderDir[ENC_R].reset(); |
|
|
|
|
|
|
|
|
|
lcd.setCursor(0, 0); |
|
|
|
|
lcd.print(F("Save FX")); |
|
|
|
|
lcd.setCursor(0, 1); |
|
|
|
|
sprintf(tmp, "[%2d]", configuration.performance.fx_number); |
|
|
|
|
lcd.print(tmp); |
|
|
|
|
|
|
|
|
|
sprintf(tmp, "/%s/%s%d.json", FX_CONFIG_PATH, FX_CONFIG_NAME, configuration.performance.fx_number); |
|
|
|
|
if (SD.exists(tmp)) |
|
|
|
|
overwrite = true; |
|
|
|
|
else |
|
|
|
|
overwrite = false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (LCDML.FUNC_loop()) // ****** LOOP *********
|
|
|
|
|
{ |
|
|
|
|
if ((LCDML.BT_checkDown() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) |
|
|
|
|
{ |
|
|
|
|
if (LCDML.BT_checkDown()) |
|
|
|
|
{ |
|
|
|
|
if (mode == 0) |
|
|
|
|
configuration.performance.fx_number = constrain(configuration.performance.fx_number + ENCODER[ENC_L].speed(), FX_NUM_MIN, FX_NUM_MAX); |
|
|
|
|
else |
|
|
|
|
yesno = true; |
|
|
|
|
} |
|
|
|
|
else if (LCDML.BT_checkUp()) |
|
|
|
|
{ |
|
|
|
|
if (mode == 0) |
|
|
|
|
configuration.performance.fx_number = constrain(configuration.performance.fx_number - ENCODER[ENC_L].speed(), FX_NUM_MIN, FX_NUM_MAX); |
|
|
|
|
else |
|
|
|
|
yesno = false; |
|
|
|
|
} |
|
|
|
|
else if (LCDML.BT_checkEnter()) |
|
|
|
|
{ |
|
|
|
|
if (mode == 0 && overwrite == true) |
|
|
|
|
{ |
|
|
|
|
mode = 1; |
|
|
|
|
lcd.setCursor(0, 1); |
|
|
|
|
lcd.print(F("Overwrite: [ ]")); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
mode = 0xff; |
|
|
|
|
if (overwrite == false || yesno == true) |
|
|
|
|
{ |
|
|
|
|
if (yesno == true) |
|
|
|
|
{ |
|
|
|
|
char tmp[FILENAME_LEN]; |
|
|
|
|
sprintf(tmp, "/%s/%s%d.json", FX_CONFIG_PATH, FX_CONFIG_NAME, configuration.performance.fx_number); |
|
|
|
|
SD.remove(tmp); |
|
|
|
|
} |
|
|
|
|
save_sd_fx_json(configuration.performance.fx_number, 0); |
|
|
|
|
|
|
|
|
|
lcd.show(1, 0, 16, "Done."); |
|
|
|
|
LCDML.FUNC_goBackToMenu(); |
|
|
|
|
delay(MESSAGE_WAIT_TIME); |
|
|
|
|
} |
|
|
|
|
else if (overwrite == true && yesno == false) |
|
|
|
|
{ |
|
|
|
|
char tmp[17]; |
|
|
|
|
|
|
|
|
|
mode = 0; |
|
|
|
|
lcd.setCursor(0, 1); |
|
|
|
|
sprintf(tmp, "[%2d] ", configuration.performance.fx_number); |
|
|
|
|
lcd.print(tmp); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (mode == 0) |
|
|
|
|
{ |
|
|
|
|
char tmp[FILENAME_LEN]; |
|
|
|
|
sprintf(tmp, "/%s/%s%d.json", FX_CONFIG_PATH, FX_CONFIG_NAME, configuration.performance.fx_number); |
|
|
|
|
if (SD.exists(tmp)) |
|
|
|
|
overwrite = true; |
|
|
|
|
else |
|
|
|
|
overwrite = false; |
|
|
|
|
|
|
|
|
|
lcd.setCursor(0, 1); |
|
|
|
|
sprintf(tmp, "[%2d]", configuration.performance.fx_number); |
|
|
|
|
lcd.print(tmp); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
lcd.setCursor(12, 1); |
|
|
|
|
if (yesno == true) |
|
|
|
|
lcd.print(F("YES")); |
|
|
|
|
else |
|
|
|
|
lcd.print(F("NO ")); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
encoderDir[ENC_R].reset(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (LCDML.FUNC_close()) // ****** STABLE END *********
|
|
|
|
|
{ |
|
|
|
|
if (mode < 0xff) |
|
|
|
|
{ |
|
|
|
|
lcd.show(1, 0, 16, "Canceled."); |
|
|
|
|
delay(MESSAGE_WAIT_TIME); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
EEPROM.update(EEPROM_START_ADDRESS + offsetof(configuration_s, performance.fx_number), configuration.performance.fx_number); |
|
|
|
|
|
|
|
|
|
encoderDir[ENC_R].reset(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void UI_func_save_voice(uint8_t param) |
|
|
|
|
{ |
|
|
|
|
static bool yesno; |
|
|
|
|