|
|
@ -47,15 +47,7 @@ |
|
|
|
#define _LCDML_DISP_cfg_scrollbar 1 // enable a scrollbar
|
|
|
|
#define _LCDML_DISP_cfg_scrollbar 1 // enable a scrollbar
|
|
|
|
|
|
|
|
|
|
|
|
extern config_t configuration; |
|
|
|
extern config_t configuration; |
|
|
|
extern uint8_t dexed_setup_number; |
|
|
|
|
|
|
|
extern void set_volume(uint8_t v, uint8_t m); |
|
|
|
extern void set_volume(uint8_t v, uint8_t m); |
|
|
|
extern char bank_names[NUM_DEXED][MAX_BANKS][BANK_NAME_LEN]; |
|
|
|
|
|
|
|
extern char bank_name[NUM_DEXED][BANK_NAME_LEN]; |
|
|
|
|
|
|
|
extern char voice_name[NUM_DEXED][VOICE_NAME_LEN]; |
|
|
|
|
|
|
|
extern char voice_names[NUM_DEXED][MAX_VOICES][VOICE_NAME_LEN]; |
|
|
|
|
|
|
|
extern void strip_extension(char* s, char *target); |
|
|
|
|
|
|
|
//extern void eeprom_write(void);
|
|
|
|
|
|
|
|
extern bool get_voice_names_from_bank(uint8_t b, uint8_t instance_id); |
|
|
|
|
|
|
|
extern bool load_sysex(uint8_t b, uint8_t v); |
|
|
|
extern bool load_sysex(uint8_t b, uint8_t v); |
|
|
|
extern void generate_version_string(char* buffer, uint8_t len); |
|
|
|
extern void generate_version_string(char* buffer, uint8_t len); |
|
|
|
extern void initial_values_from_eeprom(bool init); |
|
|
|
extern void initial_values_from_eeprom(bool init); |
|
|
@ -3197,7 +3189,7 @@ void UI_func_eeprom_reset(uint8_t param) |
|
|
|
void UI_func_voice_select(uint8_t param) |
|
|
|
void UI_func_voice_select(uint8_t param) |
|
|
|
{ |
|
|
|
{ |
|
|
|
uint8_t instance_id = 0; |
|
|
|
uint8_t instance_id = 0; |
|
|
|
static uint8_t menu_voice_select = MENU_VOICE_SOUND; |
|
|
|
static uint8_t menu_voice_select = MENU_VOICE_SOUND; |
|
|
|
|
|
|
|
|
|
|
|
if (LCDML.FUNC_getID() > MENU_ID_OF_INSTANCE_2) |
|
|
|
if (LCDML.FUNC_getID() > MENU_ID_OF_INSTANCE_2) |
|
|
|
instance_id = 1; |
|
|
|
instance_id = 1; |
|
|
@ -3206,12 +3198,18 @@ void UI_func_voice_select(uint8_t param) |
|
|
|
{ |
|
|
|
{ |
|
|
|
encoderDir[ENC_R].reset(); |
|
|
|
encoderDir[ENC_R].reset(); |
|
|
|
|
|
|
|
|
|
|
|
strip_extension(bank_names[instance_id][configuration.performance.bank[instance_id]], bank_name[instance_id]); |
|
|
|
char bank_name[BANK_NAME_LEN]; |
|
|
|
|
|
|
|
char voice_name[VOICE_NAME_LEN]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!get_bank_name(configuration.performance.bank[instance_id], bank_name, sizeof(bank_name))) |
|
|
|
|
|
|
|
strncpy(bank_name, "*ERROR*", sizeof(bank_name)); |
|
|
|
|
|
|
|
if (!get_voice_by_bank_name(configuration.performance.bank[instance_id], bank_name, configuration.performance.voice[instance_id], voice_name, sizeof(voice_name))) |
|
|
|
|
|
|
|
strncpy(voice_name, "*ERROR*", sizeof(voice_name)); |
|
|
|
|
|
|
|
|
|
|
|
lcd.show(0, 0, 2, configuration.performance.bank[instance_id]); |
|
|
|
lcd.show(0, 0, 2, configuration.performance.bank[instance_id]); |
|
|
|
lcd.show(1, 0, 2, configuration.performance.voice[instance_id] + 1); |
|
|
|
lcd.show(1, 0, 2, configuration.performance.voice[instance_id] + 1); |
|
|
|
lcd.show(0, 4, 10, bank_name[instance_id]); |
|
|
|
lcd.show(0, 4, 10, bank_name); |
|
|
|
lcd.show(1, 4, 10, voice_names[instance_id][configuration.performance.voice[instance_id]]); |
|
|
|
lcd.show(1, 4, 10, voice_name); |
|
|
|
|
|
|
|
|
|
|
|
switch (menu_voice_select) |
|
|
|
switch (menu_voice_select) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -3232,12 +3230,16 @@ void UI_func_voice_select(uint8_t param) |
|
|
|
|
|
|
|
|
|
|
|
if (LCDML.FUNC_loop()) // ****** LOOP *********
|
|
|
|
if (LCDML.FUNC_loop()) // ****** LOOP *********
|
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
char bank_name[BANK_NAME_LEN]; |
|
|
|
|
|
|
|
char voice_name[VOICE_NAME_LEN]; |
|
|
|
|
|
|
|
|
|
|
|
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() && encoderDir[ENC_R].Down()) || (LCDML.BT_checkUp() && encoderDir[ENC_R].Up()) || (LCDML.BT_checkEnter() && encoderDir[ENC_R].ButtonShort())) |
|
|
|
{ |
|
|
|
{ |
|
|
|
uint8_t bank_tmp; |
|
|
|
uint8_t bank_tmp; |
|
|
|
int8_t voice_tmp; |
|
|
|
int8_t voice_tmp; |
|
|
|
|
|
|
|
|
|
|
|
if (LCDML.BT_checkUp()) |
|
|
|
if (LCDML.BT_checkUp()) |
|
|
|
|
|
|
|
{ |
|
|
|
switch (menu_voice_select) |
|
|
|
switch (menu_voice_select) |
|
|
|
{ |
|
|
|
{ |
|
|
|
case MENU_VOICE_BANK: |
|
|
|
case MENU_VOICE_BANK: |
|
|
@ -3247,7 +3249,6 @@ void UI_func_voice_select(uint8_t param) |
|
|
|
change_disp_sd(false); |
|
|
|
change_disp_sd(false); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
load_sd_voice(configuration.performance.bank[instance_id], configuration.performance.voice[instance_id], instance_id); |
|
|
|
load_sd_voice(configuration.performance.bank[instance_id], configuration.performance.voice[instance_id], instance_id); |
|
|
|
get_voice_names_from_bank(configuration.performance.bank[instance_id], instance_id); |
|
|
|
|
|
|
|
#ifdef DISPLAY_LCD_SPI |
|
|
|
#ifdef DISPLAY_LCD_SPI |
|
|
|
change_disp_sd(true); |
|
|
|
change_disp_sd(true); |
|
|
|
#endif |
|
|
|
#endif |
|
|
@ -3265,18 +3266,18 @@ void UI_func_voice_select(uint8_t param) |
|
|
|
} |
|
|
|
} |
|
|
|
if (voice_tmp < 0) |
|
|
|
if (voice_tmp < 0) |
|
|
|
voice_tmp = MAX_VOICES + voice_tmp; |
|
|
|
voice_tmp = MAX_VOICES + voice_tmp; |
|
|
|
configuration.performance.voice[instance_id] = voice_tmp; |
|
|
|
configuration.performance.voice[instance_id] = constrain(voice_tmp, 0, MAX_VOICES - 1); |
|
|
|
|
|
|
|
|
|
|
|
#ifdef DISPLAY_LCD_SPI |
|
|
|
#ifdef DISPLAY_LCD_SPI |
|
|
|
change_disp_sd(false); |
|
|
|
change_disp_sd(false); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
load_sd_voice(configuration.performance.bank[instance_id], configuration.performance.voice[instance_id], instance_id); |
|
|
|
load_sd_voice(configuration.performance.bank[instance_id], configuration.performance.voice[instance_id], instance_id); |
|
|
|
get_voice_names_from_bank(configuration.performance.bank[instance_id], instance_id); |
|
|
|
|
|
|
|
#ifdef DISPLAY_LCD_SPI |
|
|
|
#ifdef DISPLAY_LCD_SPI |
|
|
|
change_disp_sd(true); |
|
|
|
change_disp_sd(true); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
else if (LCDML.BT_checkDown()) |
|
|
|
else if (LCDML.BT_checkDown()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
switch (menu_voice_select) |
|
|
|
switch (menu_voice_select) |
|
|
@ -3288,7 +3289,6 @@ void UI_func_voice_select(uint8_t param) |
|
|
|
change_disp_sd(false); |
|
|
|
change_disp_sd(false); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
load_sd_voice(configuration.performance.bank[instance_id], configuration.performance.voice[instance_id], instance_id); |
|
|
|
load_sd_voice(configuration.performance.bank[instance_id], configuration.performance.voice[instance_id], instance_id); |
|
|
|
get_voice_names_from_bank(configuration.performance.bank[instance_id], instance_id); |
|
|
|
|
|
|
|
#ifdef DISPLAY_LCD_SPI |
|
|
|
#ifdef DISPLAY_LCD_SPI |
|
|
|
change_disp_sd(true); |
|
|
|
change_disp_sd(true); |
|
|
|
#endif |
|
|
|
#endif |
|
|
@ -3305,18 +3305,16 @@ void UI_func_voice_select(uint8_t param) |
|
|
|
{ |
|
|
|
{ |
|
|
|
voice_tmp = MAX_VOICES - 1; |
|
|
|
voice_tmp = MAX_VOICES - 1; |
|
|
|
} |
|
|
|
} |
|
|
|
configuration.performance.voice[instance_id] = voice_tmp; |
|
|
|
configuration.performance.voice[instance_id] = constrain(voice_tmp, 0, MAX_VOICES - 1); |
|
|
|
|
|
|
|
|
|
|
|
#ifdef DISPLAY_LCD_SPI |
|
|
|
#ifdef DISPLAY_LCD_SPI |
|
|
|
change_disp_sd(false); |
|
|
|
change_disp_sd(false); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
load_sd_voice(configuration.performance.bank[instance_id], configuration.performance.voice[instance_id], instance_id); |
|
|
|
load_sd_voice(configuration.performance.bank[instance_id], configuration.performance.voice[instance_id], instance_id); |
|
|
|
get_voice_names_from_bank(configuration.performance.bank[instance_id], instance_id); |
|
|
|
|
|
|
|
#ifdef DISPLAY_LCD_SPI |
|
|
|
#ifdef DISPLAY_LCD_SPI |
|
|
|
change_disp_sd(true); |
|
|
|
change_disp_sd(true); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else if (LCDML.BT_checkEnter()) |
|
|
|
else if (LCDML.BT_checkEnter()) |
|
|
@ -3326,29 +3324,32 @@ void UI_func_voice_select(uint8_t param) |
|
|
|
else |
|
|
|
else |
|
|
|
menu_voice_select = MENU_VOICE_BANK; |
|
|
|
menu_voice_select = MENU_VOICE_BANK; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
strip_extension(bank_names[instance_id][configuration.performance.bank[instance_id]], bank_name[instance_id]); |
|
|
|
if (!get_bank_name(configuration.performance.bank[instance_id], bank_name, sizeof(bank_name))) |
|
|
|
|
|
|
|
strncpy(bank_name, "*ERROR*", sizeof(bank_name)); |
|
|
|
|
|
|
|
if (!get_voice_by_bank_name(configuration.performance.bank[instance_id], bank_name, configuration.performance.voice[instance_id], voice_name, sizeof(voice_name))) |
|
|
|
|
|
|
|
strncpy(voice_name, "*ERROR*", sizeof(voice_name)); |
|
|
|
|
|
|
|
|
|
|
|
lcd.show(0, 0, 2, configuration.performance.bank[instance_id]); |
|
|
|
lcd.show(0, 0, 2, configuration.performance.bank[instance_id]); |
|
|
|
lcd.show(1, 0, 2, configuration.performance.voice[instance_id] + 1); |
|
|
|
lcd.show(1, 0, 2, configuration.performance.voice[instance_id] + 1); |
|
|
|
lcd.show(0, 4, 10, bank_name[instance_id]); |
|
|
|
lcd.show(0, 4, 10, bank_name); |
|
|
|
lcd.show(1, 4, 10, voice_names[instance_id][configuration.performance.voice[instance_id]]); |
|
|
|
lcd.show(1, 4, 10, voice_name); |
|
|
|
|
|
|
|
|
|
|
|
switch (menu_voice_select) |
|
|
|
switch (menu_voice_select) |
|
|
|
{ |
|
|
|
{ |
|
|
|
case MENU_VOICE_BANK: |
|
|
|
case MENU_VOICE_BANK: |
|
|
|
lcd.show(0, 2, 2, " ["); |
|
|
|
lcd.show(0, 2, 2, " ["); |
|
|
|
lcd.show(0, 14, 1, "]"); |
|
|
|
lcd.show(0, 14, 1, "]"); |
|
|
|
lcd.show(1, 2, 2, " "); |
|
|
|
lcd.show(1, 2, 2, " "); |
|
|
|
lcd.show(1, 14, 1, " "); |
|
|
|
lcd.show(1, 14, 1, " "); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case MENU_VOICE_SOUND: |
|
|
|
case MENU_VOICE_SOUND: |
|
|
|
lcd.show(0, 2, 2, " "); |
|
|
|
lcd.show(0, 2, 2, " "); |
|
|
|
lcd.show(0, 14, 1, " "); |
|
|
|
lcd.show(0, 14, 1, " "); |
|
|
|
lcd.show(1, 2, 2, " ["); |
|
|
|
lcd.show(1, 2, 2, " ["); |
|
|
|
lcd.show(1, 14, 1, "]"); |
|
|
|
lcd.show(1, 14, 1, "]"); |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|