3 * Copyright (C) 2010-2013 Team XBMC
6 * This Program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
11 * This Program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with XBMC; see the file COPYING. If not, see
18 * <http://www.gnu.org/licenses/>.
24 #include "Interfaces/AE.h"
25 #include "threads/Thread.h"
40 static IAE *GetEngine();
41 static bool LoadEngine();
42 static void UnLoadEngine();
43 static bool StartEngine();
44 static bool Suspend(); /** Suspends output and de-initializes output sink - used for external players or power saving */
45 static bool Resume(); /** Resumes output after Suspend - re-initializes sink */
46 static bool IsSuspended(); /** Returns true if output has been suspended */
47 /* wrap engine interface */
48 static IAESound *MakeSound(const std::string &file);
49 static void FreeSound(IAESound *sound);
50 static void SetSoundMode(const int mode);
51 static void OnSettingsChange(std::string setting);
52 static void EnumerateOutputDevices(AEDeviceList &devices, bool passthrough);
53 static void VerifyOutputDevice(std::string &device, bool passthrough);
54 static std::string GetDefaultDevice(bool passthrough);
55 static bool SupportsRaw(AEDataFormat format);
56 static bool SupportsSilenceTimeout();
59 * Returns true if current AudioEngine supports at lest two basic quality levels
60 * @return true if quality setting is supported, otherwise false
62 static bool SupportsQualitySetting(void);
63 static void SetMute(const bool enabled);
64 static bool IsMuted();
65 static float GetVolume();
66 static void SetVolume(const float volume);
67 static void Shutdown();
68 static IAEStream *MakeStream(enum AEDataFormat dataFormat, unsigned int sampleRate,
69 unsigned int encodedSampleRate, CAEChannelInfo channelLayout, unsigned int options = 0);
70 static IAEStream *FreeStream(IAEStream *stream);
71 static void GarbageCollect();
73 static void SettingOptionsAudioDevicesFiller(const CSetting *setting, std::vector< std::pair<std::string, std::string> > &list, std::string ¤t);
74 static void SettingOptionsAudioDevicesPassthroughFiller(const CSetting *setting, std::vector< std::pair<std::string, std::string> > &list, std::string ¤t);
75 static void SettingOptionsAudioQualityLevelsFiller(const CSetting *setting, std::vector< std::pair<std::string, int> > &list, int ¤t);
76 static void SettingOptionsAudioStreamsilenceFiller(const CSetting *setting, std::vector< std::pair<std::string, int> > &list, int ¤t);
77 static bool IsSettingVisible(const std::string &condition, const std::string &value, const std::string &settingId);
78 static void KeepConfiguration(unsigned int millis);
79 static void DeviceChange();
81 static void RegisterAudioCallback(IAudioCallback* pCallback);
82 static void UnregisterAudioCallback();
85 static bool LoadEngine(enum AEEngine engine);
88 static void SettingOptionsAudioDevicesFillerGeneral(const CSetting *setting, std::vector< std::pair<std::string, std::string> > &list, std::string ¤t, bool passthrough);