From 3ce9367ec8b2ff30d08eb855e8c49d2555b43adb Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 17 Jan 2012 19:44:42 +0000 Subject: [PATCH] neutrino media player menu: call moviebrowser from media player object We had 2 ways to open the moviebrowser and one was with parental lock, the other without. btw: Is it really necessary to lock here? Moviebrowser got its own configurable parental lock. git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@2064 e54a6e83-5905-42d5-8d5c-058d10e6a962 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f7bf5932a9040c41230cef92e242c6ef4220645a Author: Thilo Graf Date: 2012-01-17 (Tue, 17 Jan 2012) Origin message was: ------------------ *neutrino media player menu: call moviebrowser from media player object We had 2 ways to open the moviebrowser and one was with parental lock, the other without. btw: Is it really necessary to lock here? Moviebrowser got its own configurable parental lock. git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@2064 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/gui/mediaplayer.cpp | 31 +++++++++++++++++++++++++++---- src/neutrino.cpp | 17 ++--------------- 2 files changed, 29 insertions(+), 19 deletions(-) diff --git a/src/gui/mediaplayer.cpp b/src/gui/mediaplayer.cpp index 5df2aac8f..adcb33ca4 100644 --- a/src/gui/mediaplayer.cpp +++ b/src/gui/mediaplayer.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include "gui/movieplayer.h" #include "gui/pictureviewer.h" @@ -48,7 +49,8 @@ #include #include - +#include +extern cVideo * videoDecoder; CMediaPlayerMenu::CMediaPlayerMenu() { @@ -101,6 +103,28 @@ int CMediaPlayerMenu::exec(CMenuTarget* parent, const std::string &actionKey) return menu_return::RETURN_REPAINT; } + else if (actionKey == "movieplayer") + { +#if 0 //Is it really necessary to lock here? Moviebrowser got its own configurable parental lock. + bool show = true; + if ((g_settings.parentallock_prompt == PARENTALLOCK_PROMPT_ONSIGNAL) || (g_settings.parentallock_prompt == PARENTALLOCK_PROMPT_CHANGETOLOCKED)) { + CZapProtection zapProtection( g_settings.parentallock_pincode, 0x100 ); + show = zapProtection.check(); + } + + if(show){ +#endif + int mode = CNeutrinoApp::getInstance()->getMode(); + if( mode == NeutrinoMessages::mode_radio ) + videoDecoder->StopPicture(); + CMoviePlayerGui::getInstance().exec(NULL, "tsmoviebrowser"); + if( mode == NeutrinoMessages::mode_radio ) + videoDecoder->ShowPicture(DATADIR "/neutrino/icons/radiomode.jpg"); +#if 0 + } +#endif + return menu_return::RETURN_REPAINT;; + } int res = initMenuMedia(); @@ -216,9 +240,8 @@ int CMediaPlayerMenu::initMenuMedia(CMenuWidget *m, CPersonalizeGui *p) //show movieplayer submenu with selectable items for moviebrowser or filebrowser void CMediaPlayerMenu::showMoviePlayer(CMenuWidget *moviePlayer, CPersonalizeGui *p) { - CMoviePlayerGui *movieplayer_gui = &CMoviePlayerGui::getInstance(); - CMenuForwarder *fw_mbrowser = new CMenuForwarder(LOCALE_MOVIEBROWSER_HEAD, true, NULL, movieplayer_gui, "tsmoviebrowser", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED); - CMenuForwarder *fw_file = new CMenuForwarder(LOCALE_MOVIEPLAYER_FILEPLAYBACK, true, NULL, movieplayer_gui, "fileplayback", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN); + CMenuForwarder *fw_mbrowser = new CMenuForwarder(LOCALE_MOVIEBROWSER_HEAD, true, NULL, this, "movieplayer", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED); + CMenuForwarder *fw_file = new CMenuForwarder(LOCALE_MOVIEPLAYER_FILEPLAYBACK, true, NULL, &CMoviePlayerGui::getInstance(), "fileplayback", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN); p->addIntroItems(moviePlayer); diff --git a/src/neutrino.cpp b/src/neutrino.cpp index d986f00d5..f9fa0b1b4 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2131,21 +2131,8 @@ void CNeutrinoApp::RealRun(CMenuWidget &mainMenu) media->exec(NULL, ""); } else if( msg == CRCInput::RC_video || msg == CRCInput::RC_play ) { - bool show = true; - if ((g_settings.parentallock_prompt == PARENTALLOCK_PROMPT_ONSIGNAL) || (g_settings.parentallock_prompt == PARENTALLOCK_PROMPT_CHANGETOLOCKED)) { - CZapProtection* zapProtection = new CZapProtection( g_settings.parentallock_pincode, 0x100 ); - show = zapProtection->check(); - delete zapProtection; - } - if(show) { - //StopSubtitles(); - if( mode == mode_radio ) - videoDecoder->StopPicture(); - CMoviePlayerGui::getInstance().exec(NULL, "tsmoviebrowser"); - if( mode == mode_radio ) - videoDecoder->ShowPicture(DATADIR "/neutrino/icons/radiomode.jpg"); - //StartSubtitles(); - } + //open moviebrowser via media player menu object + CMediaPlayerMenu::getInstance()->exec(NULL,"movieplayer"); } else if (CRCInput::isNumeric(msg) && g_RemoteControl->director_mode ) { g_RemoteControl->setSubChannel(CRCInput::getNumericValue(msg));