--- src/audio/coreaudio/SDL_coreaudio.h +++ src/audio/coreaudio/SDL_coreaudio.h @@ -1,7 +1,7 @@ /* Simple DirectMedia Layer - Copyright (C) 1997-2025 Sam Lantinga + Copyright (C) 1997-2016 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. @@ -19,58 +19,39 @@ 3. This notice may not be removed or altered from any source distribution. */ #include "../../SDL_internal.h" -#ifndef SDL_coreaudio_h_ -#define SDL_coreaudio_h_ +#ifndef _SDL_coreaudio_h +#define _SDL_coreaudio_h #include "../SDL_sysaudio.h" #if !defined(__IPHONEOS__) -#define MACOSX_COREAUDIO +#define MACOSX_COREAUDIO 1 #endif -#ifdef MACOSX_COREAUDIO +#if MACOSX_COREAUDIO #include +#include #else -#import -#import +#include #endif -#include #include -/* Things named "Master" were renamed to "Main" in macOS 12.0's SDK. */ -#ifdef MACOSX_COREAUDIO -#include -#ifndef MAC_OS_VERSION_12_0 -#define kAudioObjectPropertyElementMain kAudioObjectPropertyElementMaster -#endif -#endif - /* Hidden "this" pointer for the audio functions */ -#define _THIS SDL_AudioDevice *this +#define _THIS SDL_AudioDevice *this struct SDL_PrivateAudioData { - SDL_Thread *thread; - AudioQueueRef audioQueue; - int numAudioBuffers; - AudioQueueBufferRef *audioBuffer; + AudioUnit audioUnit; + int audioUnitOpened; void *buffer; UInt32 bufferOffset; UInt32 bufferSize; - AudioStreamBasicDescription strdesc; - SDL_sem *ready_semaphore; - char *thread_error; -#ifdef MACOSX_COREAUDIO +#if MACOSX_COREAUDIO AudioDeviceID deviceID; - SDL_atomic_t device_change_flag; -#else - SDL_bool interrupted; - CFTypeRef interruption_listener; #endif }; -#endif /* SDL_coreaudio_h_ */ - +#endif /* _SDL_coreaudio_h */ /* vi: set ts=4 sw=4 expandtab: */