mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-01 01:41:12 +02:00
Merge branch 'master' of https://github.com/tuxbox-neutrino/gui-neutrino into ni/tuxbox
Origin commit data
------------------
Commit: c7bb1c67e6
Author: vanhofen <vanhofen@gmx.de>
Date: 2017-03-27 (Mon, 27 Mar 2017)
This commit is contained in:
@@ -739,6 +739,7 @@ bool CUpnpBrowserGui::selectItem(std::string id)
|
|||||||
|
|
||||||
while (loop) {
|
while (loop) {
|
||||||
updateTimes();
|
updateTimes();
|
||||||
|
updateMode();
|
||||||
|
|
||||||
if (refresh) {
|
if (refresh) {
|
||||||
printf("selectItem: refresh, timeout = %d\n", (int) timeout);
|
printf("selectItem: refresh, timeout = %d\n", (int) timeout);
|
||||||
@@ -1263,7 +1264,7 @@ void CUpnpBrowserGui::updateTimes(const bool force)
|
|||||||
updatePlayed = true;
|
updatePlayed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("updateTimes: force %d updatePlayed %d\n", force, updatePlayed);
|
//printf("updateTimes: force %d updatePlayed %d\n", force, updatePlayed);
|
||||||
char play_time[8];
|
char play_time[8];
|
||||||
snprintf(play_time, 7, "%ld:%02ld", m_time_played / 60, m_time_played % 60);
|
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)
|
void CUpnpBrowserGui::playAudio(std::string name, int type)
|
||||||
{
|
{
|
||||||
CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoMessages::mode_audio);
|
CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoMessages::mode_audio);
|
||||||
|
|
||||||
CAudiofile mp3(name, (CFile::FileType) type);
|
CAudiofile mp3(name, (CFile::FileType) type);
|
||||||
CAudioPlayer::getInstance()->play(&mp3, g_settings.audioplayer_highprio == 1);
|
CAudioPlayer::getInstance()->play(&mp3, g_settings.audioplayer_highprio == 1);
|
||||||
|
|
||||||
CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoMessages::mode_upnp | NeutrinoMessages::norezap);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CUpnpBrowserGui::stopAudio()
|
void CUpnpBrowserGui::stopAudio()
|
||||||
@@ -1290,6 +1298,8 @@ void CUpnpBrowserGui::stopAudio()
|
|||||||
{
|
{
|
||||||
CAudioPlayer::getInstance()->stop();
|
CAudioPlayer::getInstance()->stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoMessages::mode_upnp | NeutrinoMessages::norezap);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CUpnpBrowserGui::showPicture(std::string name)
|
void CUpnpBrowserGui::showPicture(std::string name)
|
||||||
|
@@ -124,6 +124,7 @@ class CUpnpBrowserGui : public CMenuTarget, public CListHelpers
|
|||||||
void paintItem2DetailsLine(int pos);
|
void paintItem2DetailsLine(int pos);
|
||||||
|
|
||||||
void updateTimes(const bool force = false);
|
void updateTimes(const bool force = false);
|
||||||
|
void updateMode();
|
||||||
void playAudio(std::string name, int type);
|
void playAudio(std::string name, int type);
|
||||||
void stopAudio();
|
void stopAudio();
|
||||||
void showPicture(std::string name);
|
void showPicture(std::string name);
|
||||||
|
Reference in New Issue
Block a user