Origin commit data
------------------
Commit: c7bb1c67e6
Author: vanhofen <vanhofen@gmx.de>
Date: 2017-03-27 (Mon, 27 Mar 2017)
This commit is contained in:
vanhofen
2017-03-27 08:13:11 +02:00
2 changed files with 14 additions and 3 deletions

View File

@@ -739,6 +739,7 @@ bool CUpnpBrowserGui::selectItem(std::string id)
while (loop) {
updateTimes();
updateMode();
if (refresh) {
printf("selectItem: refresh, timeout = %d\n", (int) timeout);
@@ -1263,7 +1264,7 @@ void CUpnpBrowserGui::updateTimes(const bool force)
updatePlayed = true;
}
printf("updateTimes: force %d updatePlayed %d\n", force, updatePlayed);
//printf("updateTimes: force %d updatePlayed %d\n", force, updatePlayed);
char play_time[8];
snprintf(play_time, 7, "%ld:%02ld", m_time_played / 60, m_time_played % 60);
@@ -1274,14 +1275,21 @@ void CUpnpBrowserGui::updateTimes(const bool force)
}
}
void CUpnpBrowserGui::updateMode()
{
/* switch back to mode_upnp if audio has stopped automatically */
if ((CAudioPlayer::getInstance()->getState() == CBaseDec::STOP) && (CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_audio))
{
CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoMessages::mode_upnp | NeutrinoMessages::norezap);
}
}
void CUpnpBrowserGui::playAudio(std::string name, int type)
{
CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoMessages::mode_audio);
CAudiofile mp3(name, (CFile::FileType) type);
CAudioPlayer::getInstance()->play(&mp3, g_settings.audioplayer_highprio == 1);
CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoMessages::mode_upnp | NeutrinoMessages::norezap);
}
void CUpnpBrowserGui::stopAudio()
@@ -1290,6 +1298,8 @@ void CUpnpBrowserGui::stopAudio()
{
CAudioPlayer::getInstance()->stop();
}
CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoMessages::mode_upnp | NeutrinoMessages::norezap);
}
void CUpnpBrowserGui::showPicture(std::string name)

View File

@@ -124,6 +124,7 @@ class CUpnpBrowserGui : public CMenuTarget, public CListHelpers
void paintItem2DetailsLine(int pos);
void updateTimes(const bool force = false);
void updateMode();
void playAudio(std::string name, int type);
void stopAudio();
void showPicture(std::string name);