From 9d3f2ba76e01bf0c6523509311a90d6a5cf6546a Mon Sep 17 00:00:00 2001
From: Sergey Fedorov <vital.had@gmail.com>
Date: Thu, 6 Jun 2024 16:54:37 +0800
Subject: [PATCH] audio_switch.h: fix for pre-10.8

---
 audio_switch.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git audio_switch.h audio_switch.h
index 4d19cb9..098c91f 100644
--- audio_switch.h
+++ audio_switch.h
@@ -33,8 +33,17 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include <CoreServices/CoreServices.h>
 #include <CoreAudio/CoreAudio.h>
 #include <CoreAudio/AudioHardware.h>
+#include <AvailabilityMacros.h>
+#ifndef MAC_OS_X_VERSION_10_8 // fallbacks for < 10.8
+#define kAudioObjectPropertyScopeInput kAudioDevicePropertyScopeInput
+#define kAudioObjectPropertyScopeOutput kAudioDevicePropertyScopeOutput
+#else
 #include <CoreAudio/AudioHardwareBase.h>
+#endif
 
+#ifndef kAudioObjectPropertyElementMain
+#define kAudioObjectPropertyElementMain kAudioObjectPropertyElementMaster
+#endif
 
 typedef enum {
 	kAudioTypeUnknown = 0,
