3 * Copyright (C) 2005-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/>.
22 #include "cores/AudioEngine/Interfaces/AESink.h"
23 #include "cores/AudioEngine/Utils/AEDeviceInfo.h"
25 #define DO_440HZ_TONE_TEST 0
27 #if DO_440HZ_TONE_TEST
35 class CAAudioUnitSink;
37 class CAESinkDARWINIOS : public IAESink
40 virtual const char *GetName() { return "DARWINIOS"; }
43 virtual ~CAESinkDARWINIOS();
45 virtual bool Initialize(AEAudioFormat &format, std::string &device);
46 virtual void Deinitialize();
47 virtual bool IsCompatible(const AEAudioFormat &format, const std::string &device);
49 virtual double GetDelay ();
50 virtual double GetCacheTotal ();
51 virtual unsigned int AddPackets (uint8_t *data, unsigned int frames, bool hasAudio, bool blocking = false);
52 virtual void Drain ();
53 virtual bool HasVolume ();
54 virtual void SetVolume (float scale);
55 static void EnumerateDevicesEx(AEDeviceInfoList &list, bool force = false);
58 static AEDeviceInfoList m_devices;
60 AEAudioFormat m_format;
62 bool m_volume_changed;
64 CAAudioUnitSink *m_audioSink;
65 #if DO_440HZ_TONE_TEST
66 SineWaveGenerator m_SineWaveGenerator;