1 /* |
1 /* |
2 * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
607 if (ValidControlCount(volumeControls, 1, totalChannels) > 0 || ValidControlCount(muteControls, 1, totalChannels) > 0) { |
607 if (ValidControlCount(volumeControls, 1, totalChannels) > 0 || ValidControlCount(muteControls, 1, totalChannels) > 0) { |
608 for (int ch=1; ch<=totalChannels; ch++) { |
608 for (int ch=1; ch<=totalChannels; ch++) { |
609 // get the channel name |
609 // get the channel name |
610 char *channelName; |
610 char *channelName; |
611 CFStringRef cfname = NULL; |
611 CFStringRef cfname = NULL; |
612 const AudioObjectPropertyAddress address = {kAudioObjectPropertyElementName, port->scope, ch}; |
612 const AudioObjectPropertyAddress address = {kAudioObjectPropertyElementName, port->scope, (unsigned)ch}; |
613 UInt32 size = sizeof(cfname); |
613 UInt32 size = sizeof(cfname); |
614 OSStatus err = AudioObjectGetPropertyData(mixer->deviceID, &address, 0, NULL, &size, &cfname); |
614 OSStatus err = AudioObjectGetPropertyData(mixer->deviceID, &address, 0, NULL, &size, &cfname); |
615 if (err == noErr) { |
615 if (err == noErr) { |
616 CFIndex length = CFStringGetLength(cfname) + 1; |
616 CFIndex length = CFStringGetLength(cfname) + 1; |
617 channelName = (char *)malloc(length); |
617 channelName = (char *)malloc(length); |