|
|
|
@ -87,6 +87,7 @@ extern AudioSourceMicroDexed* MicroDexed[NUM_DEXED]; |
|
|
|
|
extern AudioEffectMonoStereo* mono2stereo[NUM_DEXED]; |
|
|
|
|
extern AudioSynthWaveformDc* pan[NUM_DEXED]; |
|
|
|
|
extern uint8_t selected_dexed_instance; |
|
|
|
|
extern uint8_t sgtl5000_level; |
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
|
GLOBAL |
|
|
|
@ -198,6 +199,9 @@ void UI_func_volume(uint8_t param); |
|
|
|
|
void UI_func_load(uint8_t param); |
|
|
|
|
void UI_func_save(uint8_t param); |
|
|
|
|
void UI_func_midi_soft_thru(uint8_t param); |
|
|
|
|
#if defined(TEENSY_AUDIO_BOARD) |
|
|
|
|
void UI_func_output_level(uint8_t param); |
|
|
|
|
#endif |
|
|
|
|
void UI_function_not_enabled(void); |
|
|
|
|
void UI_function_not_implemented(uint8_t param); |
|
|
|
|
void lcd_display_int(int16_t var, uint8_t size, bool zeros, bool brackets, bool sign); |
|
|
|
@ -309,7 +313,7 @@ void lcdml_menu_control(void) |
|
|
|
|
{ |
|
|
|
|
if (!button[ENC_R]) |
|
|
|
|
{ |
|
|
|
|
LCDML.BT_left(); |
|
|
|
|
LCDML.BT_right(); |
|
|
|
|
g_LCDML_CONTROL_button_prev[ENC_R] = LOW; |
|
|
|
|
g_LCDML_CONTROL_button_press_time[ENC_R] = -1; |
|
|
|
|
} |
|
|
|
@ -336,12 +340,12 @@ void lcdml_menu_control(void) |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
if (!button[ENC_R] && g_LCDML_CONTROL_button_prev[ENC_R]) //falling edge, button[ENC_R] pressed
|
|
|
|
|
if (!button[ENC_R] && g_LCDML_CONTROL_button_prev[ENC_R]) // falling edge, button[ENC_R] pressed
|
|
|
|
|
{ |
|
|
|
|
g_LCDML_CONTROL_button_prev[ENC_R] = LOW; |
|
|
|
|
g_LCDML_CONTROL_button_press_time[ENC_R] = millis(); |
|
|
|
|
} |
|
|
|
|
else if (button[ENC_R] && !g_LCDML_CONTROL_button_prev[ENC_R]) //rising edge, button[ENC_R] not active
|
|
|
|
|
else if (button[ENC_R] && !g_LCDML_CONTROL_button_prev[ENC_R]) // rising edge, button[ENC_R] not active
|
|
|
|
|
{ |
|
|
|
|
g_LCDML_CONTROL_button_prev[ENC_R] = HIGH; |
|
|
|
|
|
|
|
|
@ -392,12 +396,12 @@ void lcdml_menu_control(void) |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
if (!button[ENC_L] && g_LCDML_CONTROL_button_prev[ENC_L]) //falling edge, button[ENC_L] pressed
|
|
|
|
|
if (!button[ENC_L] && g_LCDML_CONTROL_button_prev[ENC_L]) // falling edge, button[ENC_L] pressed
|
|
|
|
|
{ |
|
|
|
|
g_LCDML_CONTROL_button_prev[ENC_L] = LOW; |
|
|
|
|
g_LCDML_CONTROL_button_press_time[ENC_L] = millis(); |
|
|
|
|
} |
|
|
|
|
else if (button[ENC_L] && !g_LCDML_CONTROL_button_prev[ENC_L]) //rising edge, button[ENC_L] not active
|
|
|
|
|
else if (button[ENC_L] && !g_LCDML_CONTROL_button_prev[ENC_L]) // rising edge, button[ENC_L] not active
|
|
|
|
|
{ |
|
|
|
|
g_LCDML_CONTROL_button_prev[ENC_L] = HIGH; |
|
|
|
|
|
|
|
|
@ -439,7 +443,7 @@ void encoder_right_up(void) |
|
|
|
|
break; |
|
|
|
|
case MENU_VOICE: |
|
|
|
|
#ifdef DEBUG |
|
|
|
|
Serial.println(F("State: MENU_VOICE, Encoder left up")); |
|
|
|
|
Serial.println(F("State: MENU_VOICE, Encoder right up")); |
|
|
|
|
#endif |
|
|
|
|
switch (menu_voice) |
|
|
|
|
{ |
|
|
|
@ -500,7 +504,7 @@ void encoder_right_down(void) |
|
|
|
|
break; |
|
|
|
|
case MENU_VOICE: |
|
|
|
|
#ifdef DEBUG |
|
|
|
|
Serial.println(F("State: MENU_VOICE, Encoder left down")); |
|
|
|
|
Serial.println(F("State: MENU_VOICE, Encoder right down")); |
|
|
|
|
#endif |
|
|
|
|
switch (menu_voice) |
|
|
|
|
{ |
|
|
|
@ -2983,6 +2987,54 @@ void UI_func_midi_soft_thru(uint8_t param) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#if defined(TEENSY_AUDIO_BOARD) |
|
|
|
|
void UI_func_output_level(uint8_t param) |
|
|
|
|
{ |
|
|
|
|
if (LCDML.FUNC_setup()) // ****** SETUP *********
|
|
|
|
|
{ |
|
|
|
|
// setup function
|
|
|
|
|
sgtl5000_level = EEPROM[4095]; |
|
|
|
|
lcd_special_chars(BLOCKBAR); |
|
|
|
|
lcd_display_bar_int("Output Level", sgtl5000_level, SGTL5000_LINEOUT_LEVEL_MIN, SGTL5000_LINEOUT_LEVEL_MAX, 2, false, false, false, true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (LCDML.FUNC_loop()) // ****** LOOP *********
|
|
|
|
|
{ |
|
|
|
|
if (LCDML.BT_checkEnter()) |
|
|
|
|
{ |
|
|
|
|
LCDML.FUNC_goBackToMenu(); |
|
|
|
|
} |
|
|
|
|
else if (LCDML.BT_checkDown() || LCDML.BT_checkUp()) |
|
|
|
|
{ |
|
|
|
|
if (LCDML.BT_checkDown()) |
|
|
|
|
{ |
|
|
|
|
if (sgtl5000_level < SGTL5000_LINEOUT_LEVEL_MAX) |
|
|
|
|
{ |
|
|
|
|
sgtl5000_level += 1; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else if (LCDML.BT_checkUp()) |
|
|
|
|
{ |
|
|
|
|
if (sgtl5000_level > SGTL5000_LINEOUT_LEVEL_MIN) |
|
|
|
|
{ |
|
|
|
|
sgtl5000_level -= 1; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
sgtl5000_1.lineOutLevel(sgtl5000_level); |
|
|
|
|
lcd_display_bar_int("Output Level", sgtl5000_level, SGTL5000_LINEOUT_LEVEL_MIN, SGTL5000_LINEOUT_LEVEL_MAX, 2, false, false, false, false); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (LCDML.FUNC_close()) // ****** STABLE END *********
|
|
|
|
|
{ |
|
|
|
|
// you can here reset some global vars or do nothing
|
|
|
|
|
lcd_special_chars(SCROLLBAR); |
|
|
|
|
EEPROM[4095] = sgtl5000_level; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
void UI_func_voice_selection(uint8_t param) |
|
|
|
|
{ |
|
|
|
|
#ifdef DEBUG |
|
|
|
@ -3306,7 +3358,7 @@ void lcd_display_float(float var, uint8_t size_number, uint8_t size_fraction, bo |
|
|
|
|
|
|
|
|
|
void lcd_display_bar_int(const char* title, uint32_t value, uint32_t min_value, uint32_t max_value, uint8_t size, bool zeros, bool brackets, bool sign, bool init) |
|
|
|
|
{ |
|
|
|
|
float _v = float(value * LCD_cols) / (max_value - min_value); |
|
|
|
|
float _v = float((value - min_value) * LCD_cols) / (max_value - min_value); |
|
|
|
|
float _vi = 0.0; |
|
|
|
|
uint8_t vf = uint8_t(modff(_v, &_vi) * 10.0 + 0.5); |
|
|
|
|
uint8_t vi = uint8_t(_vi + 0.5); |
|
|
|
@ -3337,7 +3389,7 @@ void lcd_display_bar_int(const char* title, uint32_t value, uint32_t min_value, |
|
|
|
|
|
|
|
|
|
if (vf > 1) |
|
|
|
|
{ |
|
|
|
|
lcd.setCursor(vi, 1); |
|
|
|
|
lcd.setCursor(vi , 1); |
|
|
|
|
lcd.write((uint8_t)int(vf / 2) - 1); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -3345,7 +3397,7 @@ void lcd_display_bar_int(const char* title, uint32_t value, uint32_t min_value, |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
// show only changed value and changed part of the bar
|
|
|
|
|
uint8_t ca = float(LCD_cols - 1) / float(max_value - min_value) + 1; |
|
|
|
|
uint8_t ca = float(LCD_cols - 1) / float(max_value) + 1; |
|
|
|
|
|
|
|
|
|
lcd.setCursor(LCD_cols - (size + 1) + 1, 0); |
|
|
|
|
lcd_display_int(value, size, zeros, brackets, sign); |
|
|
|
|