• 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
Re: AudioDeviceGetProperty -> AudioObjectGetPropertyData
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AudioDeviceGetProperty -> AudioObjectGetPropertyData


  • Subject: Re: AudioDeviceGetProperty -> AudioObjectGetPropertyData
  • From: Kevin Vanwulpen <email@hidden>
  • Date: Mon, 05 Mar 2012 21:33:10 -0800

Hi Glenn

No AudioObjectPropertyAddress's mElement is used for this.

theAddress.mElement in your example.

kAudioObjectPropertyElementMaster is equivalent to channel 0 before.

inQualifierData and inQualifierDataSize are rarely used (can't think of an example even at the moment) but they are meant to uhm qualify the get/set more narrow. I have not done that but believe it can be used to for instance get the objects of a certain class from the system. Anyhow for now set those to NULL and 0 respectively and you're fine.

Regards,
Kevin

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


References: 
 >AudioDeviceGetProperty -> AudioObjectGetPropertyData (From: Glenn Hughes <email@hidden>)

  • Prev by Date: Re: Audio Unit Properties that are CFStringRef
  • Next by Date: audio drop out
  • Previous by thread: AudioDeviceGetProperty -> AudioObjectGetPropertyData
  • Next by thread: audio drop out
  • Index(es):
    • Date
    • Thread