diff options
Diffstat (limited to 'guilib')
-rw-r--r-- | guilib/GUIDialog.cpp | 9 | ||||
-rw-r--r-- | guilib/GUIDialog.h | 3 |
2 files changed, 9 insertions, 3 deletions
diff --git a/guilib/GUIDialog.cpp b/guilib/GUIDialog.cpp index 2c114d5a65..dbd1988743 100644 --- a/guilib/GUIDialog.cpp +++ b/guilib/GUIDialog.cpp @@ -35,6 +35,7 @@ CGUIDialog::CGUIDialog(int id, const CStdString &xmlFile) m_dialogClosing = false; m_renderOrder = 1; m_autoClosing = false; + m_enableSound = true; } CGUIDialog::~CGUIDialog(void) @@ -116,7 +117,7 @@ void CGUIDialog::Close_Internal(bool forceClose /*= false*/) if (!m_bRunning) return; // Play the window specific deinit sound - if(!m_dialogClosing) + if(!m_dialogClosing && m_enableSound) g_audioManager.PlayWindowSound(GetID(), SOUND_DEINIT); // don't close if we should be animating @@ -150,7 +151,8 @@ void CGUIDialog::DoModal_Internal(int iWindowID /*= WINDOW_INVALID */, const CSt g_windowManager.RouteToWindow(this); // Play the window specific init sound - g_audioManager.PlayWindowSound(GetID(), SOUND_INIT); + if (m_enableSound) + g_audioManager.PlayWindowSound(GetID(), SOUND_INIT); // active this window... CGUIMessage msg(GUI_MSG_WINDOW_INIT, 0, 0, WINDOW_INVALID, iWindowID); @@ -189,7 +191,8 @@ void CGUIDialog::Show_Internal() g_windowManager.AddModeless(this); // Play the window specific init sound - g_audioManager.PlayWindowSound(GetID(), SOUND_INIT); + if (m_enableSound) + g_audioManager.PlayWindowSound(GetID(), SOUND_INIT); // active this window... CGUIMessage msg(GUI_MSG_WINDOW_INIT, 0, 0); diff --git a/guilib/GUIDialog.h b/guilib/GUIDialog.h index 6b54e31a48..3213513759 100644 --- a/guilib/GUIDialog.h +++ b/guilib/GUIDialog.h @@ -56,6 +56,8 @@ public: virtual bool IsAnimating(ANIMATION_TYPE animType); void SetAutoClose(unsigned int timeoutMs); + void SetSound(bool OnOff) { m_enableSound = OnOff; }; + protected: virtual bool RenderAnimation(unsigned int time); virtual void SetDefaults(); @@ -70,6 +72,7 @@ protected: bool m_bModal; bool m_dialogClosing; bool m_autoClosing; + bool m_enableSound; unsigned int m_showStartTime; unsigned int m_showDuration; }; |