From ef81f3163d567f41192bd3ed1dc37d983a7c22d9 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 13 Feb 2024 06:29:56 +0100 Subject: [PATCH] Vapor: improve backwards compat of Apple renderer replace constants only available >= macOS 11.0 --- libs/ardour/surround_return.cc | 39 ++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/libs/ardour/surround_return.cc b/libs/ardour/surround_return.cc index 0415c0409c..4ed375ec06 100644 --- a/libs/ardour/surround_return.cc +++ b/libs/ardour/surround_return.cc @@ -173,24 +173,26 @@ SurroundReturn::SurroundReturn (Session& s, Route* r) } UInt32 renderingAlgorithm = 7; // kSpatializationAlgorithm_UseOutputType; - err = AudioUnitSetProperty (_au, - kAudioUnitProperty_SpatializationAlgorithm, - kAudioUnitScope_Input, - 0, - &renderingAlgorithm, - sizeof (renderingAlgorithm)); + + err = AudioUnitSetProperty (_au, + 19 /*kAudioUnitProperty_SpatializationAlgorithm*/, + kAudioUnitScope_Input, + 0, + &renderingAlgorithm, + sizeof (renderingAlgorithm)); if (err != noErr) { return; } - UInt32 sourceMode = kSpatialMixerSourceMode_AmbienceBed; - err = AudioUnitSetProperty (_au, - kAudioUnitProperty_SpatialMixerSourceMode, - kAudioUnitScope_Input, - 0, - &sourceMode, - sizeof (sourceMode)); + UInt32 sourceMode = 3; // kSpatialMixerSourceMode_AmbienceBed; + + err = AudioUnitSetProperty (_au, + 3005 /*kAudioUnitProperty_SpatialMixerSourceMode*/, + kAudioUnitScope_Input, + 0, + &sourceMode, + sizeof (sourceMode)); if (err != noErr) { return; @@ -199,11 +201,12 @@ SurroundReturn::SurroundReturn (Session& s, Route* r) AURenderCallbackStruct renderCallbackInfo; renderCallbackInfo.inputProc = _render_callback; renderCallbackInfo.inputProcRefCon = this; - err = AudioUnitSetProperty (_au, - kAudioUnitProperty_SetRenderCallback, - kAudioUnitScope_Input, - 0, (void*)&renderCallbackInfo, - sizeof (renderCallbackInfo)); + + err = AudioUnitSetProperty (_au, + kAudioUnitProperty_SetRenderCallback, + kAudioUnitScope_Input, + 0, (void*)&renderCallbackInfo, + sizeof (renderCallbackInfo)); if (err != noErr) { return;