Kind of link ofParameter's with makeReferenceTo, but between ofParameterGroup's?

Hey,
we can “link” two parameters from the same type doing:

someParameter.makeReferenceTo(otherParameter);

I want to do the same with two ofParameterGroup’s.

I have a vector of instances of my own class. Each instance has his parameters into an ofParameterGroup “container”. (with all nested parameters settings inside)

I would like that all the instances share the same settings/parameters.

Then, to link 4 instances of my class could be something like:

myInstances[1].params.makeReferenceTo(myInstances[0].params);
myInstances[2].params.makeReferenceTo(myInstances[0].params);
myInstances[3].params.makeReferenceTo(myInstances[0].params);

Do you think it’s possible?

Maybe a workaround could be iterating all the contained params inside the group, and link one by one with makeReferenceTo?

Another way could be to (periodically) serialize the group and save the master ofParameterGroup [0] to xml/json and to load the file into the other slaves groups [1-2-3].

Hi @moebiussurfing

I’ve been doing that using either a static ofParameterGroup within the class, where the parameters are static as well , or using a shared_ptr<ofParameterGroup> which I pass to each class instance upon creation.

1 Like