Re: plugin to query hardware status
Re: plugin to query hardware status
- Subject: Re: plugin to query hardware status
- From: david tay <email@hidden>
- Date: Wed, 10 May 2006 14:38:14 -0700
I'm not at all sure what you mean, so let me give you an example of
what I did to implement a custom property that isn't an
IOAudioControl in a driver for a virtual device I use for testing.
The property in question is used to control the number of channels
the device has. It is a simple integer value. So all I did was put it
into the IORegistry hanging off of my IOAudioEngine subclass. To put
it in the registry, I just call setProperty() using a custom key. To
receive changes to this value, I had to override setProperties() in
my IOAudioEngine subclass. In my implementation of setProperties(), I
just look for my custom key, grab the value and process it if the
value is different.
In my HAL plug-in, all I ever do to access/manipulate this property
is to call IORegistryEntryCreateCFProperty() or
IORegistryEntrySetCFProperty().
In my particular case, changing my custom property changed the format
of the data since it specifically is there to adjust the number of
channels. Because of this, my custom property didn't need any
notifications over and above what the IOAudio Family already
provided, namely the major engine change and format change
notifications.
If your custom property needs notifications separate from what the
Family provides, the best thing to do is to just define your own
notification ID and use it in a call to
IOAudioEngine::sendNotification(). Either way, your plug-in will need
to open it's own connection to your engine object and give it a mach
port on which to send the notifications.
My device sets an array of custom bits/ counters in response to
something like an audio spike, etc, AND
indicates that an update event occured (eg - audio spike/ plug
removed/ plug inserted / softLimit value changed event happened).
It is the responsibility of the custom application(s) upon receiving
such a notification to issue a command to the device to get the exact
value of
the change.
For example - in response to a plug insertion notification, ask the
device which port was the plug inserted.
How would that be implemented? Can this be accomplished via
IORegistryEntryCreateCFProperty()? My own tests indicate not.
David
_______________________________________________
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