Re: IOAudioControl::setCoreAudioPropertyID()
Re: IOAudioControl::setCoreAudioPropertyID()
- Subject: Re: IOAudioControl::setCoreAudioPropertyID()
- From: Emmett James <email@hidden>
- Date: Mon, 25 Nov 2002 21:08:10 -0600
Thanks for the info, Jeff. I was naive and believed the written Apple
docs:
IOAudioFamily-1.1d23
- Added setCoreAudioPropertyID() to IOAudioControl (new property
'IOAudioControlCoreAudioPropertyID')
- The HAL will pass thru CoreFoundation objects passed to
AudioDeviceSetProperty(). They can be CFNumber, CFString, CFData,
etc... and will be turned into OSObjects in the kernel (OSNumber,
OSString, OSData, etc...).
- A new usage has been added to allow the HAL to recognize
the controls which should be used for custom properties
(kIOAudioControlUsageCoreAudioProperty)
I guess I failed to discern that the word "will" could be intepreted as
meaning "at some unspecified time in the future", which might be years
from now. ;-)
Anyway, thanks again for the lore.
-- Emmett
On Mon, Nov 25, 2002 at 04:54:29PM -0800, Jeff Moore wrote:
>
The HAL doesn't support that feature of the IOAudio family yet. You'll
>
need to write a plug-in to translate your custom control into a
>
property.
>
>
On Monday, November 25, 2002, at 02:38 PM, Emmett James wrote:
>
>
>I have an audio driver for a PCI card and a related app. The card
>
>has a few features that need to be controlled from the app, e.g.
>
>a phantom power on/off switch. I am trying to use some standard
>
>IOAudioSelectorControl and IOAudioToggleControls for this, using the
>
>setCoreAudioPropertyID() method. However, the app cannot find the
>
>properties. Below are code snippets from the app, and the driver.
>
>
>
>
>
>--------
>
>
>
>In the driver, create the control:
>
>
>
> fPhantomPower1 = IOAudioSelectorControl::create(0, // init val
>
> AnalogIn1_Left, // channel number
>
> "Mic1 Phantom", // name
>
> kControlId_PhantomPower1, // control ID
>
> kFooSubTypePhantomPower, // subType
>
> kIOAudioControlUsageCoreAudioProperty);
>
>
>
> if (fPhantomPower1 != 0)
>
> {
>
> fPhantomPower1->addAvailableSelection(0, "Off");
>
> fPhantomPower1->addAvailableSelection(1, "On");
>
> fPhantomPower1->setCoreAudioPropertyID(kFooPropertyIdPhantom1);
>
>
>
>fPhantomPower1-
>
>>setValueChangeHandler((IOAudioControl::IntValueChangeHandler)
>
>SelChangeHandler, this);
>
> fAudioEngine->addDefaultAudioControl(fPhantomPower1);
>
> fPhantomPower1->release();
>
> }
>
>
>
>
>
>-----------------
>
>
>
>In the app:
>
>
>
>Getting:
>
>
>
> // Get the new phantom power status
>
> UInt32 on = 0;
>
> UInt32 size = sizeof(UInt32);
>
> OSStatus err = AudioDeviceGetProperty(fDeviceId, 1,
>
> kAudioPropertyWildcardSection, kFooPropertyIdPhantom1, &size,
>
>&on);
>
> if (noErr != err)
>
> NSLog(@"Error while getting phantom power: '%.4s'", &err);
>
>
>
>Setting:
>
>
>
> // Set phantom power on the card
>
> UInt32 on = [fPhantomPower state] == NSOnState ? 1 : 0;
>
> UInt32 size = sizeof(UInt32);
>
> OSStatus err = AudioDeviceSetProperty(fDeviceId, NULL, 1,
>
> kAudioPropertyWildcardSection, kFooPropertyIdPhantom1, size, &on);
>
> if (noErr != err)
>
> NSLog(@"Error while setting phantom power: '%.4s'", &err);
>
>
>
>
>
>
>
>Both of these functions return kAudioHardwareUnknownPropertyError
>
>('who?') when called. I've also tried setting the channel parameter to
>
>kAudioPropertyWildcardChannel, the isInput parameter to YES and NO, and
>
>all combinations thereof. I get the same error in all cases.
>
>
>
>BTW, the app talks fine to standard Apple controls such as Volume
>
>controls.
>
>_______________________________________________
>
>coreaudio-api mailing list | email@hidden
>
>Help/Unsubscribe/Archives:
>
>http://www.lists.apple.com/mailman/listinfo/coreaudio-api
>
>Do not post admin requests to the list. They will be ignored.
>
>
>
>
>
>
--
>
>
Jeff Moore
>
Core Audio
>
Apple
>
_______________________________________________
>
coreaudio-api mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
>
Do not post admin requests to the list. They will be ignored.
>
On Mon, Nov 25, 2002 at 04:54:29PM -0800, Jeff Moore wrote:
>
The HAL doesn't support that feature of the IOAudio family yet. You'll
>
need to write a plug-in to translate your custom control into a
>
property.
>
>
On Monday, November 25, 2002, at 02:38 PM, Emmett James wrote:
>
>
>I have an audio driver for a PCI card and a related app. The card
>
>has a few features that need to be controlled from the app, e.g.
>
>a phantom power on/off switch. I am trying to use some standard
>
>IOAudioSelectorControl and IOAudioToggleControls for this, using the
>
>setCoreAudioPropertyID() method. However, the app cannot find the
>
>properties. Below are code snippets from the app, and the driver.
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.