• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
AudioDeviceGetProperty -> AudioObjectGetPropertyData
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: AudioDeviceGetProperty -> AudioObjectGetPropertyData
      • From: Kevin Vanwulpen <email@hidden>
  • Prev by Date: Re: Audio Unit Properties that are CFStringRef
  • Next by Date: Re: Audio Unit Properties that are CFStringRef
  • Previous by thread: Re: Audio Unit Properties that are CFStringRef
  • Next by thread: Re: AudioDeviceGetProperty -> AudioObjectGetPropertyData
  • Index(es):
    • Date
    • Thread