Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

missing the first IOAudioSelectorControl notification?



In have a kext which creates an IOAudioSelectorControl in its initialisation:

{
// initialisation code...
m_pOutputSourceSelector = IOAudioSelectorControl::createOutputSelector(0,kIOAudioControlChannelIDAll, kIOAudioControlChannelNameAll, 0);


if ( m_pOutputSourceSelector )
{
  // Add source names

  for (n=0; n<2; n++)
    m_pOutputSourceSelector->addAvailableSelection(n, apszSourceNames[n]);


m_pOutputSourceSelector->setValueChangeHandler((IOAudioControl::IntValueChangeHandler)MyAudioEngine::SourceOutputChangeHandler, this);
addDefaultAudioControl(m_pOutputSourceSelector);
}
}


// Source Change handler
IOReturn MyAudioEngine::SourceOutputChangeHandler(IOService* pTarget, IOAudioControl* pControl, SInt32 oldValue, SInt32 newValue)
{
IOLog("SourceOutputChangeHandler (%p) changed value to %d\n", pControl, (int) newValue);


  // change handling code...
}


I receive the notification when the user changes the control in AMS and everything usually works great. The trouble is that when the driver is first loaded (either manually, or after install and reboot), the value of the source parameter is recalled (presumably from the CoreAudio daemon), but I do not get a notification that this change has occured.


So on startup, the driver is out of sync with the value of the controls. If I toggle the control, everything works as expected.

Am I doing something incorrectly to not receive this first notification, or is there another way I can recall this "default" state?

Thanks,
Brett.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/coreaudio-api/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.