1 person found this helpful
I haven't used PluginArt much, but the LiveDropShadow sample has a PluginGroupUpdate function. Have you tried building this and seeing what happens if you do the same thing with its plugin art. Though having a quick look at its PluginGroupUpdate function, it seems to destroy and recreate the plugin art on each call?
There seems to be a series of calls to PluginGroupNotify(...).
Digging more through the docs, it looks like you need to check the passed in AIPluginGroupMessage, specifically the time and code properties. Change your return code from that function depending on the behavior you're looking for. The allowable return codes are:
I haven't quite figured out which codes I want to return in response to which messages, but I have a feeling this is the right track.
You are correct that the LiveDropShadow sample seems to trash and recreate the plugin art each time. I've kind of arrived at the same solution, but slightly different for my case.
I've gotten around my recursive loop problem by doing the following:
ASErr MyPlugin::PluginGroupNotify(AIPluginGroupMessage* message)
if (strcmp( message->code, kAttachOperationCode ) == 0 && strcmp( message->time, kCheckOperationTime ) == 0)
if (strcmp( message->code, kAttachOperationCode ) == 0 && strcmp( message->time, kBeforeOperationTime ) == 0)
if (strcmp( message->code, kAttachOperationCode ) == 0 && strcmp( message->time, kAfterOperationTime ) == 0)
You can change the return codes to create the behavior you need.
kCheckOperationTime fires when you AIPluginGroupSuite->UseAIPluginGroup(...). You can return kRefusePluginGroupReply here to cancel the whole thing I think.
kBeforeOperationTime fires after kCheckOperationTime. Presumably you'd store some kind of information here if you want to compare it to kAfterOperationTime.
kAfterOperationTime fires after kBeforeOperationTime. AIPluginGroupSuite->UseAIPluginGroup(...) returns after this.
This is speculation from what I've observed through testing various different ways of handling things. PluginGroupUpdate(...) seems to be related to the Silent/Dirty state of the plugin art. That seems to be toggled based on return codes from Notify, or by using the suite functions. As it is, my case doesn't seem to need to worry about it.