mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 00:41:17 +02:00
- 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:
@@ -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;
|
||||
|
||||
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);
|
||||
|
||||
if ((mode == MODE_TVRADIO) && g_settings.lcd_setting[SNeutrinoSettings::LCD_SHOW_VOLUME]) {
|
||||
int pp = (int) round((double) vol * (double) 8 / (double) 100);
|
||||
if(pp > 8) pp = 8;
|
||||
|
||||
@@ -442,21 +446,25 @@ 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)
|
||||
{
|
||||
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);
|
||||
//printf("CVFD::showPercentOver: %d, bar %d\n", (int) perc, pp);
|
||||
if(pp > 8) pp = 8;
|
||||
//printf("CVFD::showPercentOver: %d, bar %d\n", (int) perc, pp);
|
||||
if(pp != percentOver) {
|
||||
int i;
|
||||
int j = 0x00000200;
|
||||
@@ -471,7 +479,6 @@ void CVFD::showPercentOver(const unsigned char perc, const bool /*perform_update
|
||||
percentOver = pp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CVFD::showMenuText(const int /*position*/, const char * ptext, const int /*highlight*/, const bool /*utf_encoded*/)
|
||||
@@ -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)
|
||||
|
@@ -124,7 +124,7 @@ class CVFD
|
||||
/** blocks for duration seconds */
|
||||
void showRCLock(int duration = 2);
|
||||
void showVolume(const char vol, const bool perform_update = true);
|
||||
void showPercentOver(const unsigned char perc, const bool perform_update = true);
|
||||
void showPercentOver(const unsigned char perc, const bool perform_update = true, const MODES origin = MODE_TVRADIO);
|
||||
void showMenuText(const int position, const char * text, const int highlight = -1, const bool utf_encoded = false);
|
||||
void showAudioTrack(const std::string & artist, const std::string & title, const std::string & album);
|
||||
void showAudioPlayMode(AUDIOMODES m=AUDIO_MODE_PLAY);
|
||||
|
Reference in New Issue
Block a user