Re: Viewer Window and Display preprocessing
Re: Viewer Window and Display preprocessing
- Subject: Re: Viewer Window and Display preprocessing
- From: Darrin Cardani <email@hidden>
- Date: Fri, 20 Mar 2009 09:06:04 -0700
It's hard to say how you should handle it, as I don't exactly know
what you're trying to do with it. But here's one idea:
1) In your plugin, include a custom parameter that will display and
control the global data
2) Have each plugin instance subscribe to notifications from the
singleton object
3) Whenever the user adjusts the custom parameter in one instance,
update the singleton and have the singleton notify any listeners
4) When the listeners are notified, they update their UI to match the
current state of the singleton
That should keep all instances in synch with one another.
Darrin
On Mar 19, 2009, at 5:00 PM, Brian Gardner wrote:
Thanks. That's what I was hoping.
Should I just set that via my FxPlug's parameter UI?
Or is there a proper, sanctioned place for this type global
parameter to be set? (e.g.: a Preferences panel or something similar)
Thank you very much for your help.
-- Brian
On Mar 19, 2009, at 4:47 PM, Darrin Cardani wrote:
On Mar 19, 2009, at 3:55 PM, Brian Gardner wrote:
Hmmm....
1. Is there any way an FxPlugin could read a Global
variable? I'm thinking, perhaps, a user settable toggle
whose state all instances of a FxPlug could access?
You can create a singleton object that the others will communicate
with. For example, you could have something like this:
static SomeClass* mySingleton = nil;
SomeClass* getMySingleton ()
{
if (mySingleton == nil)
{
mySingleton = [[SomeClass alloc] init];
}
return mySingleton;
}
(Note that I didn't actually compile that! But that should give you
an idea of how to do it.)
Darrin
--
Darrin Cardani
email@hidden
--
Darrin Cardani
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Pro-apps-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden