From c98c929cf53a0d721d486c7d8014b5aa2da65719 Mon Sep 17 00:00:00 2001 From: Holger Wirtz Date: Tue, 21 May 2019 10:22:12 +0200 Subject: [PATCH] Fixing tune menu entry text. Small fixes. --- UI.hpp | 28 +++++++++++++++------------- config.h | 2 +- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/UI.hpp b/UI.hpp index a2b6094..be97142 100644 --- a/UI.hpp +++ b/UI.hpp @@ -109,7 +109,6 @@ extern float _loudness; const char comp_gain_value_text1[] PROGMEM = " 0 dB"; const char comp_gain_value_text2[] PROGMEM = "+ 6 dB"; const char comp_gain_value_text3[] PROGMEM = "+12 dB"; - char* get_comp_gain_value_text(void) { switch (configuration.comp_gain) @@ -131,7 +130,6 @@ const char comp_response_value_text1[] PROGMEM = " 0 ms"; const char comp_response_value_text2[] PROGMEM = " 25 ms"; const char comp_response_value_text3[] PROGMEM = " 50 ms"; const char comp_response_value_text4[] PROGMEM = "100 ms"; - char* get_comp_response_value_text(void) { switch (configuration.comp_response) @@ -154,7 +152,6 @@ char* get_comp_response_value_text(void) const char comp_limit_value_text1[] PROGMEM = "soft Knee"; const char comp_limit_value_text2[] PROGMEM = "hard Knee"; - char* get_comp_limit_value_text(void) { switch (configuration.comp_limit) @@ -170,7 +167,6 @@ char* get_comp_limit_value_text(void) } char comp_threshold_value_text1[] = " "; - char* get_comp_threshold_value_text(void) { if (configuration.comp_threshold == 0) @@ -182,23 +178,28 @@ char* get_comp_threshold_value_text(void) } char comp_attack_value_text1[] = " "; - char* get_comp_attack_value_text(void) { - sprintf(comp_attack_value_text1, "%0d dB/s", configuration.comp_attack); + sprintf(comp_attack_value_text1, "%0.1f dB/s", (float)configuration.comp_attack / 10); return (comp_attack_value_text1); } char comp_decay_value_text1[] = " "; - char* get_comp_decay_value_text(void) { - sprintf(comp_decay_value_text1, "%0d dB/s", configuration.comp_decay); + sprintf(comp_decay_value_text1, "%0.1f dB/s", (float)configuration.comp_decay / 10); return (comp_decay_value_text1); } +char tune_value_text1[] = " "; +char* get_tune_value_text(void) +{ + sprintf(tune_value_text1, "%3d cent", configuration.tune); + + return (tune_value_text1); +} /****************************************** MAIN MENU ******************************************/ @@ -319,7 +320,8 @@ LiquidMenu transpose_menu(lcd); #define NUM_TUNE_MENUS 1 const char tune_text1[] PROGMEM = "Tune"; LiquidLine tune_line1(1, 0, tune_text1); -LiquidLine tune_line2(1, 1, configuration.tune); +//LiquidLine tune_line2(1, 1, configuration.tune); +LiquidLine tune_line2(1, 1, get_tune_value_text); LiquidScreen tune_screen; LiquidMenu tune_menu(lcd); @@ -518,7 +520,7 @@ LiquidMenu reverb_level_menu(lcd); CHORUS_FREQUENCY MENU ******************************************/ #define NUM_CHORUS_FREQUENCY_MENUS 1 -const char chorus_frequency_text1[] PROGMEM = "Chorus Frequency"; +const char chorus_frequency_text1[] PROGMEM = "Chorus Freq."; LiquidLine chorus_frequency_line1(1, 0, chorus_frequency_text1); LiquidLine chorus_frequency_line2(1, 1, configuration.chorus_frequency); LiquidScreen chorus_frequency_screen; @@ -1487,7 +1489,7 @@ void init_menus(void) chorus_level_screen.add_line(chorus_level_line2); chorus_level_screen.set_displayLineCount(2); chorus_level_menu.add_screen(chorus_level_screen); - + // setup bass_lr_level menu bass_lr_level_screen.add_line(bass_lr_level_line1); bass_lr_level_screen.add_line(bass_lr_level_line2); @@ -1826,7 +1828,7 @@ void set_comp_attack(uint8_t value) Serial.println(value); #endif //float tmp = mapfloat(float(value), ENC_COMP_ATTACK_MIN, ENC_COMP_ATTACK_MAX, 0.0, 1.0); - sgtl5000_1.autoVolumeControl(configuration.comp_gain, configuration.comp_response, configuration.comp_limit, (float)configuration.comp_threshold, (float)value, (float)configuration.comp_decay); // maxGain, response, hardLimit, threshold, attack, decay, e.g.: 1, 1, 1, 0.9, 0.01, 0.05 + sgtl5000_1.autoVolumeControl(configuration.comp_gain, configuration.comp_response, configuration.comp_limit, (float)configuration.comp_threshold, (float)value / 10, (float)configuration.comp_decay); // maxGain, response, hardLimit, threshold, attack, decay, e.g.: 1, 1, 1, 0.9, 0.01, 0.05 configuration.comp_attack = value; } @@ -1837,7 +1839,7 @@ void set_comp_decay(uint8_t value) Serial.println(value); #endif //float tmp = mapfloat(float(value), ENC_COMP_DECAY_MIN, ENC_COMP_DECAY_MAX, 0.0, 1.0); - sgtl5000_1.autoVolumeControl(configuration.comp_gain, configuration.comp_response, configuration.comp_limit, (float)configuration.comp_threshold, (float)configuration.comp_attack, (float)value); // maxGain, response, hardLimit, threshold, attack, decay, e.g.: 1, 1, 1, 0.9, 0.01, 0.05 + sgtl5000_1.autoVolumeControl(configuration.comp_gain, configuration.comp_response, configuration.comp_limit, (float)configuration.comp_threshold, (float)configuration.comp_attack, (float)value / 10); // maxGain, response, hardLimit, threshold, attack, decay, e.g.: 1, 1, 1, 0.9, 0.01, 0.05 configuration.comp_decay = value; } diff --git a/config.h b/config.h index e20e4b3..cfeba86 100644 --- a/config.h +++ b/config.h @@ -97,7 +97,7 @@ 30: 1.22 Volts p-p 31: 1.16 Volts p-p */ -#define SGTL5000_LINEOUT_LEVEL 24 +#define SGTL5000_LINEOUT_LEVEL 28 //#define SDCARD_CS_PIN 10 //#define SDCARD_MOSI_PIN 7 //#define SDCARD_SCK_PIN 14