MGL(Win32)
読み取り中…
検索中…
一致する文字列を見つけられません
mgl_audio_renderer_apple_coreaudio.h
[詳解]
1// SPDX-License-Identifier: Zlib
2/* ------------------------------------------------------------------------- */
9/* ------------------------------------------------------------------------- */
10
11#ifndef INCGUARD_MGL_AUDIO_RENDERER_APPLE_COREAUDIO_H_1610829971
12#define INCGUARD_MGL_AUDIO_RENDERER_APPLE_COREAUDIO_H_1610829971
13
14#include <mgl/mgl_environment.h>
15#if defined(MGL_AUDIO_RENDERER_ENABLE_APPLE_COREAUDIO)
16
17#include <AudioToolbox/AudioToolbox.h>
18#include <atomic>
19
21#include <mgl/event/mgl_event.h>
22
23namespace MGL::Audio
24{
26class AppleCoreAudioRenderer : public Renderer
27{
28public:
29 AppleCoreAudioRenderer() noexcept;
30
31 virtual ~AppleCoreAudioRenderer() noexcept;
32
33 bool Initialize(InitializeMode initMode, RenderingFunction rendering) noexcept override;
34
35private:
36 std::atomic<bool> _isInitialize;
37 Event::Handle _eventSuspend;
38 Event::Handle _eventResume;
39 AudioStreamBasicDescription _outputFormatASBD;
40 AudioUnit _outUnit;
41
42 static OSStatus renderCallback(
43 void *inRefCon,
44 AudioUnitRenderActionFlags *ioActionFlags,
45 const AudioTimeStamp *inTimeStamp,
46 UInt32 inBusNumber,
47 UInt32 inNumberFrames,
48 AudioBufferList *ioData) noexcept;
49
50 static void OnEventSuspend(void *callbackArg, void *notifyArg) noexcept;
51 static void OnEventResume(void *callbackArg, void *notifyArg) noexcept;
52};
53
54} // namespace MGL::Audio
55
56#endif // MGL_AUDIO_RENDERER_ENABLE_APPLE_COREAUDIO
57#endif // INCGUARD_MGL_AUDIO_RENDERER_APPLE_COREAUDIO_H_1610829971
58
59// vim: et ts=4 sw=4 sts=4
MGL オーディオレンダラ
MGL 環境定義
MGL イベント