4 * Copyright (C) 2005-2013 Team XBMC
7 * This Program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2, or (at your option)
12 * This Program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with XBMC; see the file COPYING. If not, see
19 * <http://www.gnu.org/licenses/>.
25 #include "cores/AudioEngine/Interfaces/AESound.h"
26 #include "settings/lib/ISettingCallback.h"
27 #include "threads/CriticalSection.h"
28 #include "utils/log.h"
29 #include "utils/StdString.h"
31 // forward definitions
36 enum WINDOW_SOUND { SOUND_INIT = 0, SOUND_DEINIT };
38 class CGUIAudioManager : public ISettingCallback
44 IAESound *deInitSound;
58 virtual void OnSettingChanged(const CSetting *setting);
67 void PlayActionSound(const CAction& action);
68 void PlayWindowSound(int id, WINDOW_SOUND event);
69 void PlayPythonSound(const CStdString& strFileName);
71 void Enable(bool bEnable);
72 void SetVolume(float level);
75 typedef std::map<const CStdString, CSoundInfo> soundCache;
76 typedef std::map<int, IAESound* > actionSoundMap;
77 typedef std::map<int, CWindowSounds > windowSoundMap;
78 typedef std::map<const CStdString, IAESound* > pythonSoundsMap;
80 soundCache m_soundCache;
81 actionSoundMap m_actionSoundMap;
82 windowSoundMap m_windowSoundMap;
83 pythonSoundsMap m_pythonSounds;
85 CStdString m_strMediaDir;
88 CCriticalSection m_cs;
90 IAESound* LoadSound(const CStdString &filename);
91 void FreeSound(IAESound *sound);
92 IAESound* LoadWindowSound(TiXmlNode* pWindowNode, const CStdString& strIdentifier);
95 extern CGUIAudioManager g_audioManager;