Added entry for chorus intensity.

master
Holger Wirtz 6 years ago
parent 02a60d10b1
commit 30086b42d6
  1. 115
      UI.hpp

115
UI.hpp

@ -23,21 +23,20 @@
*/
/* Don't forget to change in MAX_FUNCTIONS to 24 in ../libraries/LiquidMenu/src/LiquidMenu_config.h
/// Configures the number of available variables per line.
const uint8_t MAX_VARIABLES = 5; ///< @note Default: 5
/// Configures the number of available functions per line.
const uint8_t MAX_FUNCTIONS = 39; ///< @note Default: 8
const uint8_t MAX_FUNCTIONS = 40; ///< @note Default: 8
/// Configures the number of available lines per screen.
const uint8_t MAX_LINES = 19; ///< @note Default: 12
const uint8_t MAX_LINES = 20; ///< @note Default: 12
/// Configures the number of available screens per menu.
const uint8_t MAX_SCREENS = 14; ///< @note Default: 14
/// Configures the number of available menus per menus system.
const uint8_t MAX_MENUS = 42; ///< @note Default: 8
const uint8_t MAX_MENUS = 43; ///< @note Default: 8
*/
@ -91,20 +90,21 @@ elapsedMillis back_to_main;
#define REV_LEVEL 27
#define CHORUS_FREQ 28
#define CHORUS_DELAY 29
#define CHORUS_LEVEL 30
#define BASS_LR_LEVEL 31
#define BASS_MONO_LEVEL 32
#define EQ_BASS 33
#define EQ_TREBLE 34
#define CHORUS_INTENSITY 30
#define CHORUS_LEVEL 31
#define BASS_LR_LEVEL 32
#define BASS_MONO_LEVEL 33
#define EQ_BASS 34
#define EQ_TREBLE 35
/*************************************/
#define LOUDNESS 35
#define MIDI_CHANNEL 36
#define MIDI_SOFT_THRU 37
#define MAX_POLY 38
#define LOUDNESS 36
#define MIDI_CHANNEL 37
#define MIDI_SOFT_THRU 38
#define MAX_POLY 39
/*************************************/
#define STORE_QUESTION 39
#define STORE_QUESTION 40
/*************************************/
#define MASTER_VOLUME 40
#define MASTER_VOLUME 41
/*************************************/
int8_t menu_position[NUM_MENUS];
@ -403,7 +403,7 @@ LiquidMenu velocity_sense_menu(lcd);
/******************************************
EFFECTS MENU
******************************************/
#define NUM_EFFECTS_MENUS 19
#define NUM_EFFECTS_MENUS 20
const char effects_text1[] PROGMEM = "Pan/Trem Freq.";
const char effects_text2[] PROGMEM = "Pan/Trem Level";
const char effects_text3[] PROGMEM = "Overdrive";
@ -418,11 +418,12 @@ const char effects_text11[] PROGMEM = "Rev. Damping";
const char effects_text12[] PROGMEM = "Rev. Level";
const char effects_text13[] PROGMEM = "Chorus Freq.";
const char effects_text14[] PROGMEM = "Chorus Delay";
const char effects_text15[] PROGMEM = "Chorus Level";
const char effects_text16[] PROGMEM = "Bass LR Level";
const char effects_text17[] PROGMEM = "Bass M Level";
const char effects_text18[] PROGMEM = "EQ Bass";
const char effects_text19[] PROGMEM = "EQ Treble";
const char effects_text15[] PROGMEM = "Chorus Intensity";
const char effects_text16[] PROGMEM = "Chorus Level";
const char effects_text17[] PROGMEM = "Bass LR Level";
const char effects_text18[] PROGMEM = "Bass M Level";
const char effects_text19[] PROGMEM = "EQ Bass";
const char effects_text20[] PROGMEM = "EQ Treble";
LiquidLine effects_line1(1, 0, effects_text1);
LiquidLine effects_line2(1, 1, effects_text2);
LiquidLine effects_line3(1, 1, effects_text3);
@ -442,6 +443,7 @@ LiquidLine effects_line16(1, 1, effects_text16);
LiquidLine effects_line17(1, 1, effects_text17);
LiquidLine effects_line18(1, 1, effects_text18);
LiquidLine effects_line19(1, 1, effects_text19);
LiquidLine effects_line20(1, 1, effects_text20);
LiquidScreen effects_screen;
LiquidMenu effects_menu(lcd);
@ -591,6 +593,16 @@ LiquidLine chorus_delay_line2(1, 1, configuration.chorus_delay);
LiquidScreen chorus_delay_screen;
LiquidMenu chorus_delay_menu(lcd);
/******************************************
CHORUS_INTENSITY MENU
******************************************/
#define NUM_CHORUS_INTENSITY_MENUS 1
const char chorus_intensity_text1[] PROGMEM = "Chorus Intensity";
LiquidLine chorus_intensity_line1(1, 0, chorus_intensity_text1);
LiquidLine chorus_intensity_line2(1, 1, configuration.chorus_intensity);
LiquidScreen chorus_intensity_screen;
LiquidMenu chorus_intensity_menu(lcd);
/******************************************
CHORUS_LEVEL MENU
******************************************/
@ -1084,6 +1096,18 @@ void callback_chorus_delay_function(void)
menu_system.update();
}
void callback_chorus_intensity_function(void)
{
#ifdef DEBUG
Serial.println(F("callback_chorus_intensity_function"));
#endif
menu_system.change_menu(chorus_intensity_menu);
menu_position[EFFECTS] = encoder_value[RIGHT_ENCODER];
encoder_value[RIGHT_ENCODER] = configuration.chorus_intensity;
enc[RIGHT_ENCODER].write(configuration.chorus_intensity, ENC_CHORUS_INTENSITY_MIN, ENC_CHORUS_INTENSITY_MAX);
menu_system.update();
}
void callback_chorus_level_function(void)
{
#ifdef DEBUG
@ -1468,6 +1492,7 @@ void init_menus(void)
effects_screen.add_line(effects_line17);
effects_screen.add_line(effects_line18);
effects_screen.add_line(effects_line19);
effects_screen.add_line(effects_line20);
effects_screen.set_displayLineCount(2);
effects_menu.add_screen(effects_screen);
@ -1485,11 +1510,12 @@ void init_menus(void)
effects_line12.attach_function(REV_LEVEL, callback_reverb_level_function);
effects_line13.attach_function(CHORUS_FREQ, callback_chorus_frequency_function);
effects_line14.attach_function(CHORUS_DELAY, callback_chorus_delay_function);
effects_line15.attach_function(CHORUS_LEVEL, callback_chorus_level_function);
effects_line16.attach_function(BASS_LR_LEVEL, callback_bass_lr_level_function);
effects_line17.attach_function(BASS_MONO_LEVEL, callback_bass_mono_level_function);
effects_line18.attach_function(EQ_BASS, callback_eq_bass_function);
effects_line19.attach_function(EQ_TREBLE, callback_eq_treble_function);
effects_line15.attach_function(CHORUS_INTENSITY, callback_chorus_intensity_function);
effects_line16.attach_function(CHORUS_LEVEL, callback_chorus_level_function);
effects_line17.attach_function(BASS_LR_LEVEL, callback_bass_lr_level_function);
effects_line18.attach_function(BASS_MONO_LEVEL, callback_bass_mono_level_function);
effects_line19.attach_function(EQ_BASS, callback_eq_bass_function);
effects_line20.attach_function(EQ_TREBLE, callback_eq_treble_function);
// setup pan_trem_frequency menu
pan_trem_frequency_screen.add_line(pan_trem_frequency_line1);
@ -1575,6 +1601,12 @@ void init_menus(void)
chorus_delay_screen.set_displayLineCount(2);
chorus_delay_menu.add_screen(chorus_delay_screen);
// setup chorus_intensity menu
chorus_intensity_screen.add_line(chorus_intensity_line1);
chorus_intensity_screen.add_line(chorus_intensity_line2);
chorus_intensity_screen.set_displayLineCount(2);
chorus_intensity_menu.add_screen(chorus_intensity_screen);
// setup chorus_level menu
chorus_level_screen.add_line(chorus_level_line1);
chorus_level_screen.add_line(chorus_level_line2);
@ -1697,6 +1729,7 @@ void init_menus(void)
menu_system.add_menu(reverb_level_menu);
menu_system.add_menu(chorus_frequency_menu);
menu_system.add_menu(chorus_delay_menu);
menu_system.add_menu(chorus_intensity_menu);
menu_system.add_menu(chorus_level_menu);
menu_system.add_menu(bass_lr_level_menu);
menu_system.add_menu(bass_mono_level_menu);
@ -1992,8 +2025,6 @@ void set_chorus_frequency(uint8_t value)
Serial.print(F("Set CHORUS_FREQUENCY "));
Serial.println(value);
#endif
//float tmp = mapfloat(float(value), ENC_CHORUS_FREQUENCY_MIN, ENC_CHORUS_FREQUENCY_MAX, 0.0, 1.0);
// TDB
configuration.chorus_frequency = value;
}
@ -2003,11 +2034,18 @@ void set_chorus_delay(uint8_t value)
Serial.print(F("Set CHORUS_DELAY "));
Serial.println(value);
#endif
//float tmp = mapfloat(float(value), ENC_CHORUS_DELAY_MIN, ENC_CHORUS_DELAY_MAX, 0.0, 1.0);
// TDB
configuration.chorus_delay = value;
}
void set_chorus_intensity(uint8_t value)
{
#ifdef DEBUG
Serial.print(F("Set CHORUS_INTENSITY "));
Serial.println(value);
#endif
configuration.chorus_intensity = value;
}
void set_chorus_level(uint8_t value)
{
#ifdef DEBUG
@ -2132,6 +2170,7 @@ void set_complete_configuration(void)
set_reverb_level(configuration.reverb_level);
set_chorus_frequency(configuration.chorus_frequency);
set_chorus_delay(configuration.chorus_delay);
set_chorus_intensity(configuration.chorus_intensity);
set_chorus_level(configuration.chorus_level);
set_bass_lr_level(configuration.bass_lr_level);
set_bass_mono_level(configuration.bass_mono_level);
@ -2376,6 +2415,15 @@ void handle_ui(void)
menu_system.update();
}
}
else if (menu_system.get_currentScreen() == &chorus_intensity_screen)
{
if (encoder_tmp != encoder_value[RIGHT_ENCODER])
{
// value up/down
set_chorus_intensity(encoder_tmp);
menu_system.update();
}
}
else if (menu_system.get_currentScreen() == &chorus_delay_screen)
{
if (encoder_tmp != encoder_value[RIGHT_ENCODER])
@ -2813,6 +2861,13 @@ void handle_ui(void)
#endif
goto_effects_menu(CHORUS_DELAY);
}
else if (menu_system.get_currentScreen() == &chorus_intensity_screen) // chorus_intensity menu
{
#ifdef DEBUG
Serial.println(F("from chorus_intensity to effects"));
#endif
goto_effects_menu(CHORUS_INTENSITY);
}
else if (menu_system.get_currentScreen() == &chorus_level_screen) // chorus_level menu
{
#ifdef DEBUG

Loading…
Cancel
Save