mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 00:41:17 +02:00
- vfd: fix percentOver handling
This commit is contained in:
@@ -448,7 +448,12 @@ printf("CVFD::showVolume: %d, bar %d\n", (int) vol, pp);
|
|||||||
|
|
||||||
void CVFD::showPercentOver(const unsigned char perc, const bool /*perform_update*/, const MODES origin)
|
void CVFD::showPercentOver(const unsigned char perc, const bool /*perform_update*/, const MODES origin)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
static int ppold = 0;
|
||||||
if(!has_lcd) return;
|
if(!has_lcd) return;
|
||||||
|
|
||||||
|
percentOver = perc;
|
||||||
|
|
||||||
if (mode == MODE_AUDIO && origin != MODE_AUDIO) // exclusive access for audio mode
|
if (mode == MODE_AUDIO && origin != MODE_AUDIO) // exclusive access for audio mode
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -464,8 +469,9 @@ void CVFD::showPercentOver(const unsigned char perc, const bool /*perform_update
|
|||||||
else
|
else
|
||||||
pp = (int) round((double) perc * (double) 8 / (double) 100);
|
pp = (int) round((double) perc * (double) 8 / (double) 100);
|
||||||
if(pp > 8) pp = 8;
|
if(pp > 8) pp = 8;
|
||||||
|
|
||||||
|
if(pp != ppold) {
|
||||||
//printf("CVFD::showPercentOver: %d, bar %d\n", (int) perc, pp);
|
//printf("CVFD::showPercentOver: %d, bar %d\n", (int) perc, pp);
|
||||||
if(pp != percentOver) {
|
|
||||||
int i;
|
int i;
|
||||||
int j = 0x00000200;
|
int j = 0x00000200;
|
||||||
for(i = 0; i < pp; i++) {
|
for(i = 0; i < pp; i++) {
|
||||||
@@ -476,7 +482,7 @@ void CVFD::showPercentOver(const unsigned char perc, const bool /*perform_update
|
|||||||
ShowIcon((fp_icon) j, false);
|
ShowIcon((fp_icon) j, false);
|
||||||
j /= 2;
|
j /= 2;
|
||||||
}
|
}
|
||||||
percentOver = pp;
|
ppold = pp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user