mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
- vfd/audioplayer: fix vfd progress in audioplayer
don't update full vfd every second
This commit is contained in:
@@ -446,7 +446,7 @@ void CVFD::showPercentOver(const unsigned char perc, const bool /*perform_update
|
|||||||
{
|
{
|
||||||
if(!has_lcd) return;
|
if(!has_lcd) return;
|
||||||
|
|
||||||
if (((mode == MODE_TVRADIO) || (mode == MODE_MENU_UTF8)) && !(g_settings.lcd_setting[SNeutrinoSettings::LCD_SHOW_VOLUME])) {
|
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)
|
//if (g_settings.lcd_setting[SNeutrinoSettings::LCD_SHOW_VOLUME] == 0)
|
||||||
{
|
{
|
||||||
ShowIcon(FP_ICON_FRAME, true);
|
ShowIcon(FP_ICON_FRAME, true);
|
||||||
@@ -503,6 +503,8 @@ printf("CVFD::showAudioTrack: %s\n", title.c_str());
|
|||||||
void CVFD::showAudioPlayMode(AUDIOMODES m)
|
void CVFD::showAudioPlayMode(AUDIOMODES m)
|
||||||
{
|
{
|
||||||
if(fd < 0) return;
|
if(fd < 0) return;
|
||||||
|
if (mode != MODE_AUDIO)
|
||||||
|
return;
|
||||||
|
|
||||||
switch(m) {
|
switch(m) {
|
||||||
case AUDIO_MODE_PLAY:
|
case AUDIO_MODE_PLAY:
|
||||||
@@ -525,22 +527,13 @@ void CVFD::showAudioPlayMode(AUDIOMODES m)
|
|||||||
wake_up();
|
wake_up();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CVFD::showAudioProgress(const char /*perc*/, bool /*isMuted*/)
|
void CVFD::showAudioProgress(const unsigned char perc)
|
||||||
{
|
{
|
||||||
if(!has_lcd) return;
|
if(fd < 0) return;
|
||||||
#if 0 // what is this ? FIXME
|
if (mode != MODE_AUDIO)
|
||||||
if (mode == MODE_AUDIO) {
|
return;
|
||||||
int dp = int( perc/100.0*61.0+12.0);
|
|
||||||
if(isMuted) {
|
showPercentOver(perc, false);
|
||||||
if(dp > 12) {
|
|
||||||
display.draw_line(12, 56, dp-1, 56, CLCDDisplay::PIXEL_OFF);
|
|
||||||
display.draw_line(12, 58, dp-1, 58, CLCDDisplay::PIXEL_OFF);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
display.draw_line (12,55,72,59, CLCDDisplay::PIXEL_ON);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CVFD::setMode(const MODES m, const char * const title)
|
void CVFD::setMode(const MODES m, const char * const title)
|
||||||
|
@@ -128,7 +128,7 @@ class CVFD
|
|||||||
void showMenuText(const int position, const char * text, const int highlight = -1, const bool utf_encoded = false);
|
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 showAudioTrack(const std::string & artist, const std::string & title, const std::string & album);
|
||||||
void showAudioPlayMode(AUDIOMODES m=AUDIO_MODE_PLAY);
|
void showAudioPlayMode(AUDIOMODES m=AUDIO_MODE_PLAY);
|
||||||
void showAudioProgress(const char perc, bool isMuted);
|
void showAudioProgress(const unsigned char perc);
|
||||||
void setBrightness(int);
|
void setBrightness(int);
|
||||||
int getBrightness();
|
int getBrightness();
|
||||||
|
|
||||||
|
@@ -837,7 +837,7 @@ int CAudioPlayerGui::show()
|
|||||||
ret = menu_return::RETURN_EXIT_ALL;
|
ret = menu_return::RETURN_EXIT_ALL;
|
||||||
loop = false;
|
loop = false;
|
||||||
}
|
}
|
||||||
paintLCD();
|
//paintLCD();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
hide();
|
hide();
|
||||||
@@ -2162,9 +2162,9 @@ void CAudioPlayerGui::updateTimes(const bool force)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((updatePlayed || updateTotal) && m_time_total != 0)
|
if ((updatePlayed || updateTotal) && m_curr_audiofile.FileType != CFile::STREAM_AUDIO && m_time_total != 0)
|
||||||
{
|
{
|
||||||
CVFD::getInstance()->showAudioProgress(100 * m_time_played / m_time_total, CNeutrinoApp::getInstance()->isMuted());
|
CVFD::getInstance()->showAudioProgress(100 * m_time_played / m_time_total);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2175,20 +2175,14 @@ void CAudioPlayerGui::paintLCD()
|
|||||||
{
|
{
|
||||||
case CAudioPlayerGui::STOP:
|
case CAudioPlayerGui::STOP:
|
||||||
CVFD::getInstance()->showAudioPlayMode(CVFD::AUDIO_MODE_STOP);
|
CVFD::getInstance()->showAudioPlayMode(CVFD::AUDIO_MODE_STOP);
|
||||||
CVFD::getInstance()->showAudioProgress(0, CNeutrinoApp::getInstance()->isMuted());
|
CVFD::getInstance()->showAudioProgress(0);
|
||||||
break;
|
break;
|
||||||
case CAudioPlayerGui::PLAY:
|
case CAudioPlayerGui::PLAY:
|
||||||
CVFD::getInstance()->showAudioPlayMode(CVFD::AUDIO_MODE_PLAY);
|
CVFD::getInstance()->showAudioPlayMode(CVFD::AUDIO_MODE_PLAY);
|
||||||
|
|
||||||
CVFD::getInstance()->showAudioTrack(m_curr_audiofile.MetaData.artist, m_curr_audiofile.MetaData.title,
|
CVFD::getInstance()->showAudioTrack(m_curr_audiofile.MetaData.artist, m_curr_audiofile.MetaData.title,
|
||||||
m_curr_audiofile.MetaData.album);
|
m_curr_audiofile.MetaData.album);
|
||||||
if (m_curr_audiofile.FileType != CFile::STREAM_AUDIO && m_time_total != 0)
|
if (m_curr_audiofile.FileType != CFile::STREAM_AUDIO && m_time_total != 0)
|
||||||
CVFD::getInstance()->showAudioProgress(100 * m_time_played / m_time_total, CNeutrinoApp::getInstance()->isMuted());
|
CVFD::getInstance()->showAudioProgress(100 * m_time_played / m_time_total);
|
||||||
|
|
||||||
#ifdef INCLUDE_UNUSED_STUFF
|
|
||||||
else
|
|
||||||
CVFD::getInstance()->showAudioProgress(100 * CAudioPlayer::getInstance()->getScBuffered() / 65536, CNeutrinoApp::getInstance()->isMuted());
|
|
||||||
#endif /* INCLUDE_UNUSED_STUFF */
|
|
||||||
break;
|
break;
|
||||||
case CAudioPlayerGui::PAUSE:
|
case CAudioPlayerGui::PAUSE:
|
||||||
CVFD::getInstance()->showAudioPlayMode(CVFD::AUDIO_MODE_PAUSE);
|
CVFD::getInstance()->showAudioPlayMode(CVFD::AUDIO_MODE_PAUSE);
|
||||||
|
Reference in New Issue
Block a user