AudioDeviceGetProperty -> AudioObjectGetPropertyData
AudioDeviceGetProperty -> AudioObjectGetPropertyData
- Subject: AudioDeviceGetProperty -> AudioObjectGetPropertyData
- From: Glenn Hughes <email@hidden>
- Date: Mon, 05 Mar 2012 23:08:42 -0500
Hi All,
The translation between AudioDeviceGetProperty, which has been
deprecated, and AudioObjectGetPropertyData seems a little
underspecified. Some properties make use of the channel argument to
AudioDeviceGetProperty. For example:
// get if a particular channel is patching-thru
bool IsChanPatchingThru( AudioDeviceID audID, int channel )
{
UInt32 size = sizeof( UInt32 );
UInt32 pt;
OSStatus status = AudioDeviceGetProperty( audID,
channel,
true,
kAudioDevicePropertyPlayThru,
&size, &pt )
return status == kAudioHardwareNoError and pt;
}
AudioObjectGetPropertyData doesn't have a channel argument. I -guess-
that the channel should now be passed through the inQualifierDataSize
and inQualifierData arguments, but I have yet to find any example code
for this, or any explicit documentation about it. Guessing how APIs
work is always bad.
Here's what I think a translation of the above would look like:
bool IsChanPatchingThru( AudioDeviceID audID, UInt32 channel )
{
UInt32 size = sizeof( UInt32 );
UInt32 pt;
AudioObjectPropertyAddress theAddress = { kAudioDevicePropertyPlayThru,
kAudioObjectPropertyScopeGlobal,
kAudioObjectPropertyElementMaster };
OSStatus status = AudioObjectGetPropertyData( audID,
&theAddress,
sizeof( UInt32 ),
&channel,
&size,
&pt );
return status == kAudioHardwareNoError and pt;
}
... but it's only a guess.
Anyone?
TIA
Glenn
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden