Re: Disable Gain Controls
Re: Disable Gain Controls
- Subject: Re: Disable Gain Controls
- From: Mark Cookson <email@hidden>
- Date: Fri, 4 Oct 2002 13:08:40 -0700
On Friday, October 4, 2002, at 11:38 AM, Michel wrote:
On Friday 04 October 2002 18:53, Mark Cookson wrote:
You can do exactly the same thing with selector controls by adding and
removing selections to the selector.
What about whole IOAudioEngine ? Whats the best way of having them be
dynamic?
pause/resume too ? or do we have to delete and recreate them ?
You can remove IOAudioEngines by terminating them through IOKit
functions. When an engine is gone, your device is effectively gone.
This is probably not what you want, however. I would suspect that you
really just want to change what streams are available, which you can do
with the setStreamAvailable() function.
At initHardware, you would create all of the streams that your device
is capable of driving, and then just turn on the ones that it is
currently capable of driving and off those that it can no longer drive.
There is an addAudioStream() call in the IOAudioEngine class, but there
isn't a corresponding remove call, so you can't just add and remove
them at will, though you can make them available and unavailable at
will. Just bracket the setStreamAvailable() calls with pause, begin
config change, end config change, resume calls.
I've never used setStreamAvailable(), so I can't say if it's totally
bug free. Basically all it does is set the kIOAudioStreamAvailableKey
property in the stream's IORegistry entry. Hopefully the HAL will
notice this and prevent clients from further using it, if it was active
before the change. I believe that it will since you did the config
change calls which cause the HAL to totally reexamine the hardware's
settings, but like I've said, I've never used it.
--
Mark Cookson
Engineering Droid
Apple Computer, Inc.
Core Audio CPU Software
6 Infinite Loop MS 306-2CW
Cupertino, CA 95014
_______________________________________________
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.