mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-24 11:16:51 +00:00
xbmc: add PR4491
Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
parent
7d05538142
commit
c9448648fe
103
packages/mediacenter/xbmc/patches/xbmc-999.80.008-PR4491.patch
Normal file
103
packages/mediacenter/xbmc/patches/xbmc-999.80.008-PR4491.patch
Normal file
@ -0,0 +1,103 @@
|
||||
From 9707c09eb7a14c66a8f1fcacce1ca76c640aa441 Mon Sep 17 00:00:00 2001
|
||||
From: ruuk <xbmc@2ndmind.net>
|
||||
Date: Sun, 30 Mar 2014 11:22:23 -0700
|
||||
Subject: [PATCH] Added optional parameter 'ignoreCache' to xbmc.playSFX()
|
||||
Added parameter 'ignoreCache' to g_audioManager.PlayPythonSound() When
|
||||
ignoreCache is true, PlayPythonSound no frees any matching cached sound
|
||||
before continuing
|
||||
|
||||
---
|
||||
xbmc/guilib/GUIAudioManager.cpp | 14 +++++++++++---
|
||||
xbmc/guilib/GUIAudioManager.h | 2 +-
|
||||
xbmc/interfaces/legacy/ModuleXbmc.cpp | 4 ++--
|
||||
xbmc/interfaces/legacy/ModuleXbmc.h | 3 ++-
|
||||
4 files changed, 16 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/xbmc/guilib/GUIAudioManager.cpp b/xbmc/guilib/GUIAudioManager.cpp
|
||||
index aeb83a6..d0893e7 100644
|
||||
--- a/xbmc/guilib/GUIAudioManager.cpp
|
||||
+++ b/xbmc/guilib/GUIAudioManager.cpp
|
||||
@@ -131,7 +131,7 @@ void CGUIAudioManager::PlayWindowSound(int id, WINDOW_SOUND event)
|
||||
}
|
||||
|
||||
// \brief Play a sound given by filename
|
||||
-void CGUIAudioManager::PlayPythonSound(const CStdString& strFileName)
|
||||
+void CGUIAudioManager::PlayPythonSound(const CStdString& strFileName, bool ignoreCache)
|
||||
{
|
||||
CSingleLock lock(m_cs);
|
||||
|
||||
@@ -144,8 +144,16 @@ void CGUIAudioManager::PlayPythonSound(const CStdString& strFileName)
|
||||
if (itsb != m_pythonSounds.end())
|
||||
{
|
||||
IAESound* sound = itsb->second;
|
||||
- sound->Play();
|
||||
- return;
|
||||
+ if (ignoreCache)
|
||||
+ {
|
||||
+ FreeSound(sound);
|
||||
+ m_pythonSounds.erase(itsb);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ sound->Play();
|
||||
+ return;
|
||||
+ }
|
||||
}
|
||||
|
||||
IAESound *sound = LoadSound(strFileName);
|
||||
diff --git a/xbmc/guilib/GUIAudioManager.h b/xbmc/guilib/GUIAudioManager.h
|
||||
index ab0d965..a38f579 100644
|
||||
--- a/xbmc/guilib/GUIAudioManager.h
|
||||
+++ b/xbmc/guilib/GUIAudioManager.h
|
||||
@@ -66,7 +66,7 @@ class CGUIAudioManager : public ISettingCallback
|
||||
|
||||
void PlayActionSound(const CAction& action);
|
||||
void PlayWindowSound(int id, WINDOW_SOUND event);
|
||||
- void PlayPythonSound(const CStdString& strFileName);
|
||||
+ void PlayPythonSound(const CStdString& strFileName, bool ignoreCache);
|
||||
|
||||
void Enable(bool bEnable);
|
||||
void SetVolume(float level);
|
||||
diff --git a/xbmc/interfaces/legacy/ModuleXbmc.cpp b/xbmc/interfaces/legacy/ModuleXbmc.cpp
|
||||
index 6507155..28a865f 100644
|
||||
--- a/xbmc/interfaces/legacy/ModuleXbmc.cpp
|
||||
+++ b/xbmc/interfaces/legacy/ModuleXbmc.cpp
|
||||
@@ -325,7 +325,7 @@
|
||||
return g_infoManager.GetImage(ret, WINDOW_INVALID);
|
||||
}
|
||||
|
||||
- void playSFX(const char* filename)
|
||||
+ void playSFX(const char* filename, bool ignoreCache)
|
||||
{
|
||||
XBMC_TRACE;
|
||||
if (!filename)
|
||||
@@ -333,7 +333,7 @@
|
||||
|
||||
if (XFILE::CFile::Exists(filename))
|
||||
{
|
||||
- g_audioManager.PlayPythonSound(filename);
|
||||
+ g_audioManager.PlayPythonSound(filename,ignoreCache);
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/xbmc/interfaces/legacy/ModuleXbmc.h b/xbmc/interfaces/legacy/ModuleXbmc.h
|
||||
index f26fa93..35c20e3 100644
|
||||
--- a/xbmc/interfaces/legacy/ModuleXbmc.h
|
||||
+++ b/xbmc/interfaces/legacy/ModuleXbmc.h
|
||||
@@ -223,11 +223,12 @@
|
||||
* playSFX(filename) -- Plays a wav file by filename
|
||||
*
|
||||
* filename : string - filename of the wav file to play.
|
||||
+ * ignoreCache : [opt] bool - True = Ignores any previously cached wav associated with filename
|
||||
*
|
||||
* example:
|
||||
* - xbmc.playSFX('special://xbmc/scripts/dingdong.wav')
|
||||
*/
|
||||
- void playSFX(const char* filename);
|
||||
+ void playSFX(const char* filename, bool ignoreCache = false);
|
||||
|
||||
/**
|
||||
* stopSFX() -- Stops wav file
|
||||
--
|
||||
1.9.1
|
||||
|
Loading…
x
Reference in New Issue
Block a user