mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 08:21:12 +02:00
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:
@@ -110,31 +110,44 @@ int CMediaPlayerMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
||||
//show selectable mediaplayer items
|
||||
void CMediaPlayerMenu::showMenu()
|
||||
{
|
||||
//menue init
|
||||
CMenuWidget *media = new CMenuWidget(menu_title, NEUTRINO_ICON_MULTIMEDIA, width);
|
||||
media->setSelected(selected);
|
||||
|
||||
//audio player
|
||||
neutrino_msg_t audio_rc = usage_mode == MODE_AUDIO ? CRCInput::RC_audio:CRCInput::RC_red;
|
||||
const char* audio_btn = usage_mode == MODE_AUDIO ? "" : NEUTRINO_ICON_BUTTON_RED;
|
||||
CMenuForwarder * fw_audio = new CMenuForwarder(LOCALE_MAINMENU_AUDIOPLAYER, true, NULL, this, "audioplayer", audio_rc, audio_btn);
|
||||
CMenuForwarder *fw_audio = NULL;
|
||||
CMenuForwarder *fw_inet = NULL;
|
||||
CMenuForwarder *fw_mp = NULL;
|
||||
CMenuForwarder *fw_pviewer = NULL;
|
||||
CMenuForwarder *fw_upnp = NULL;
|
||||
CMenuWidget *moviePlayer = NULL;
|
||||
|
||||
//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;
|
||||
CMenuForwarder * fw_inet = new CMenuForwarder(LOCALE_INETRADIO_NAME, true, NULL, this, "inetplayer", inet_rc, inet_btn);
|
||||
if (usage_mode != MODE_VIDEO)
|
||||
{
|
||||
//menue init
|
||||
media->setSelected(selected);
|
||||
|
||||
//movieplayer
|
||||
CMenuWidget *moviePlayer = new CMenuWidget(LOCALE_MAINMENU_MEDIA, NEUTRINO_ICON_MULTIMEDIA, width);
|
||||
CMenuForwarder * fw_mp = new CMenuForwarder(LOCALE_MAINMENU_MOVIEPLAYER, true, NULL, moviePlayer, NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW);
|
||||
//audio player
|
||||
neutrino_msg_t audio_rc = usage_mode == MODE_AUDIO ? CRCInput::RC_audio:CRCInput::RC_red;
|
||||
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
|
||||
CMenuForwarder * fw_pviewer = new CMenuForwarder(LOCALE_MAINMENU_PICTUREVIEWER, true, NULL, new CPictureViewerGui(), NULL, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE);
|
||||
if (usage_mode == MODE_DEFAULT)
|
||||
{
|
||||
//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
|
||||
CMenuForwarder * fw_upnp = new CMenuForwarder(LOCALE_UPNPBROWSER_HEAD, true, NULL, new CUpnpBrowserGui(), NULL, CRCInput::RC_0, NEUTRINO_ICON_BUTTON_0);
|
||||
//pictureviewer
|
||||
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)
|
||||
{
|
||||
@@ -144,6 +157,10 @@ void CMediaPlayerMenu::showMenu()
|
||||
//internet player
|
||||
media->addItem(fw_inet);
|
||||
}
|
||||
else if (usage_mode == MODE_VIDEO)
|
||||
{
|
||||
showMoviePlayer(media);
|
||||
}
|
||||
else
|
||||
{
|
||||
//audio player
|
||||
|
@@ -51,6 +51,7 @@ class CMediaPlayerMenu : public CMenuTarget
|
||||
{
|
||||
MODE_DEFAULT,
|
||||
MODE_AUDIO,
|
||||
MODE_VIDEO
|
||||
};
|
||||
|
||||
CMediaPlayerMenu();
|
||||
|
Reference in New Issue
Block a user