Added string getter function as a test for comp_gain.

dev
Holger Wirtz 6 years ago
parent 223a7eb3d2
commit ef896b75be
  1. 1
      MicroMDAEPiano.ino
  2. 33
      UI.hpp
  3. 23
      config.h

@ -179,6 +179,7 @@ void setup()
sgtl5000_1.dacVolume(1.0); sgtl5000_1.dacVolume(1.0);
//sgtl5000_1.dacVolumeRampLinear(); //sgtl5000_1.dacVolumeRampLinear();
sgtl5000_1.unmuteHeadphone(); sgtl5000_1.unmuteHeadphone();
sgtl5000_1.volume(0.5, 0.5); // Headphone volume
sgtl5000_1.unmuteLineout(); sgtl5000_1.unmuteLineout();
//sgtl5000_1.autoVolumeDisable(); // turn off AGC //sgtl5000_1.autoVolumeDisable(); // turn off AGC
sgtl5000_1.lineOutLevel(SGTL5000_LINEOUT_LEVEL); sgtl5000_1.lineOutLevel(SGTL5000_LINEOUT_LEVEL);

@ -102,6 +102,29 @@ extern AudioMixer4 mixer_l;
extern AudioAmplifier volume_r; extern AudioAmplifier volume_r;
extern AudioAmplifier volume_l; extern AudioAmplifier volume_l;
/******************************************
TEXT GETTER FUCTIONS
******************************************/
const char comp_gain_value_text1[] = " 0 dB";
const char comp_gain_value_text2[] = "+ 6 dB";
const char comp_gain_value_text3[] = "+12 dB";
char* get_comp_gain_value_text(void)
{
switch (configuration.comp_gain)
{
case 0:
return (comp_gain_value_text1);
break;
case 1:
return (comp_gain_value_text2);
break;
case 2:
return (comp_gain_value_text3);
break;
}
}
/****************************************** /******************************************
MAIN MENU MAIN MENU
******************************************/ ******************************************/
@ -327,7 +350,8 @@ LiquidMenu overdrive_menu(lcd);
#define NUM_COMP_GAIN_MENUS 1 #define NUM_COMP_GAIN_MENUS 1
const char comp_gain_text1[] PROGMEM = "Comp. Gain"; const char comp_gain_text1[] PROGMEM = "Comp. Gain";
LiquidLine comp_gain_line1(1, 0, comp_gain_text1); LiquidLine comp_gain_line1(1, 0, comp_gain_text1);
LiquidLine comp_gain_line2(1, 1, configuration.comp_gain); //LiquidLine comp_gain_line2(1, 1, configuration.comp_gain);
LiquidLine comp_gain_line2(1, 1, get_comp_gain_value_text);
LiquidScreen comp_gain_screen; LiquidScreen comp_gain_screen;
LiquidMenu comp_gain_menu(lcd); LiquidMenu comp_gain_menu(lcd);
@ -1075,9 +1099,9 @@ void callback_info_function()
} }
/****************************************** /******************************************
HELPER FUCTIONS HELPER MENU FUNCTION
******************************************/ ******************************************/
float mapfloat(float val, float in_min, float in_max, float out_min, float out_max) float mapfloat(float val, float in_min, float in_max, float out_min, float out_max)
// e.g. mapfloat(float(effect_delay_feedback), 0, ENC_DELAY_FB_STEPS, 0.0, 1.0) // e.g. mapfloat(float(effect_delay_feedback), 0, ENC_DELAY_FB_STEPS, 0.0, 1.0)
{ {
@ -1132,6 +1156,9 @@ void goto_system_menu(void)
enc[RIGHT_ENCODER].write(menu_position[SYSTEM], 0, NUM_SYSTEM_MENUS - 1); enc[RIGHT_ENCODER].write(menu_position[SYSTEM], 0, NUM_SYSTEM_MENUS - 1);
} }
/******************************************
INIT MENU FUNCTION
******************************************/
void init_menus(void) void init_menus(void)
{ {
uint8_t i; uint8_t i;

@ -76,7 +76,28 @@
//************************************************************************************************* //*************************************************************************************************
// Teensy Audio Shield: // Teensy Audio Shield:
#define SGTL5000_LINEOUT_LEVEL 29 /* Values for SGTL5000_LINEOUT_LEVEL
13: 3.16 Volts p-p
14: 2.98 Volts p-p
15: 2.83 Volts p-p
16: 2.67 Volts p-p
17: 2.53 Volts p-p
18: 2.39 Volts p-p
19: 2.26 Volts p-p
20: 2.14 Volts p-p
21: 2.02 Volts p-p
22: 1.91 Volts p-p
23: 1.80 Volts p-p
24: 1.71 Volts p-p
25: 1.62 Volts p-p
26: 1.53 Volts p-p
27: 1.44 Volts p-p
28: 1.37 Volts p-p
29: 1.29 Volts p-p (default)
30: 1.22 Volts p-p
31: 1.16 Volts p-p
*/
#define SGTL5000_LINEOUT_LEVEL 24
//#define SDCARD_CS_PIN 10 //#define SDCARD_CS_PIN 10
//#define SDCARD_MOSI_PIN 7 //#define SDCARD_MOSI_PIN 7
//#define SDCARD_SCK_PIN 14 //#define SDCARD_SCK_PIN 14

Loading…
Cancel
Save