diff --git a/src/driver/volume.cpp b/src/driver/volume.cpp index 73c3cff88..c6c395586 100644 --- a/src/driver/volume.cpp +++ b/src/driver/volume.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include @@ -117,6 +118,11 @@ void CVolume::setVolume(const neutrino_msg_t key, bool nowait) volscale = NULL; } CAudioMute::getInstance()->AudioMute(false, true); + if (mode == CNeutrinoApp::mode_audio) { + CAudioPlayerGui *cap = CMediaPlayerMenu::getInstance()->getPlayerInstance(); + if (cap != NULL) + cap->refreshMuteIcon(); + } setVolume(msg); return; } @@ -138,6 +144,11 @@ void CVolume::setVolume(const neutrino_msg_t key, bool nowait) volscale = NULL; } CAudioMute::getInstance()->AudioMute(true, true); + if (mode == CNeutrinoApp::mode_audio) { + CAudioPlayerGui *cap = CMediaPlayerMenu::getInstance()->getPlayerInstance(); + if (cap != NULL) + cap->refreshMuteIcon(); + } setVolume(msg); return; } diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 3597915ff..8f2077a9e 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -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); + } } //------------------------------------------------------------------------ diff --git a/src/gui/audioplayer.h b/src/gui/audioplayer.h index 74284ed4a..8ed6eb5f8 100644 --- a/src/gui/audioplayer.h +++ b/src/gui/audioplayer.h @@ -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(); } }; diff --git a/src/gui/mediaplayer.cpp b/src/gui/mediaplayer.cpp index b7998ca51..b120e528d 100644 --- a/src/gui/mediaplayer.cpp +++ b/src/gui/mediaplayer.cpp @@ -38,6 +38,7 @@ #include #include +#include #include #include #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; } diff --git a/src/gui/mediaplayer.h b/src/gui/mediaplayer.h index a52199d8b..e2b6710d7 100644 --- a/src/gui/mediaplayer.h +++ b/src/gui/mediaplayer.h @@ -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; } }; diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 1250969a8..b9d04a81c 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -30,6 +30,7 @@ #include #include +#include #include #include #include @@ -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(); } diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index f281f9bc7..5830d25cd 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -44,6 +44,7 @@ #include #include +#include #include #include @@ -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); } diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index c6df7735f..ff780b4c0 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -52,6 +52,7 @@ #include +#include #include #include #include @@ -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); } //------------------------------------------------------------------------ diff --git a/src/neutrino.cpp b/src/neutrino.cpp index a8d39c17d..20bfdebd6 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2047,9 +2047,6 @@ void CNeutrinoApp::RealRun(CMenuWidget &mainMenu) //if(!g_settings.cacheTXT) // tuxtxt_stop(); g_RCInput->clearRCMsg(); - // restore mute symbol - if (current_muted) - g_audioMute->AudioMute(current_muted, true); if(g_settings.mode_clock) InfoClock->StartClock(); StartSubtitles(); @@ -2060,9 +2057,6 @@ void CNeutrinoApp::RealRun(CMenuWidget &mainMenu) if(g_settings.mode_clock) InfoClock->StopClock(); mainMenu.exec(NULL, ""); - // restore mute symbol - if (current_muted) - g_audioMute->AudioMute(current_muted, true); if(g_settings.mode_clock) InfoClock->StartClock(); StartSubtitles(); @@ -2381,9 +2375,6 @@ _show: nNewChannel = bouquetList->Bouquets[old_b]->channelList->exec();//with ZAP! else nNewChannel = bouquetList->exec(true); - // restore mute symbol - if (current_muted) - g_audioMute->AudioMute(current_muted, true); } else if(msg == CRCInput::RC_sat) { SetChannelMode(LIST_MODE_SAT); nNewChannel = bouquetList->exec(true);