Debian Codegraph @

components/output/coreaudio/coreaudio.h

raw symbols SCIP
1 /* BoCA - BonkEnc Component Architecture
2 * Copyright (C) 2007-2015 Robert Kausch <[email protected]>
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation, either version 2 of
7 * the License, or (at your option) any later version.
8 *
9 * THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
10 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
11 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */
12
13 #include <boca.h>
14
15 BoCA_BEGIN_COMPONENT(OutputCoreAudio)
16
17 namespace BoCA
18 {
19 class OutputCoreAudio : public CS::OutputComponent
20 {
21 friend CA::OSStatus AudioCallback(void *, CA::AudioUnitRenderActionFlags *, const CA::AudioTimeStamp *, CA::UInt32, CA::UInt32, CA::AudioBufferList *);
22
23 private:
24 CA::AudioUnit audioUnit;
25 Bool paused;
26
27 Buffer<UnsignedByte> samplesBuffer;
28
29 Threads::Mutex *samplesBufferMutex;
30 public:
31 static const String &GetComponentSpecs();
32
33 OutputCoreAudio();
34 ~OutputCoreAudio();
35
36 Bool Activate();
37 Bool Deactivate();
38
39 Int WriteData(Buffer<UnsignedByte> &);
40
41 Int CanWrite();
42
43 Int SetPause(Bool);
44 Bool IsPlaying();
45 };
46 };
47
48 BoCA_DEFINE_OUTPUT_COMPONENT(OutputCoreAudio)
49
50 BoCA_END_COMPONENT(OutputCoreAudio)