neutrino: add MODE_VIDEO to CMediaPlayerMenu::showMenu()

This allows to create a "movieplayer shortcut" key.
Additionally, this probably fixes some memory leaks.

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1243 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
seife
2011-03-04 18:58:08 +00:00
parent 8fbdd9701d
commit 5e31ebc2f2
2 changed files with 39 additions and 21 deletions

View File

@@ -110,31 +110,44 @@ int CMediaPlayerMenu::exec(CMenuTarget* parent, const std::string &actionKey)
//show selectable mediaplayer items //show selectable mediaplayer items
void CMediaPlayerMenu::showMenu() void CMediaPlayerMenu::showMenu()
{ {
//menue init
CMenuWidget *media = new CMenuWidget(menu_title, NEUTRINO_ICON_MULTIMEDIA, width); CMenuWidget *media = new CMenuWidget(menu_title, NEUTRINO_ICON_MULTIMEDIA, width);
media->setSelected(selected);
//audio player CMenuForwarder *fw_audio = NULL;
neutrino_msg_t audio_rc = usage_mode == MODE_AUDIO ? CRCInput::RC_audio:CRCInput::RC_red; CMenuForwarder *fw_inet = NULL;
const char* audio_btn = usage_mode == MODE_AUDIO ? "" : NEUTRINO_ICON_BUTTON_RED; CMenuForwarder *fw_mp = NULL;
CMenuForwarder * fw_audio = new CMenuForwarder(LOCALE_MAINMENU_AUDIOPLAYER, true, NULL, this, "audioplayer", audio_rc, audio_btn); CMenuForwarder *fw_pviewer = NULL;
CMenuForwarder *fw_upnp = NULL;
CMenuWidget *moviePlayer = NULL;
//internet player if (usage_mode != MODE_VIDEO)
neutrino_msg_t inet_rc = usage_mode == MODE_AUDIO ? CRCInput::RC_www : CRCInput::RC_green; {
const char* inet_btn = usage_mode == MODE_AUDIO ? "" : NEUTRINO_ICON_BUTTON_GREEN; //menue init
CMenuForwarder * fw_inet = new CMenuForwarder(LOCALE_INETRADIO_NAME, true, NULL, this, "inetplayer", inet_rc, inet_btn); media->setSelected(selected);
//movieplayer //audio player
CMenuWidget *moviePlayer = new CMenuWidget(LOCALE_MAINMENU_MEDIA, NEUTRINO_ICON_MULTIMEDIA, width); neutrino_msg_t audio_rc = usage_mode == MODE_AUDIO ? CRCInput::RC_audio:CRCInput::RC_red;
CMenuForwarder * fw_mp = new CMenuForwarder(LOCALE_MAINMENU_MOVIEPLAYER, true, NULL, moviePlayer, NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW); const char* audio_btn = usage_mode == MODE_AUDIO ? "" : NEUTRINO_ICON_BUTTON_RED;
fw_audio = new CMenuForwarder(LOCALE_MAINMENU_AUDIOPLAYER, true, NULL, this, "audioplayer", audio_rc, audio_btn);
//internet player
neutrino_msg_t inet_rc = usage_mode == MODE_AUDIO ? CRCInput::RC_www : CRCInput::RC_green;
const char* inet_btn = usage_mode == MODE_AUDIO ? "" : NEUTRINO_ICON_BUTTON_GREEN;
fw_inet = new CMenuForwarder(LOCALE_INETRADIO_NAME, true, NULL, this, "inetplayer", inet_rc, inet_btn);
}
//pictureviewer if (usage_mode == MODE_DEFAULT)
CMenuForwarder * fw_pviewer = new CMenuForwarder(LOCALE_MAINMENU_PICTUREVIEWER, true, NULL, new CPictureViewerGui(), NULL, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE); {
//movieplayer
moviePlayer = new CMenuWidget(LOCALE_MAINMENU_MEDIA, NEUTRINO_ICON_MULTIMEDIA, width);
fw_mp = new CMenuForwarder(LOCALE_MAINMENU_MOVIEPLAYER, true, NULL, moviePlayer, NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW);
//upnp browser //pictureviewer
CMenuForwarder * fw_upnp = new CMenuForwarder(LOCALE_UPNPBROWSER_HEAD, true, NULL, new CUpnpBrowserGui(), NULL, CRCInput::RC_0, NEUTRINO_ICON_BUTTON_0); fw_pviewer = new CMenuForwarder(LOCALE_MAINMENU_PICTUREVIEWER, true, NULL, new CPictureViewerGui(), NULL, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE);
media->addIntroItems(NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, usage_mode == MODE_AUDIO ? CMenuWidget::BTN_TYPE_CANCEL : CMenuWidget::BTN_TYPE_BACK); //upnp browser
fw_upnp = new CMenuForwarder(LOCALE_UPNPBROWSER_HEAD, true, NULL, new CUpnpBrowserGui(), NULL, CRCInput::RC_0, NEUTRINO_ICON_BUTTON_0);
media->addIntroItems(NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, usage_mode == MODE_AUDIO ? CMenuWidget::BTN_TYPE_CANCEL : CMenuWidget::BTN_TYPE_BACK);
}
if (usage_mode == MODE_AUDIO) if (usage_mode == MODE_AUDIO)
{ {
@@ -144,6 +157,10 @@ void CMediaPlayerMenu::showMenu()
//internet player //internet player
media->addItem(fw_inet); media->addItem(fw_inet);
} }
else if (usage_mode == MODE_VIDEO)
{
showMoviePlayer(media);
}
else else
{ {
//audio player //audio player

View File

@@ -51,6 +51,7 @@ class CMediaPlayerMenu : public CMenuTarget
{ {
MODE_DEFAULT, MODE_DEFAULT,
MODE_AUDIO, MODE_AUDIO,
MODE_VIDEO
}; };
CMediaPlayerMenu(); CMediaPlayerMenu();