- 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:
svenhoefer
2017-11-20 15:19:06 +01:00
committed by Thilo Graf
parent 1f86b6aa62
commit 0fc3e793a4
28 changed files with 233 additions and 247 deletions

View File

@@ -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);
}