• 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: Disable Gain Controls
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Disable Gain Controls


  • Subject: Re: Disable Gain Controls
  • From: Mark Cookson <email@hidden>
  • Date: Fri, 4 Oct 2002 10:53:50 -0700

On Friday, October 4, 2002, at 10:13 AM, Phil Montoya wrote:

Is it possible to enable/disable the gain control slider when an input
source is selected? Some of our inputs have HW gain control, while others
do not. The inputs that do not have gain are SDI inputs where the source is
digital and we really don't want to adjust these levels at all. The proper
thing to do here would be to disable the gain control slider so that the
user is aware he can't adjust the gain.

Also, is it possible to know when the input selector list is displayed?
Some of our inputs are dynamic and they can come and go depending on what
the user plugs in. Rather than poll the hardware regularly it would be best
to do this at the time the list is displayed and either remove or add input
selectors that are valid at that time.

You can add, remove, or reconfigure controls at any time you want to. First, you pause the audio engine by calling pauseAudioEngine(), then call beginConfigurationChange() to tell the IOAudioFamily that the hardware is about to do something interesting. Remove or add any controls that you want to, or just adjust their values if their min or max has changed. Once everything is done, call completeConfigurationChange() and then resumeAudioEngine(). IOAudioFamily will send out a hardware changed notification and the HAL will notice the control changes and inform interested applications via it's notifiers. This will cause a fair number of notifications to be sent to the HAL that aren't really needed since the hardware changed notification will cause the HAL to examine the min/max values (which send their own notification when they change), but until I get around to optimizing dispatch of notifications, this is something that we all have to live with.

You can do exactly the same thing with selector controls by adding and removing selections to the selector.

If the hardware itself doesn't detect the change in what the user plugs in, then there is nothing that you can do other than poll. You have no idea what the UI is doing with respect to the information it has previously gathered regarding your available selections. You need to make sure that you keep the available selections up to date so that the application can do the right thing. In some of our hardware, we poll once a second. This is generally considered fast enough to keep up with users, but certainly could be sped up or slowed down if you needed better response time or wanted to reduce accesses to your device.

--
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.

  • Follow-Ups:
    • Re: Disable Gain Controls
      • From: Michel <email@hidden>
References: 
 >Disable Gain Controls (From: Phil Montoya <email@hidden>)

  • Prev by Date: Re: MultitapAU with Knob-Controls pre-alpha-release
  • Next by Date: disabling audio controls
  • Previous by thread: Disable Gain Controls
  • Next by thread: Re: Disable Gain Controls
  • Index(es):
    • Date
    • Thread