oscParametersReceiver/Sender examples not working

Hi,

these two examples are not working for me. After compiling and running both apps, the parameters don’t sync.

It seems that the problem is related to the listener added to group in ofxOscParameterSync::setup(). For some reason the listener is not triggering ofxOscParameterSync::parameterChanged.

As a quick and dirty test I’ve modiffied the listener to look like this:

void ofxOscParameterSync::parameterChanged( ofAbstractParameter & parameter ){
    cout << "parameter changed: " << parameter.getName() << endl;
	if(updatingParameter) return;
	sender.sendParameter(parameter);
}

But nothing gets printed to the console.

Adding a listener directly to the parameter group in ofApp doesn’t work either

void ofApp::setup(){
	parameters.setName("parameters");
	parameters.add(size.set("size",10,0,100));
	parameters.add(number.set("number",10,0,100));
	parameters.add(check.set("check",false));
	parameters.add(color.set("color",ofColor(127),ofColor(0,0),ofColor(255)));
	gui.setup(parameters);
	// by now needs to pass the gui parameter groups since the panel internally creates it's own group
	sync.setup((ofParameterGroup&)gui.getParameter(),6666,"localhost",6667);
	//ofSetVerticalSync(true);
    
    ofAddListener(parameters.parameterChangedE,this, &ofApp::parameterChanged);
}

void ofApp::parameterChanged( ofAbstractParameter & parameter ) {
    cout << parameter << endl;
}

So my guess is that there’s some kind of problem with the events notification in ofParameterGroup. Could this be a bug? Is there anything I can do to solve this problem?

Thanks!

I’m on OSX 10.9.5 using oF 084

Hi again,

I’ve been trying to find the problem and after some testing this is what I’ve found:

It appears to be some issues when trying to access the parent of an ofParameter:

void ofApp::setup(){
    parameters.setName("group");
    parameters.add(param1.set("param 1", 50, 0, 100));
    
    // we can access the parent like this
    cout << parameters.get("param 1").getParent() << endl;  // 0xab73e30 (or whichever address)
    
    // this doesn't work (null parent)
    cout << param1.getParent() << endl;  // 0 (NULL)
    
    // after setting parent explicitly...
    param1.setParent(&parameters);
    
    // ...we can access the parent
    cout << param1.getParent() << endl;  // 0xab73e30 (or whichever address)
}

I don’t know if this is a bug, but definitely not the expected behaviour… I haven’t figured out how to make the examples to work, but I think this has something to do with it.

Has anyone been able to make this examples work?

Same problem for me. Have you solved?

Still seeing this issue. I just built the example sender and recievers, and they do not affect each other at all. Does anyone have any info on this?

There were some issues with parametergroups in 0.8.3 & 0.8.4, should be fixed in 0.9
https://github.com/openframeworks/openFrameworks/issues/3185