- fix vfd update in audioplayer (patch by snafed & dbt)

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@1665 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
striper
2011-09-05 15:36:31 +00:00
parent 5fd34b84ac
commit 27d91297b4
2 changed files with 25 additions and 29 deletions

View File

@@ -1,5 +1,4 @@
/* /*
$Id: audioplayer.cpp,v 1.80 2009/10/18 14:38:03 dbt Exp $
Neutrino-GUI - DBoxII-Project Neutrino-GUI - DBoxII-Project
AudioPlayer by Dirch,Zwen AudioPlayer by Dirch,Zwen
@@ -365,10 +364,8 @@ int CAudioPlayerGui::show()
while (loop) while (loop)
{ {
if (!m_screensaver) updateMetaData(m_screensaver);
{
updateMetaData();
}
updateTimes(); updateTimes();
if (CNeutrinoApp::getInstance()->getMode() != NeutrinoMessages::mode_audio) if (CNeutrinoApp::getInstance()->getMode() != NeutrinoMessages::mode_audio)
@@ -2098,8 +2095,7 @@ int CAudioPlayerGui::getNext()
return ret; return ret;
} }
//------------------------------------------------------------------------ //------------------------------------------------------------------------
void CAudioPlayerGui::updateMetaData(bool screen_saver)
void CAudioPlayerGui::updateMetaData()
{ {
bool updateMeta = false; bool updateMeta = false;
bool updateLcd = false; bool updateLcd = false;
@@ -2121,36 +2117,35 @@ void CAudioPlayerGui::updateMetaData()
{ {
info << " / "; info << " / ";
if ( meta.vbr ) if ( meta.vbr )
{
info << "VBR "; info << "VBR ";
}
info << meta.bitrate/1000 << "kbps"; info << meta.bitrate/1000 << "kbps";
} }
if ( meta.samplerate > 0 ) if ( meta.samplerate > 0 )
{
info << " / " << meta.samplerate/1000 << "." << (meta.samplerate/100)%10 <<"kHz"; info << " / " << meta.samplerate/1000 << "." << (meta.samplerate/100)%10 <<"kHz";
}
m_metainfo = meta.type_info + info.str(); m_metainfo = meta.type_info + info.str();
updateMeta = true; updateMeta = !screen_saver;
if (!meta.artist.empty() && if (!meta.artist.empty() && meta.artist != m_curr_audiofile.MetaData.artist)
meta.artist != m_curr_audiofile.MetaData.artist)
{ {
m_curr_audiofile.MetaData.artist = meta.artist; m_curr_audiofile.MetaData.artist = meta.artist;
updateScreen = true;
if ( !screen_saver)
updateScreen = true;
updateLcd = true; updateLcd = true;
} }
if (!meta.title.empty() &&
meta.title != m_curr_audiofile.MetaData.title) if (!meta.title.empty() && meta.title != m_curr_audiofile.MetaData.title)
{ {
m_curr_audiofile.MetaData.title = meta.title; m_curr_audiofile.MetaData.title = meta.title;
updateScreen = true;
if ( !screen_saver)
updateScreen = true;
updateLcd = true; updateLcd = true;
} }
if (!meta.sc_station.empty() &&
meta.sc_station != m_curr_audiofile.MetaData.album) if (!meta.sc_station.empty() && meta.sc_station != m_curr_audiofile.MetaData.album)
{ {
m_curr_audiofile.MetaData.album = meta.sc_station; m_curr_audiofile.MetaData.album = meta.sc_station;
updateLcd = true; updateLcd = true;
@@ -2158,14 +2153,15 @@ void CAudioPlayerGui::updateMetaData()
} }
//if (CAudioPlayer::getInstance()->getScBuffered() != 0) //if (CAudioPlayer::getInstance()->getScBuffered() != 0)
if (CAudioPlayer::getInstance()->hasMetaDataChanged() != 0) if (CAudioPlayer::getInstance()->hasMetaDataChanged() != 0)
{
updateLcd = true; updateLcd = true;
}
//printf("CAudioPlayerGui::updateMetaData: updateLcd %d\n", updateLcd); //printf("CAudioPlayerGui::updateMetaData: updateLcd %d\n", updateLcd);
if (updateLcd) if (updateLcd)
paintLCD(); paintLCD();
if (updateScreen) if (updateScreen)
paintInfo(); paintInfo();
if (updateMeta || updateScreen) if (updateMeta || updateScreen)
{ {
m_frameBuffer->paintBoxRel(m_x + 10, m_y + 4 + 2*m_fheight, m_width - 20, m_frameBuffer->paintBoxRel(m_x + 10, m_y + 4 + 2*m_fheight, m_width - 20,

View File

@@ -164,7 +164,7 @@ class CAudioPlayerGui : public CMenuTarget
void rev(unsigned int seconds=0); void rev(unsigned int seconds=0);
int getNext(); int getNext();
void GetMetaData(CAudiofileExt &File); void GetMetaData(CAudiofileExt &File);
void updateMetaData(); void updateMetaData(bool screen_saver = false);
void updateTimes(const bool force = false); void updateTimes(const bool force = false);
void showMetaData(); void showMetaData();
void screensaver(bool on); void screensaver(bool on);