mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-02 02:11:04 +02:00
Various changes for reworked mute icon handling in some classes
- mute icon disabled for moviebrowser, upnpbrowser, pictureviewer
- extra handling for audioplayer
Origin commit data
------------------
Branch: ni/coolstream
Commit: bf1c7bfdb7
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2013-05-13 (Mon, 13 May 2013)
Origin message was:
------------------
* Various changes for reworked mute icon handling in some classes
- mute icon disabled for moviebrowser, upnpbrowser, pictureviewer
- extra handling for audioplayer
------------------
This commit was generated by Migit
This commit is contained in:
@@ -281,6 +281,8 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey)
|
||||
m_fheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight();
|
||||
|
||||
int iw, ih;
|
||||
m_frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_MUTE, &iw, &ih);
|
||||
m_theight = std::max(m_theight, ih+2);
|
||||
m_frameBuffer->getIconSize(NEUTRINO_ICON_MP3, &iw, &ih);
|
||||
m_theight = std::max(m_theight, ih+4);
|
||||
|
||||
@@ -899,6 +901,9 @@ int CAudioPlayerGui::show()
|
||||
ret = menu_return::RETURN_EXIT_ALL;
|
||||
loop = false;
|
||||
}
|
||||
// update mute icon
|
||||
paintHead();
|
||||
paintLCD();
|
||||
}
|
||||
}
|
||||
hide();
|
||||
@@ -1667,6 +1672,11 @@ void CAudioPlayerGui::paintHead()
|
||||
}
|
||||
//m_frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_MENU, m_x + m_width - 30, ypos);
|
||||
#endif
|
||||
if ( CNeutrinoApp::getInstance()->isMuted() )
|
||||
{
|
||||
m_frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_MUTE, &iw, &ih);
|
||||
m_frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_MUTE, xpos - iw, ypos, m_theight);
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
|
@@ -261,6 +261,7 @@ class CAudioPlayerGui : public CMenuTarget
|
||||
bool playNext(bool allow_rotate = false);
|
||||
bool playPrev(bool allow_rotate = false);
|
||||
int getAudioPlayerM_current() {return m_current;}
|
||||
void refreshMuteIcon() { paintHead(); }
|
||||
};
|
||||
|
||||
|
||||
|
@@ -38,6 +38,7 @@
|
||||
#include <neutrino_menue.h>
|
||||
#include <neutrinoMessages.h>
|
||||
|
||||
#include <gui/audiomute.h>
|
||||
#include <gui/movieplayer.h>
|
||||
#include <gui/pictureviewer.h>
|
||||
#if ENABLE_UPNP
|
||||
@@ -87,30 +88,35 @@ int CMediaPlayerMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
||||
if (parent)
|
||||
parent->hide();
|
||||
|
||||
CAudioMute *audiomute = CAudioMute::getInstance();
|
||||
if (actionKey == "audioplayer")
|
||||
{
|
||||
audiomute->enableMuteIcon(false);
|
||||
if (audioPlayer == NULL)
|
||||
audioPlayer = new CAudioPlayerGui();
|
||||
int res = audioPlayer->exec(NULL, "init");
|
||||
|
||||
audiomute->enableMuteIcon(true);
|
||||
return res /*menu_return::RETURN_REPAINT*/;
|
||||
}
|
||||
else if (actionKey == "inetplayer")
|
||||
{
|
||||
audiomute->enableMuteIcon(false);
|
||||
if (inetPlayer == NULL)
|
||||
inetPlayer = new CAudioPlayerGui(true);
|
||||
int res = inetPlayer->exec(NULL, "init");
|
||||
|
||||
audiomute->enableMuteIcon(true);
|
||||
return res; //menu_return::RETURN_REPAINT;
|
||||
}
|
||||
else if (actionKey == "movieplayer")
|
||||
{
|
||||
audiomute->enableMuteIcon(false);
|
||||
int mode = CNeutrinoApp::getInstance()->getMode();
|
||||
if( mode == NeutrinoMessages::mode_radio )
|
||||
videoDecoder->StopPicture();
|
||||
int res = CMoviePlayerGui::getInstance().exec(NULL, "tsmoviebrowser");
|
||||
if( mode == NeutrinoMessages::mode_radio )
|
||||
videoDecoder->ShowPicture(DATADIR "/neutrino/icons/radiomode.jpg");
|
||||
audiomute->enableMuteIcon(true);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@@ -63,6 +63,7 @@ class CMediaPlayerMenu : public CMenuTarget
|
||||
int exec(CMenuTarget* parent, const std::string & actionKey);
|
||||
void setMenuTitel(const neutrino_locale_t title = LOCALE_MAINMENU_MEDIA){menu_title = title;};
|
||||
void setUsageMode(const int& mm_mode = MODE_DEFAULT){usage_mode = mm_mode;};
|
||||
CAudioPlayerGui *getPlayerInstance() { if (audioPlayer != NULL) return audioPlayer; else if (inetPlayer != NULL) return inetPlayer; else return NULL; }
|
||||
};
|
||||
|
||||
|
||||
|
@@ -30,6 +30,7 @@
|
||||
#include <global.h>
|
||||
#include <neutrino.h>
|
||||
|
||||
#include <gui/audiomute.h>
|
||||
#include <gui/movieplayer.h>
|
||||
#include <gui/infoviewer.h>
|
||||
#include <gui/timeosd.h>
|
||||
@@ -484,6 +485,8 @@ void CMoviePlayerGui::PlayFile(void)
|
||||
}
|
||||
}
|
||||
|
||||
CAudioMute::getInstance()->enableMuteIcon(true);
|
||||
|
||||
while (playstate >= CMoviePlayerGui::PLAY)
|
||||
{
|
||||
if (update_lcd) {
|
||||
@@ -717,6 +720,8 @@ void CMoviePlayerGui::PlayFile(void)
|
||||
|
||||
restoreNeutrino();
|
||||
|
||||
CAudioMute::getInstance()->enableMuteIcon(false);
|
||||
|
||||
if (g_settings.mode_clock)
|
||||
InfoClock->StartClock();
|
||||
}
|
||||
|
@@ -44,6 +44,7 @@
|
||||
#include <driver/fontrenderer.h>
|
||||
#include <driver/rcinput.h>
|
||||
|
||||
#include <gui/audiomute.h>
|
||||
#include <gui/nfs.h>
|
||||
|
||||
#include <gui/widget/buttons.h>
|
||||
@@ -238,6 +239,8 @@ int CPictureViewerGui::show()
|
||||
if (audioplayer)
|
||||
m_currentTitle = m_audioPlayer->getAudioPlayerM_current();
|
||||
|
||||
CAudioMute::getInstance()->enableMuteIcon(false);
|
||||
|
||||
while (loop)
|
||||
{
|
||||
if (update)
|
||||
@@ -618,6 +621,8 @@ int CPictureViewerGui::show()
|
||||
}
|
||||
hide();
|
||||
|
||||
CAudioMute::getInstance()->enableMuteIcon(true);
|
||||
|
||||
return(res);
|
||||
}
|
||||
|
||||
|
@@ -52,6 +52,7 @@
|
||||
|
||||
#include <daemonc/remotecontrol.h>
|
||||
|
||||
#include <gui/audiomute.h>
|
||||
#include <gui/eventlist.h>
|
||||
#include <gui/color.h>
|
||||
#include <gui/infoviewer.h>
|
||||
@@ -396,6 +397,8 @@ void CUpnpBrowserGui::selectDevice()
|
||||
return;
|
||||
}
|
||||
|
||||
CAudioMute::getInstance()->enableMuteIcon(false);
|
||||
|
||||
while (loop)
|
||||
{
|
||||
if (changed)
|
||||
@@ -488,6 +491,8 @@ void CUpnpBrowserGui::selectDevice()
|
||||
}
|
||||
}
|
||||
delete scanBox;
|
||||
|
||||
CAudioMute::getInstance()->enableMuteIcon(true);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user