|
|
@ -266,6 +266,7 @@ void lcd_active_instance_number(uint8_t instance_id); |
|
|
|
void lcd_OP_active_instance_number(uint8_t instance_id, uint8_t op); |
|
|
|
void lcd_OP_active_instance_number(uint8_t instance_id, uint8_t op); |
|
|
|
void lcd_special_chars(uint8_t mode); |
|
|
|
void lcd_special_chars(uint8_t mode); |
|
|
|
void eeprom_update_var(uint16_t pos, uint8_t val, const char* val_string); |
|
|
|
void eeprom_update_var(uint16_t pos, uint8_t val, const char* val_string); |
|
|
|
|
|
|
|
void string_trim(char *s); |
|
|
|
|
|
|
|
|
|
|
|
// normal menu
|
|
|
|
// normal menu
|
|
|
|
LCDMenuLib2_menu LCDML_0(255, 0, 0, NULL, NULL); // normal root menu element (do not change)
|
|
|
|
LCDMenuLib2_menu LCDML_0(255, 0, 0, NULL, NULL); // normal root menu element (do not change)
|
|
|
@ -4693,13 +4694,14 @@ void UI_func_sysex_receive_bank(uint8_t param) |
|
|
|
yesno = false; |
|
|
|
yesno = false; |
|
|
|
mode = 0; |
|
|
|
mode = 0; |
|
|
|
bank_number = configuration.performance.bank[selected_instance_id]; |
|
|
|
bank_number = configuration.performance.bank[selected_instance_id]; |
|
|
|
|
|
|
|
memset(receive_bank_filename, 0, sizeof(receive_bank_filename)); |
|
|
|
|
|
|
|
|
|
|
|
lcd.setCursor(0, 0); |
|
|
|
lcd.setCursor(0, 0); |
|
|
|
lcd.print(F("MIDI Recv Bank")); |
|
|
|
lcd.print(F("MIDI Recv Bank")); |
|
|
|
lcd.setCursor(0, 1); |
|
|
|
lcd.setCursor(0, 1); |
|
|
|
lcd.print(F("[ ]")); |
|
|
|
lcd.print(F("[ ]")); |
|
|
|
if (!get_bank_name(configuration.performance.bank[selected_instance_id], receive_bank_filename, sizeof(receive_bank_filename))) |
|
|
|
if (!get_bank_name(configuration.performance.bank[selected_instance_id], receive_bank_filename, sizeof(receive_bank_filename))) |
|
|
|
strncpy(receive_bank_filename, "*ERROR*", sizeof(receive_bank_filename)); |
|
|
|
strncpy(receive_bank_filename, "*ERROR*", 7); |
|
|
|
lcd.show(1, 1, 2, bank_number); |
|
|
|
lcd.show(1, 1, 2, bank_number); |
|
|
|
lcd.show(1, 5, 10, receive_bank_filename); |
|
|
|
lcd.show(1, 5, 10, receive_bank_filename); |
|
|
|
} |
|
|
|
} |
|
|
@ -4715,7 +4717,7 @@ void UI_func_sysex_receive_bank(uint8_t param) |
|
|
|
case 0: |
|
|
|
case 0: |
|
|
|
bank_number = constrain(bank_number + ENCODER[ENC_R].speed(), 0, MAX_BANKS - 1); |
|
|
|
bank_number = constrain(bank_number + ENCODER[ENC_R].speed(), 0, MAX_BANKS - 1); |
|
|
|
if (!get_bank_name(bank_number, receive_bank_filename, sizeof(receive_bank_filename))) |
|
|
|
if (!get_bank_name(bank_number, receive_bank_filename, sizeof(receive_bank_filename))) |
|
|
|
strncpy(receive_bank_filename, "*ERROR*", sizeof(receive_bank_filename)); |
|
|
|
strncpy(receive_bank_filename, "*ERROR*", 7); |
|
|
|
lcd.show(1, 1, 2, bank_number); |
|
|
|
lcd.show(1, 1, 2, bank_number); |
|
|
|
lcd.show(1, 5, 10, receive_bank_filename); |
|
|
|
lcd.show(1, 5, 10, receive_bank_filename); |
|
|
|
break; |
|
|
|
break; |
|
|
@ -4762,7 +4764,7 @@ void UI_func_sysex_receive_bank(uint8_t param) |
|
|
|
if (!strncmp(receive_bank_filename, "*ERROR*", sizeof(receive_bank_filename))) |
|
|
|
if (!strncmp(receive_bank_filename, "*ERROR*", sizeof(receive_bank_filename))) |
|
|
|
{ |
|
|
|
{ |
|
|
|
yesno = true; |
|
|
|
yesno = true; |
|
|
|
strncpy(receive_bank_filename, "EMPTY", BANK_NAME_LEN); |
|
|
|
strncpy(receive_bank_filename, "NONAME", 6); |
|
|
|
mode += 2; |
|
|
|
mode += 2; |
|
|
|
lcd.blink(); |
|
|
|
lcd.blink(); |
|
|
|
} |
|
|
|
} |
|
|
@ -4788,8 +4790,22 @@ void UI_func_sysex_receive_bank(uint8_t param) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (yesno == true) |
|
|
|
if (yesno == true) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
#ifdef DEBUG |
|
|
|
|
|
|
|
Serial.print(F("Bank name: [")); |
|
|
|
|
|
|
|
Serial.print(receive_bank_filename); |
|
|
|
|
|
|
|
Serial.println(F("]")); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
char tmp[FILENAME_LEN]; |
|
|
|
|
|
|
|
strncpy(tmp, receive_bank_filename, strlen(receive_bank_filename)); |
|
|
|
|
|
|
|
sprintf(receive_bank_filename, "/%d/%s.syx", bank_number, tmp); |
|
|
|
|
|
|
|
#ifdef DEBUG |
|
|
|
|
|
|
|
Serial.print(F("Receiving into bank ")); |
|
|
|
|
|
|
|
Serial.print(bank_number); |
|
|
|
|
|
|
|
Serial.print(F(" as filename ")); |
|
|
|
|
|
|
|
Serial.print(receive_bank_filename); |
|
|
|
|
|
|
|
Serial.println(F(".")); |
|
|
|
|
|
|
|
#endif |
|
|
|
mode = 0xff; |
|
|
|
mode = 0xff; |
|
|
|
|
|
|
|
|
|
|
|
lcd.noBlink(); |
|
|
|
lcd.noBlink(); |
|
|
|
lcd.setCursor(0, 1); |
|
|
|
lcd.setCursor(0, 1); |
|
|
|
lcd.print(F("Waiting... ")); |
|
|
|
lcd.print(F("Waiting... ")); |
|
|
@ -5133,6 +5149,8 @@ bool UI_select_name(uint8_t y, uint8_t x, char* edit_string, uint8_t len, bool i |
|
|
|
{ |
|
|
|
{ |
|
|
|
edit_pos = 0; |
|
|
|
edit_pos = 0; |
|
|
|
edit_mode = false; |
|
|
|
edit_mode = false; |
|
|
|
|
|
|
|
string_trim(edit_string); |
|
|
|
|
|
|
|
|
|
|
|
return (true); |
|
|
|
return (true); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
@ -5467,5 +5485,14 @@ void eeprom_update_var(uint16_t pos, uint8_t val, const char* val_string) |
|
|
|
EEPROM.update(EEPROM_START_ADDRESS + pos, val); |
|
|
|
EEPROM.update(EEPROM_START_ADDRESS + pos, val); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void string_trim(char *s) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
int i; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while (isspace (*s)) s++; // skip left side white spaces
|
|
|
|
|
|
|
|
for (i = strlen (s) - 1; (isspace (s[i])); i--) ; // skip right side white spaces
|
|
|
|
|
|
|
|
s[i + 1] = '\0'; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#endif |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
#endif |
|
|
|