@ -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 ) ;
@ -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,13 +3324,17 @@ 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 )
{
{
@ -3350,7 +3352,6 @@ void UI_func_voice_select(uint8_t param)
break ;
break ;
}
}
}
}
}
if ( LCDML . FUNC_close ( ) ) // ****** STABLE END *********
if ( LCDML . FUNC_close ( ) ) // ****** STABLE END *********
{
{