Remove: [OSX] Support for the pre-10.5 audio/music APIs.
This commit is contained in:
@@ -68,49 +68,22 @@ const char *SoundDriver_Cocoa::Start(const char * const *parm)
|
||||
|
||||
MxInitialize((uint)requestedDesc.mSampleRate);
|
||||
|
||||
#if defined(__AUDIOCOMPONENT_H__) || defined(HAVE_OSX_107_SDK)
|
||||
if (MacOSVersionIsAtLeast(10, 6, 0)) {
|
||||
/* Locate the default output audio unit */
|
||||
AudioComponentDescription desc;
|
||||
desc.componentType = kAudioUnitType_Output;
|
||||
desc.componentSubType = kAudioUnitSubType_HALOutput;
|
||||
desc.componentManufacturer = kAudioUnitManufacturer_Apple;
|
||||
desc.componentFlags = 0;
|
||||
desc.componentFlagsMask = 0;
|
||||
/* Locate the default output audio unit */
|
||||
AudioComponentDescription desc;
|
||||
desc.componentType = kAudioUnitType_Output;
|
||||
desc.componentSubType = kAudioUnitSubType_HALOutput;
|
||||
desc.componentManufacturer = kAudioUnitManufacturer_Apple;
|
||||
desc.componentFlags = 0;
|
||||
desc.componentFlagsMask = 0;
|
||||
|
||||
AudioComponent comp = AudioComponentFindNext (nullptr, &desc);
|
||||
if (comp == nullptr) {
|
||||
return "cocoa_s: Failed to start CoreAudio: AudioComponentFindNext returned nullptr";
|
||||
}
|
||||
AudioComponent comp = AudioComponentFindNext (nullptr, &desc);
|
||||
if (comp == nullptr) {
|
||||
return "cocoa_s: Failed to start CoreAudio: AudioComponentFindNext returned nullptr";
|
||||
}
|
||||
|
||||
/* Open & initialize the default output audio unit */
|
||||
if (AudioComponentInstanceNew(comp, &_outputAudioUnit) != noErr) {
|
||||
return "cocoa_s: Failed to start CoreAudio: AudioComponentInstanceNew";
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
#if (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6)
|
||||
/* Locate the default output audio unit */
|
||||
ComponentDescription desc;
|
||||
desc.componentType = kAudioUnitType_Output;
|
||||
desc.componentSubType = kAudioUnitSubType_HALOutput;
|
||||
desc.componentManufacturer = kAudioUnitManufacturer_Apple;
|
||||
desc.componentFlags = 0;
|
||||
desc.componentFlagsMask = 0;
|
||||
|
||||
Component comp = FindNextComponent (nullptr, &desc);
|
||||
if (comp == nullptr) {
|
||||
return "cocoa_s: Failed to start CoreAudio: FindNextComponent returned nullptr";
|
||||
}
|
||||
|
||||
/* Open & initialize the default output audio unit */
|
||||
if (OpenAComponent(comp, &_outputAudioUnit) != noErr) {
|
||||
return "cocoa_s: Failed to start CoreAudio: OpenAComponent";
|
||||
}
|
||||
#else
|
||||
return "cocoa_s: Not supported on this OS X version";
|
||||
#endif
|
||||
/* Open & initialize the default output audio unit */
|
||||
if (AudioComponentInstanceNew(comp, &_outputAudioUnit) != noErr) {
|
||||
return "cocoa_s: Failed to start CoreAudio: AudioComponentInstanceNew";
|
||||
}
|
||||
|
||||
if (AudioUnitInitialize(_outputAudioUnit) != noErr) {
|
||||
@@ -157,21 +130,9 @@ void SoundDriver_Cocoa::Stop()
|
||||
return;
|
||||
}
|
||||
|
||||
#if defined(__AUDIOCOMPONENT_H__) || defined(HAVE_OSX_107_SDK)
|
||||
if (MacOSVersionIsAtLeast(10, 6, 0)) {
|
||||
if (AudioComponentInstanceDispose(_outputAudioUnit) != noErr) {
|
||||
DEBUG(driver, 0, "cocoa_s: Core_CloseAudio: AudioComponentInstanceDispose failed");
|
||||
return;
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
#if (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6)
|
||||
if (CloseComponent(_outputAudioUnit) != noErr) {
|
||||
DEBUG(driver, 0, "cocoa_s: Core_CloseAudio: CloseComponent failed");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if (AudioComponentInstanceDispose(_outputAudioUnit) != noErr) {
|
||||
DEBUG(driver, 0, "cocoa_s: Core_CloseAudio: AudioComponentInstanceDispose failed");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user