11#ifndef INCGUARD_MGL_AUDIO_RENDERER_APPLE_COREAUDIO_H_1610829971
12#define INCGUARD_MGL_AUDIO_RENDERER_APPLE_COREAUDIO_H_1610829971
15#if defined(MGL_AUDIO_RENDERER_ENABLE_APPLE_COREAUDIO)
17#include <AudioToolbox/AudioToolbox.h>
26class AppleCoreAudioRenderer :
public Renderer
29 AppleCoreAudioRenderer() noexcept;
31 virtual ~AppleCoreAudioRenderer() noexcept;
33 bool Initialize(InitializeMode initMode, RenderingFunction rendering) noexcept override;
36 std::atomic<
bool> _isInitialize;
37 Event::Handle _eventSuspend;
38 Event::Handle _eventResume;
39 AudioStreamBasicDescription _outputFormatASBD;
42 static OSStatus renderCallback(
44 AudioUnitRenderActionFlags *ioActionFlags,
45 const AudioTimeStamp *inTimeStamp,
47 UInt32 inNumberFrames,
48 AudioBufferList *ioData) noexcept;
50 static
void OnEventSuspend(
void *callbackArg,
void *notifyArg) noexcept;
51 static
void OnEventResume(
void *callbackArg,
void *notifyArg) noexcept;