|
|
|
@ -251,7 +251,9 @@ void UI_function_not_implemented(uint8_t param); |
|
|
|
|
void lcd_display_int(int16_t var, uint8_t size, bool zeros, bool brackets, bool sign); |
|
|
|
|
void lcd_display_float(float var, uint8_t size_number, uint8_t size_fraction, bool zeros, bool brackets, bool sign); |
|
|
|
|
void lcd_display_bar_int(const char* title, uint32_t value, float factor, int32_t min_value, int32_t max_value, uint8_t size, bool zeros, bool brackets, bool sign, bool init); |
|
|
|
|
void lcd_display_bar_int_new(const char* title, uint32_t value, float factor, int32_t min_value, int32_t max_value, uint8_t size, bool zeros, bool sign, bool init); |
|
|
|
|
void lcd_display_bar_float(const char* title, float value, float factor, int32_t min_value, int32_t max_value, uint8_t size_number, uint8_t size_fraction, bool zeros, bool brackets, bool sign, bool init); |
|
|
|
|
void lcd_display_bar_float_new(const char* title, float value, float factor, int32_t min_value, int32_t max_value, uint8_t size_number, uint8_t size_fraction, bool zeros, bool sign, bool init); |
|
|
|
|
void lcd_display_meter_int(const char* title, uint32_t value, float factor, float offset, int32_t min_value, int32_t max_value, uint8_t size, bool zeros, bool brackets, bool sign, bool init); |
|
|
|
|
void lcd_display_meter_float(const char* title, float value, float factor, float offset, int32_t min_value, int32_t max_value, uint8_t size_number, uint8_t size_fraction, bool zeros, bool brackets, bool sign, bool init); |
|
|
|
|
void lcd_active_instance_number(uint8_t instance_id); |
|
|
|
@ -1007,13 +1009,13 @@ void UI_func_chorus_frequency(uint8_t param) |
|
|
|
|
encoderDir[ENC_R].reset(); |
|
|
|
|
|
|
|
|
|
lcd_special_chars(BLOCKBAR); |
|
|
|
|
lcd_display_bar_float("Chorus Frq.", configuration.fx.chorus_frequency[selected_instance_id], 0.1, CHORUS_FREQUENCY_MIN, CHORUS_FREQUENCY_MAX, 2, 1, false, false, false, true); |
|
|
|
|
lcd_display_bar_float_new("Chorus Frq.", configuration.fx.chorus_frequency[selected_instance_id], 0.1, CHORUS_FREQUENCY_MIN, CHORUS_FREQUENCY_MAX, 2, 1, false, false, true); |
|
|
|
|
|
|
|
|
|
#if NUM_DEXED > 1 |
|
|
|
|
lcd_active_instance_number(selected_instance_id); |
|
|
|
|
lcd.setCursor(15, 0); |
|
|
|
|
lcd.setCursor(14, 0); |
|
|
|
|
lcd.write(0); |
|
|
|
|
lcd.setCursor(15, 1); |
|
|
|
|
lcd.setCursor(15, 0); |
|
|
|
|
lcd.write(1); |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
@ -1032,14 +1034,14 @@ void UI_func_chorus_frequency(uint8_t param) |
|
|
|
|
{ |
|
|
|
|
selected_instance_id = !selected_instance_id; |
|
|
|
|
lcd_active_instance_number(selected_instance_id); |
|
|
|
|
lcd.setCursor(15, 0); |
|
|
|
|
lcd.setCursor(14, 0); |
|
|
|
|
lcd.write(0); |
|
|
|
|
lcd.setCursor(15, 1); |
|
|
|
|
lcd.setCursor(15, 0); |
|
|
|
|
lcd.write(1); |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
lcd_display_bar_float("Chorus Frq.", configuration.fx.chorus_frequency[selected_instance_id], 0.1, CHORUS_FREQUENCY_MIN, CHORUS_FREQUENCY_MAX, 2, 1, false, false, false, false); |
|
|
|
|
lcd_display_bar_float_new("Chorus Frq.", configuration.fx.chorus_frequency[selected_instance_id], 0.1, CHORUS_FREQUENCY_MIN, CHORUS_FREQUENCY_MAX, 2, 1, false, false, false); |
|
|
|
|
|
|
|
|
|
chorus_modulator[selected_instance_id]->frequency(configuration.fx.chorus_frequency[selected_instance_id] / 10.0); |
|
|
|
|
} |
|
|
|
@ -1125,14 +1127,14 @@ void UI_func_chorus_depth(uint8_t param) |
|
|
|
|
{ |
|
|
|
|
encoderDir[ENC_R].reset(); |
|
|
|
|
|
|
|
|
|
lcd_special_chars(BLOCKBAR); |
|
|
|
|
lcd_display_bar_int("Chorus Dpt.", configuration.fx.chorus_depth[selected_instance_id], 1.0, CHORUS_DEPTH_MIN, CHORUS_DEPTH_MAX, 3, false, false, false, true); |
|
|
|
|
lcd_special_chars(BLOCKBAR);
|
|
|
|
|
lcd_display_bar_int_new("Chorus Dpt.", configuration.fx.chorus_depth[selected_instance_id], 1.0, CHORUS_DEPTH_MIN, CHORUS_DEPTH_MAX, 3, false, false, true); |
|
|
|
|
|
|
|
|
|
#if NUM_DEXED > 1 |
|
|
|
|
lcd_active_instance_number(selected_instance_id); |
|
|
|
|
lcd.setCursor(15, 0); |
|
|
|
|
lcd.setCursor(14, 0); |
|
|
|
|
lcd.write(0); |
|
|
|
|
lcd.setCursor(15, 1); |
|
|
|
|
lcd.setCursor(15, 0); |
|
|
|
|
lcd.write(1); |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
@ -1150,15 +1152,15 @@ void UI_func_chorus_depth(uint8_t param) |
|
|
|
|
{ |
|
|
|
|
selected_instance_id = !selected_instance_id; |
|
|
|
|
lcd_active_instance_number(selected_instance_id); |
|
|
|
|
lcd.setCursor(15, 0); |
|
|
|
|
lcd.setCursor(14, 0); |
|
|
|
|
lcd.write(0); |
|
|
|
|
lcd.setCursor(15, 1); |
|
|
|
|
lcd.setCursor(15, 0); |
|
|
|
|
lcd.write(1); |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
lcd_display_bar_int("Chorus Dpt.", configuration.fx.chorus_depth[selected_instance_id], 1.0, CHORUS_DEPTH_MIN, CHORUS_DEPTH_MAX, 3, false, false, false, false); |
|
|
|
|
lcd_display_bar_int_new("Chorus Dpt.", configuration.fx.chorus_depth[selected_instance_id], 1.0, CHORUS_DEPTH_MIN, CHORUS_DEPTH_MAX, 3, false, false, false); |
|
|
|
|
|
|
|
|
|
chorus_modulator[selected_instance_id]->amplitude(configuration.fx.chorus_depth[selected_instance_id] / 100.0); |
|
|
|
|
} |
|
|
|
@ -5003,6 +5005,11 @@ inline void lcd_display_bar_int(const char* title, uint32_t value, float factor, |
|
|
|
|
lcd_display_bar_float(title, float(value), factor, min_value, max_value, size, 0, zeros, brackets, sign, init); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
inline void lcd_display_bar_int_new(const char* title, uint32_t value, float factor, int32_t min_value, int32_t max_value, uint8_t size, bool zeros, bool sign, bool init) |
|
|
|
|
{ |
|
|
|
|
lcd_display_bar_float_new(title, float(value), factor, min_value, max_value, size, 0, zeros, sign, init); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void lcd_display_bar_float(const char* title, float value, float factor, int32_t min_value, int32_t max_value, uint8_t size_number, uint8_t size_fraction, bool zeros, bool brackets, bool sign, bool init) |
|
|
|
|
{ |
|
|
|
|
uint8_t size = 0; |
|
|
|
@ -5066,6 +5073,54 @@ void lcd_display_bar_float(const char* title, float value, float factor, int32_t |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void lcd_display_bar_float_new(const char* title, float value, float factor, int32_t min_value, int32_t max_value, uint8_t size_number, uint8_t size_fraction, bool zeros, bool sign, bool init) |
|
|
|
|
{ |
|
|
|
|
uint8_t size; |
|
|
|
|
float v; |
|
|
|
|
float _vi = 0.0; |
|
|
|
|
uint8_t vf; |
|
|
|
|
uint8_t vi; |
|
|
|
|
|
|
|
|
|
if (size_fraction == 0) |
|
|
|
|
size = size_number; |
|
|
|
|
else |
|
|
|
|
size = size_number + size_fraction + 1; |
|
|
|
|
|
|
|
|
|
v = float((value - min_value) * (LCD_cols - size)) / (max_value - min_value); |
|
|
|
|
vf = uint8_t(modff(v, &_vi) * 10.0 + 0.5); |
|
|
|
|
vi = uint8_t(_vi); |
|
|
|
|
|
|
|
|
|
if (sign == true) |
|
|
|
|
size += 1; |
|
|
|
|
|
|
|
|
|
// Title
|
|
|
|
|
if (init == true) |
|
|
|
|
lcd.show(0, 0, LCD_cols - 3, title); |
|
|
|
|
|
|
|
|
|
// Value
|
|
|
|
|
lcd.setCursor(LCD_cols - size, 1); |
|
|
|
|
lcd_display_float(value * factor, size_number, size_fraction, zeros, false, sign); // TBD
|
|
|
|
|
|
|
|
|
|
// Bar
|
|
|
|
|
lcd.setCursor(0, 1); |
|
|
|
|
|
|
|
|
|
if (vi == 0) |
|
|
|
|
{ |
|
|
|
|
lcd.write((uint8_t)(vf / 2.0 - 0.5) + 2); |
|
|
|
|
for (uint8_t i = vi + 1; i < LCD_cols - size; i++) |
|
|
|
|
lcd.print(F(" ")); // empty block
|
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
for (uint8_t i = 0; i < vi; i++) |
|
|
|
|
lcd.write((uint8_t)4 + 2); // full block
|
|
|
|
|
if (vi < LCD_cols - size) |
|
|
|
|
lcd.write((uint8_t)(vf / 2.0 - 0.5) + 2); |
|
|
|
|
for (uint8_t i = vi + 1; i < LCD_cols - size; i++) |
|
|
|
|
lcd.print(F(" ")); // empty block
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
inline void lcd_display_meter_int(const char* title, uint32_t value, float factor, float offset, int32_t min_value, int32_t max_value, uint8_t size, bool zeros, bool brackets, bool sign, bool init) |
|
|
|
|
{ |
|
|
|
|
lcd_display_meter_float(title, float(value), factor, offset, min_value, max_value, size, 0, zeros, brackets, sign, init); |
|
|
|
|