Skip to content

Commit

Permalink
ao_coreaudio: replace deprecated enums
Browse files Browse the repository at this point in the history
  • Loading branch information
kasper93 committed Nov 23, 2023
1 parent 7c92549 commit 8ccd285
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions audio/out/ao_coreaudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ static int hotplug_init(struct ao *ao)
AudioObjectPropertyAddress addr = {
hotplug_properties[i],
kAudioObjectPropertyScopeGlobal,
kAudioObjectPropertyElementMaster
kAudioObjectPropertyElementMain
};
err = AudioObjectAddPropertyListener(
kAudioObjectSystemObject, &addr, hotplug_cb, (void *)ao);
Expand All @@ -401,7 +401,7 @@ static void hotplug_uninit(struct ao *ao)
AudioObjectPropertyAddress addr = {
hotplug_properties[i],
kAudioObjectPropertyScopeGlobal,
kAudioObjectPropertyElementMaster
kAudioObjectPropertyElementMain
};
err = AudioObjectRemovePropertyListener(
kAudioObjectSystemObject, &addr, hotplug_cb, (void *)ao);
Expand Down
2 changes: 1 addition & 1 deletion audio/out/ao_coreaudio_exclusive.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ static OSStatus enable_property_listener(struct ao *ao, bool enabled)
for (int n = 0; n < MP_ARRAY_SIZE(devs); n++) {
AudioObjectPropertyAddress addr = {
.mScope = kAudioObjectPropertyScopeGlobal,
.mElement = kAudioObjectPropertyElementMaster,
.mElement = kAudioObjectPropertyElementMain,
.mSelector = selectors[n],
};
AudioDeviceID device = devs[n];
Expand Down
8 changes: 4 additions & 4 deletions audio/out/ao_coreaudio_properties.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ OSStatus ca_get(AudioObjectID id, ca_scope scope, ca_sel selector,
AudioObjectPropertyAddress p_addr = (AudioObjectPropertyAddress) {
.mSelector = selector,
.mScope = scope,
.mElement = kAudioObjectPropertyElementMaster,
.mElement = kAudioObjectPropertyElementMain,
};

return AudioObjectGetPropertyData(id, &p_addr, 0, NULL, &size, data);
Expand All @@ -41,7 +41,7 @@ OSStatus ca_set(AudioObjectID id, ca_scope scope, ca_sel selector,
AudioObjectPropertyAddress p_addr = (AudioObjectPropertyAddress) {
.mSelector = selector,
.mScope = scope,
.mElement = kAudioObjectPropertyElementMaster,
.mElement = kAudioObjectPropertyElementMain,
};

return AudioObjectSetPropertyData(id, &p_addr, 0, NULL, size, data);
Expand All @@ -56,7 +56,7 @@ OSStatus ca_get_ary(AudioObjectID id, ca_scope scope, ca_sel selector,
AudioObjectPropertyAddress p_addr = (AudioObjectPropertyAddress) {
.mSelector = selector,
.mScope = scope,
.mElement = kAudioObjectPropertyElementMaster,
.mElement = kAudioObjectPropertyElementMain,
};

err = AudioObjectGetPropertyDataSize(id, &p_addr, 0, NULL, &p_size);
Expand Down Expand Up @@ -95,7 +95,7 @@ Boolean ca_settable(AudioObjectID id, ca_scope scope, ca_sel selector,
AudioObjectPropertyAddress p_addr = (AudioObjectPropertyAddress) {
.mSelector = selector,
.mScope = kAudioObjectPropertyScopeGlobal,
.mElement = kAudioObjectPropertyElementMaster,
.mElement = kAudioObjectPropertyElementMain,
};

return AudioObjectIsPropertySettable(id, &p_addr, data);
Expand Down
6 changes: 3 additions & 3 deletions audio/out/ao_coreaudio_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ OSStatus ca_select_device(struct ao *ao, char* name, AudioDeviceID *device)
AudioObjectPropertyAddress p_addr = (AudioObjectPropertyAddress) {
.mSelector = kAudioHardwarePropertyDeviceForUID,
.mScope = kAudioObjectPropertyScopeGlobal,
.mElement = kAudioObjectPropertyElementMaster,
.mElement = kAudioObjectPropertyElementMain,
};
err = AudioObjectGetPropertyData(
kAudioObjectSystemObject, &p_addr, 0, 0, &size, &v);
Expand Down Expand Up @@ -377,7 +377,7 @@ static OSStatus ca_change_mixing(struct ao *ao, AudioDeviceID device,
AudioObjectPropertyAddress p_addr = (AudioObjectPropertyAddress) {
.mSelector = kAudioDevicePropertySupportsMixing,
.mScope = kAudioObjectPropertyScopeGlobal,
.mElement = kAudioObjectPropertyElementMaster,
.mElement = kAudioObjectPropertyElementMain,
};

if (AudioObjectHasProperty(device, &p_addr)) {
Expand Down Expand Up @@ -486,7 +486,7 @@ bool ca_change_physical_format_sync(struct ao *ao, AudioStreamID stream,
AudioObjectPropertyAddress p_addr = {
.mSelector = kAudioStreamPropertyPhysicalFormat,
.mScope = kAudioObjectPropertyScopeGlobal,
.mElement = kAudioObjectPropertyElementMaster,
.mElement = kAudioObjectPropertyElementMain,
};

err = AudioObjectAddPropertyListener(stream, &p_addr,
Expand Down
4 changes: 2 additions & 2 deletions video/out/mac/common.swift
Original file line number Diff line number Diff line change
Expand Up @@ -289,13 +289,13 @@ class Common: NSObject {
}

func initLightSensor() {
let srv = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("AppleLMUController"))
let srv = IOServiceGetMatchingService(kIOMainPortDefault, IOServiceMatching("AppleLMUController"))
if srv == IO_OBJECT_NULL {
log.sendVerbose("Can't find an ambient light sensor")
return
}

lightSensorIOPort = IONotificationPortCreate(kIOMasterPortDefault)
lightSensorIOPort = IONotificationPortCreate(kIOMainPortDefault)
IONotificationPortSetDispatchQueue(lightSensorIOPort, queue)
var n = io_object_t()
IOServiceAddInterestNotification(lightSensorIOPort, srv, kIOGeneralInterest, lightSensorCallback, MPVHelper.bridge(obj: self), &n)
Expand Down

0 comments on commit 8ccd285

Please sign in to comment.