MACOS: Drop macOS 10.2-10.3 CoreAudio support

There's still code for macOS 10.4 in the codebase, but everything before
that has probably been KO for years.  And no C++11 toolchain exists for
macOS < 10.4 either.
This commit is contained in:
Donovan Watteau 2022-05-17 23:56:49 +02:00 committed by Thierry Crozat
parent 4c90e20b8d
commit 0f5dd7cd99

View File

@ -209,40 +209,13 @@ void MidiDriver_CORE::loadSoundFont(const char *soundfont) {
FSRef fsref;
err = FSPathMakeRef((const byte *)soundfont, &fsref, NULL);
SInt32 version;
err = Gestalt(gestaltSystemVersion, &version);
if (err == noErr) {
if (version >= 0x1030) {
// Use kMusicDeviceProperty_SoundBankFSRef in >= 10.3
// HACK HACK HACK HACK SUPER HACK: Using the value of 1012 instead of
// kMusicDeviceProperty_SoundBankFSRef so this compiles with the 10.2
// SDK (which does not have that symbol).
if (err == noErr) {
err = AudioUnitSetProperty(
_synth,
/*kMusicDeviceProperty_SoundBankFSRef*/ 1012, kAudioUnitScope_Global,
0,
&fsref, sizeof(fsref)
);
}
} else {
// In 10.2, only kMusicDeviceProperty_SoundBankFSSpec is available
FSSpec fsSpec;
if (err == noErr)
err = FSGetCatalogInfo(&fsref, kFSCatInfoNone, NULL, NULL, &fsSpec, NULL);
if (err == noErr) {
err = AudioUnitSetProperty(
_synth,
kMusicDeviceProperty_SoundBankFSSpec, kAudioUnitScope_Global,
0,
&fsSpec, sizeof(fsSpec)
);
}
}
err = AudioUnitSetProperty(
_synth,
kMusicDeviceProperty_SoundBankFSRef, kAudioUnitScope_Global,
0,
&fsref, sizeof(fsref)
);
}
#else
// kMusicDeviceProperty_SoundBankURL was added in 10.5 as a replacement