| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 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) |