mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 08:21:12 +02:00
*neutrino mediaplayer: remember audio- and internetplayer contents
create and hold the audio player objects while runtime git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1128 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
@@ -242,8 +242,12 @@ CAudioPlayerGui::~CAudioPlayerGui()
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &)
|
||||
int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey)
|
||||
{
|
||||
|
||||
if (actionKey == "init")
|
||||
Init();
|
||||
|
||||
CNeutrinoApp::getInstance()->StopSubtitles();
|
||||
|
||||
CAudioPlayer::getInstance()->init();
|
||||
|
@@ -36,7 +36,7 @@
|
||||
#include <global.h>
|
||||
#include <neutrino.h>
|
||||
|
||||
#include "gui/audioplayer.h"
|
||||
|
||||
#include "gui/movieplayer.h"
|
||||
#include "gui/pictureviewer.h"
|
||||
#include "gui/upnpbrowser.h"
|
||||
@@ -48,7 +48,6 @@
|
||||
#include <system/debug.h>
|
||||
|
||||
|
||||
|
||||
CMediaPlayerMenu::CMediaPlayerMenu()
|
||||
{
|
||||
frameBuffer = CFrameBuffer::getInstance();
|
||||
@@ -64,6 +63,9 @@ CMediaPlayerMenu::CMediaPlayerMenu()
|
||||
|
||||
x = getScreenStartX (width);
|
||||
y = getScreenStartY (height);
|
||||
|
||||
audioPlayer = NULL;
|
||||
inetPlayer = NULL;
|
||||
}
|
||||
|
||||
CMediaPlayerMenu* CMediaPlayerMenu::getInstance()
|
||||
@@ -79,10 +81,11 @@ CMediaPlayerMenu* CMediaPlayerMenu::getInstance()
|
||||
|
||||
CMediaPlayerMenu::~CMediaPlayerMenu()
|
||||
{
|
||||
|
||||
delete audioPlayer ;
|
||||
delete inetPlayer ;
|
||||
}
|
||||
|
||||
int CMediaPlayerMenu::exec(CMenuTarget* parent, const std::string &/*actionKey*/)
|
||||
int CMediaPlayerMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
||||
{
|
||||
printf("init mediaplayer menu in usage mode %d\n", usage_mode);
|
||||
int res = menu_return::RETURN_REPAINT;
|
||||
@@ -90,6 +93,23 @@ int CMediaPlayerMenu::exec(CMenuTarget* parent, const std::string &/*actionKey*/
|
||||
if (parent)
|
||||
parent->hide();
|
||||
|
||||
if (actionKey == "audioplayer")
|
||||
{
|
||||
if (audioPlayer == NULL)
|
||||
audioPlayer = new CAudioPlayerGui();
|
||||
audioPlayer->exec(NULL, "init");
|
||||
|
||||
return res;
|
||||
}
|
||||
else if (actionKey == "inetplayer")
|
||||
{
|
||||
if (inetPlayer == NULL)
|
||||
inetPlayer = new CAudioPlayerGui(true);
|
||||
inetPlayer->exec(NULL, "init");
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
showMenu();
|
||||
|
||||
return res;
|
||||
@@ -110,12 +130,12 @@ void CMediaPlayerMenu::showMenu()
|
||||
//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, new CAudioPlayerGui(), NULL, audio_rc, audio_btn);
|
||||
CMenuForwarder * 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;
|
||||
CMenuForwarder * fw_inet = new CMenuForwarder(LOCALE_INETRADIO_NAME, true, NULL, new CAudioPlayerGui(true), NULL, inet_rc, inet_btn);
|
||||
CMenuForwarder * fw_inet = new CMenuForwarder(LOCALE_INETRADIO_NAME, true, NULL, this, "inetplayer", inet_rc, inet_btn);
|
||||
|
||||
//movieplayer
|
||||
CMenuWidget *moviePlayer = new CMenuWidget(LOCALE_MAINMENU_MEDIA, NEUTRINO_ICON_MULTIMEDIA, width);
|
||||
|
@@ -30,7 +30,7 @@
|
||||
#define __MEDIAPLAYER__
|
||||
|
||||
#include <gui/widget/menue.h>
|
||||
|
||||
#include "gui/audioplayer.h"
|
||||
#include <driver/framebuffer.h>
|
||||
|
||||
#include <string>
|
||||
@@ -39,6 +39,8 @@ class CMediaPlayerMenu : public CMenuTarget
|
||||
{
|
||||
private:
|
||||
CFrameBuffer *frameBuffer;
|
||||
CAudioPlayerGui *audioPlayer;
|
||||
CAudioPlayerGui *inetPlayer;
|
||||
|
||||
int x, y, width, height, hheight, mheight, selected, usage_mode;
|
||||
neutrino_locale_t menu_title;
|
||||
|
Reference in New Issue
Block a user