Fixes for non-FX version.

pull/32/head
Holger Wirtz 5 years ago
parent 47137419e2
commit af0fca3ff4
  1. 79
      UI.hpp
  2. 44
      UI_NO_FX.h

@ -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);
}
@ -1126,13 +1128,13 @@ 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_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);

@ -69,30 +69,24 @@ LCDML_add(40, LCDML_0_1, 6, "Internal", NULL);
LCDML_add(41, LCDML_0_1_6, 1, "Note Refresh", UI_func_note_refresh);
LCDML_add(42, LCDML_0_1_6, 2, "Velocity Lvl", UI_func_velocity_level);
LCDML_add(43, LCDML_0_1_6, 3, "Engine", UI_func_engine);
LCDML_add(44, LCDML_0_1, 7, "Operator", NULL);
LCDML_add(45, LCDML_0_1_7, 1, "OP1", UI_func_OP1);
LCDML_add(46, LCDML_0_1_7, 2, "OP2", UI_func_OP2);
LCDML_add(47, LCDML_0_1_7, 3, "OP3", UI_func_OP3);
LCDML_add(48, LCDML_0_1_7, 4, "OP4", UI_func_OP4);
LCDML_add(49, LCDML_0_1_7, 5, "OP5", UI_func_OP5);
LCDML_add(50, LCDML_0_1_7, 6, "OP6", UI_func_OP6);
LCDML_add(51, LCDML_0_1, 8, "Save Voice", UI_func_save_voice);
LCDML_add(52, LCDML_0, 2, "Load/Save", NULL);
LCDML_add(53, LCDML_0_2, 1, "Performance", NULL);
LCDML_add(54, LCDML_0_2_1, 1, "Load Perf.", UI_func_load_performance);
LCDML_add(55, LCDML_0_2_1, 2, "Save Perf.", UI_func_save_performance);
LCDML_add(56, LCDML_0_2, 2, "Voice Config", NULL);
LCDML_add(57, LCDML_0_2_2, 1, "Load Voice Cfg", UI_func_load_voiceconfig);
LCDML_add(58, LCDML_0_2_2, 2, "Save Voice Cfg", UI_func_save_voiceconfig);
LCDML_add(59, LCDML_0_2, 4, "MIDI", NULL);
LCDML_add(60, LCDML_0_2_4, 1, "MIDI Recv Bank", UI_func_sysex_receive_bank);
LCDML_add(61, LCDML_0_2_4, 2, "MIDI Send Bank", UI_func_sysex_send_bank);
LCDML_add(62, LCDML_0, 3, "System", NULL);
LCDML_add(63, LCDML_0_3, 1, "Volume", UI_func_volume);
LCDML_add(64, LCDML_0_3, 2, "Stereo/Mono", UI_func_stereo_mono);
LCDML_add(65, LCDML_0_3, 3, "MIDI Soft THRU", UI_func_midi_soft_thru);
LCDML_add(66, LCDML_0_3, 4, "EEPROM Reset", UI_func_eeprom_reset);
LCDML_add(67, LCDML_0, 4, "Info", UI_func_information);
#define _LCDML_DISP_cnt 67
LCDML_add(44, LCDML_0_1, 7, "Operator", UI_handle_OP);
LCDML_add(45, LCDML_0_1, 8, "Save Voice", UI_func_save_voice);
LCDML_add(46, LCDML_0, 2, "Load/Save", NULL);
LCDML_add(47, LCDML_0_2, 1, "Performance", NULL);
LCDML_add(48, LCDML_0_2_1, 1, "Load Perf.", UI_func_load_performance);
LCDML_add(49, LCDML_0_2_1, 2, "Save Perf.", UI_func_save_performance);
LCDML_add(50, LCDML_0_2, 2, "Voice Config", NULL);
LCDML_add(51, LCDML_0_2_2, 1, "Load Voice Cfg", UI_func_load_voiceconfig);
LCDML_add(52, LCDML_0_2_2, 2, "Save Voice Cfg", UI_func_save_voiceconfig);
LCDML_add(53, LCDML_0_2, 4, "MIDI", NULL);
LCDML_add(54, LCDML_0_2_4, 1, "MIDI Recv Bank", UI_func_sysex_receive_bank);
LCDML_add(55, LCDML_0_2_4, 2, "MIDI Send Bank", UI_func_sysex_send_bank);
LCDML_add(56, LCDML_0, 3, "System", NULL);
LCDML_add(57, LCDML_0_3, 1, "Volume", UI_func_volume);
LCDML_add(58, LCDML_0_3, 2, "Stereo/Mono", UI_func_stereo_mono);
LCDML_add(59, LCDML_0_3, 3, "MIDI Soft THRU", UI_func_midi_soft_thru);
LCDML_add(60, LCDML_0_3, 4, "EEPROM Reset", UI_func_eeprom_reset);
LCDML_add(61, LCDML_0, 4, "Info", UI_func_information);
#define _LCDML_DISP_cnt 61
#endif

Loading…
Cancel
Save