• 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: Property plugins
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Property plugins


  • Subject: Re: Property plugins
  • From: Laurent Cerveau <email@hidden>
  • Date: Fri, 6 Dec 2002 02:09:45 +0100

On Thursday, December 5, 2002, at 10:43 PM, Emmett James wrote:

On Thu, Dec 05, 2002 at 03:05:56PM +0100, Laurent Cerveau wrote:

Thanks, Laurent, this is extremely helpful.

At first in the Plugin open code
you need to get a reference to this control (i.e an io_connect_t that
we will call gReferenceToMyCustomControl here)

Could you illustrate how the Plugin gets this reference from the KEXT?


Basically you would have it declared into your source file and get it in the open driver function. For example

io_connect_t gConnectionReferenceToMyCustomControl;


OSStatus AudioDriverPlugInOpen(AudioDriverPlugInHostInfo* inHostInfo){

OSStatus theResult;
io_iterator_t theIterator;
kern_return_t theKernelError;

theResult = noErr;

theKernelError = IORegistryEntryCreateIterator(inHostInfo->mIOAudioDevice,
kIOServicePlane,kIORegistryIterateRecursively, &theIterator);

//get the good control entry.
if( KERN_SUCCESS == theKernelError ){
gConnectionReferenceToMyCustomControl = IOIteratorNext(theIterator);
while(gConnectionReferenceToMyCustomControl != 0) {
//here you need add criteria that will recognize your control like
//if(IOObjectConformsTo(gControlReference, "IOAudioLevelControl"))
// or check for type /subtype properties
// or look for the custom 4 char code you declared in the driver part
// or mix all that
break;
} else {
gConnectionReferenceToMyCustomControl = IOIteratorNext(theIterator);
}
}

if (theIterator)
IOObjectRelease(theIterator);

return(theResult);
}

It might be more tricky in fact if you want to set up a correct notification system for control changes and so on. Also I am not very sure anymore about the fact that IOServiceOpen should be called after on the reference or not. You may need to dwelve in the IOKit user client API a little bit


Now in your plugin code
when you get the custom property passes to your plugin this should be
received by your handler.

I'm having a bit of trouble parsing this sentence.


My apologies (the real reason is that I am French and practiced a lot English with Autralian and English friends... :-) ).

What I mean is that the call to IORegistryEntrySetCFProperty into the triggers in fact all a series of call that ends up into the handler of your control, in fact going through setProperties. There are some lines about that into the IOAudioControl,h files for setProperties comment

/*!
* @function setProperties
* @abstract Called to change a property of this IOService
* @discussion This is called when the user client changes a property of this
* IOAudioControl. In this case it is used to change the value. This function
* looks for that property and then calls setValue() through the IOCommandGate and
* setValueAction().
* @param properties An OSDictionary containing the properties to change
* @result Returns kIOReturnSuccess on success
*/

Hope this helps

Laurent

Thanks,

Mark
_______________________________________________
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.
_______________________________________________
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:
    • Carbon Sound Manager Update
      • From: EJ Campbell <email@hidden>
References: 
 >Re: Property plugins (From: Emmett James <email@hidden>)

  • Prev by Date: Re: Property plugins
  • Next by Date: Carbon Sound Manager Update
  • Previous by thread: Re: Property plugins
  • Next by thread: Carbon Sound Manager Update
  • Index(es):
    • Date
    • Thread