mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +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
|
//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
|
||||||
|
@@ -51,6 +51,7 @@ class CMediaPlayerMenu : public CMenuTarget
|
|||||||
{
|
{
|
||||||
MODE_DEFAULT,
|
MODE_DEFAULT,
|
||||||
MODE_AUDIO,
|
MODE_AUDIO,
|
||||||
|
MODE_VIDEO
|
||||||
};
|
};
|
||||||
|
|
||||||
CMediaPlayerMenu();
|
CMediaPlayerMenu();
|
||||||
|
Reference in New Issue
Block a user