Small fixes for displaying volume.

pull/4/head
Holger Wirtz 6 years ago
parent f43164b7d6
commit 69f8a44309
  1. 19
      UI.cpp
  2. 6
      config.h
  3. 2
      dexed_sysex.cpp

@ -198,11 +198,20 @@ void ui_show_volume(void)
lcd.show(0, 0, LCD_CHARS, "Volume");
lcd.show(0, LCD_CHARS - 3, 3, vol * 100);
for (uint8_t i = 0; i < map(vol * 100, 0, 100, 0, LCD_CHARS); i++)
lcd.show(1, i, 1, "*");
for (uint8_t i = map(vol * 100, 0, 100, 0, LCD_CHARS); i < LCD_CHARS; i++)
lcd.show(1, i, 1, " ");
if (vol == 0.0)
lcd.show(1, 0, LCD_CHARS , " ");
else
{
if (vol < (float(LCD_CHARS) / 100))
lcd.show(1, 0, LCD_CHARS, "*");
else
{
for (uint8_t i = 0; i < map(vol * 100, 0, 100, 0, LCD_CHARS); i++)
lcd.show(1, i, 1, "*");
for (uint8_t i = map(vol * 100, 0, 100, 0, LCD_CHARS); i < LCD_CHARS; i++)
lcd.show(1, i, 1, " ");
}
}
ui_state = UI_VOLUME;
}

@ -66,7 +66,7 @@
// Debug output
#define SERIAL_SPEED 38400
#define DEBUG 1
//#define DEBUG 1
#define SHOW_MIDI_EVENT 1
#define SHOW_XRUN 1
#define SHOW_CPU_LOAD_MSEC 5000
@ -99,8 +99,8 @@
#define UI_AUTO_BACK_MS 2000
// Encoder with button
#define ENC_VOL_STEPS 50
#define TIMER_UI_HANDLING_MS 50
#define ENC_VOL_STEPS 43
#define TIMER_UI_HANDLING_MS 100
#define NUM_ENCODER 2
#define ENC_L_PIN_A 3
#define ENC_L_PIN_B 2

@ -257,8 +257,8 @@ bool load_sysex(uint8_t b, uint8_t v)
#endif
return (dexed->loadSysexVoice(data));
}
else
#ifdef DEBUG
else
Serial.println(F("E : Cannot load voice data"));
#endif
}

Loading…
Cancel
Save