To cut a long story short, I have one custom QCPatch to send data
[[NSNotificationCenter defaultCenter] postNotificationName:kNotificationName object:sentObject];
and another custom QCPatch to receive data in another composition.

In the example posted, the receiver patch timeMode is set to kQCPlugInTimeModeNone As expected the plugin.execute:atTime:withArguments doesn't get called when the notification is received. It only gets called when I move the patch around in QC. I can fix this by setting the timeMode to kQCPlugInTimeModeIdle. It's easy to set a flag in the notificationCallback and in execute check that and only write to output when there is actually new data, but I was wondering if there is a way to keep the timeMode to none, and from the notificationCallback force an execute so the receiver execute isn't unnecessarily running and constantly checking the flag to see if there is new data?


I haven't tried this myself (as the official-api has lots of lameness like this), but here's a test:

[[self patch] setNeedsExecution];

where self is your QCPlugIn subclass. if you want definitions (for warning suppression etc):
-(id)patch;
-(void)setNeedsExection;

(if this works at all, it should work on both 10.5 and 10.6)

This is how the threaded patches in QC do this (effectively -- they actually don't have the QCPlugIn abstraction as a hobble.

Please let me know if this works -- it's a ridiculously common design pattern that should be exposed in QC.

--
[ christopher wright ]
[email protected]
http://kineme.net/

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to