mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 08:21:12 +02:00
- neutrino: unify modes handling; ...
remove double enum from CNeutrinoApp and move mostly used enum from NeutrinoMessages to new NeutrinoModes Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
@@ -181,7 +181,7 @@ int CUpnpBrowserGui::exec(CMenuTarget* parent, const std::string & /*actionKey*/
|
||||
m_frameBuffer->showFrame("mp3.jpg");
|
||||
|
||||
// tell neutrino we're in upnp mode
|
||||
CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE , NeutrinoMessages::mode_upnp);
|
||||
CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE , NeutrinoModes::mode_upnp);
|
||||
|
||||
// remember last mode
|
||||
m_LastMode=(CNeutrinoApp::getInstance()->getLastMode());
|
||||
@@ -1293,15 +1293,15 @@ 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))
|
||||
if ((CAudioPlayer::getInstance()->getState() == CBaseDec::STOP) && (CNeutrinoApp::getInstance()->getMode() == NeutrinoModes::mode_audio))
|
||||
{
|
||||
CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoMessages::mode_upnp | NeutrinoMessages::norezap);
|
||||
CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoModes::mode_upnp | NeutrinoModes::norezap);
|
||||
}
|
||||
}
|
||||
|
||||
void CUpnpBrowserGui::playAudio(std::string name, int type)
|
||||
{
|
||||
CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoMessages::mode_audio);
|
||||
CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoModes::mode_audio);
|
||||
|
||||
CAudiofile mp3(name, (CFile::FileType) type);
|
||||
CAudioPlayer::getInstance()->play(&mp3, g_settings.audioplayer_highprio == 1);
|
||||
@@ -1314,12 +1314,12 @@ void CUpnpBrowserGui::stopAudio()
|
||||
CAudioPlayer::getInstance()->stop();
|
||||
}
|
||||
|
||||
CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoMessages::mode_upnp | NeutrinoMessages::norezap);
|
||||
CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoModes::mode_upnp | NeutrinoModes::norezap);
|
||||
}
|
||||
|
||||
void CUpnpBrowserGui::showPicture(std::string name)
|
||||
{
|
||||
CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoMessages::mode_pic);
|
||||
CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoModes::mode_pic);
|
||||
|
||||
g_PicViewer->SetScaling((CPictureViewer::ScalingMode)g_settings.picviewer_scaling);
|
||||
g_PicViewer->SetVisible(g_settings.screen_StartX, g_settings.screen_EndX, g_settings.screen_StartY, g_settings.screen_EndY);
|
||||
@@ -1332,19 +1332,19 @@ void CUpnpBrowserGui::showPicture(std::string name)
|
||||
g_PicViewer->ShowImage(name, false);
|
||||
g_PicViewer->Cleanup();
|
||||
|
||||
CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoMessages::mode_upnp | NeutrinoMessages::norezap);
|
||||
CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoModes::mode_upnp | NeutrinoModes::norezap);
|
||||
}
|
||||
|
||||
void CUpnpBrowserGui::playVideo(std::string name, std::string url)
|
||||
{
|
||||
stopAudio();
|
||||
|
||||
CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoMessages::mode_ts);
|
||||
CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoModes::mode_ts);
|
||||
|
||||
m_frameBuffer->stopFrame();
|
||||
CMoviePlayerGui::getInstance().SetFile(name, url);
|
||||
CMoviePlayerGui::getInstance().exec(NULL, "upnp");
|
||||
video_key_msg = CMoviePlayerGui::getInstance().getKeyPressed();
|
||||
|
||||
CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoMessages::mode_upnp | NeutrinoMessages::norezap);
|
||||
CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoModes::mode_upnp | NeutrinoModes::norezap);
|
||||
}
|
||||
|
Reference in New Issue
Block a user