- vfd: fix progress-bar in audio mode; ...

... don't accept periodic changes from infoviewer

- vfd: allow volume-bar in menu mode and audio mode
This commit is contained in:
svenhoefer
2015-01-12 14:43:52 +01:00
parent 2b5e7b5ba3
commit ccf741f015
2 changed files with 26 additions and 19 deletions

View File

@@ -414,14 +414,18 @@ void CVFD::showVolume(const char vol, const bool force_update)
if(!has_lcd) return;
ShowIcon(FP_ICON_MUTE, muted);
if(!force_update && vol == volume)
return;
volume = vol;
wake_up();
ShowIcon(FP_ICON_FRAME, true);
if ((mode == MODE_TVRADIO) && g_settings.lcd_setting[SNeutrinoSettings::LCD_SHOW_VOLUME]) {
bool allowed_mode = (mode == MODE_TVRADIO || mode == MODE_AUDIO || mode == MODE_MENU_UTF8);
if (!allowed_mode)
return;
if (g_settings.lcd_setting[SNeutrinoSettings::LCD_SHOW_VOLUME] == 1) {
wake_up();
ShowIcon(FP_ICON_FRAME, true);
int pp = (int) round((double) vol * (double) 8 / (double) 100);
if(pp > 8) pp = 8;
@@ -442,22 +446,26 @@ printf("CVFD::showVolume: %d, bar %d\n", (int) vol, pp);
}
}
void CVFD::showPercentOver(const unsigned char perc, const bool /*perform_update*/)
void CVFD::showPercentOver(const unsigned char perc, const bool /*perform_update*/, const MODES origin)
{
if(!has_lcd) return;
if (mode == MODE_AUDIO && origin != MODE_AUDIO) // exclusive access for audio mode
return;
if (((mode == MODE_TVRADIO) || (mode == MODE_AUDIO) || (mode == MODE_MENU_UTF8)) && !(g_settings.lcd_setting[SNeutrinoSettings::LCD_SHOW_VOLUME])) {
//if (g_settings.lcd_setting[SNeutrinoSettings::LCD_SHOW_VOLUME] == 0)
{
ShowIcon(FP_ICON_FRAME, true);
int pp;
if(perc == 255)
pp = 0;
else
pp = (int) round((double) perc * (double) 8 / (double) 100);
bool allowed_mode = (mode == MODE_TVRADIO || mode == MODE_AUDIO || mode == MODE_MENU_UTF8);
if (!allowed_mode)
return;
if (g_settings.lcd_setting[SNeutrinoSettings::LCD_SHOW_VOLUME] == 0) {
ShowIcon(FP_ICON_FRAME, true);
int pp;
if(perc == 255)
pp = 0;
else
pp = (int) round((double) perc * (double) 8 / (double) 100);
if(pp > 8) pp = 8;
//printf("CVFD::showPercentOver: %d, bar %d\n", (int) perc, pp);
if(pp > 8) pp = 8;
if(pp != percentOver) {
if(pp != percentOver) {
int i;
int j = 0x00000200;
for(i = 0; i < pp; i++) {
@@ -469,7 +477,6 @@ void CVFD::showPercentOver(const unsigned char perc, const bool /*perform_update
j /= 2;
}
percentOver = pp;
}
}
}
}
@@ -533,7 +540,7 @@ void CVFD::showAudioProgress(const unsigned char perc)
if (mode != MODE_AUDIO)
return;
showPercentOver(perc, false);
showPercentOver(perc, true, MODE_AUDIO);
}
void CVFD::setMode(const MODES m, const char * const title)