ofApp does not listen to event dispatched from another class

Hey,

I am trying to separate my gui from my main app and have looked at the examples extensively.

So I have a class GuiSettings, where I hold my parameters and callbacks for my parameters. I also hold an event ofEvent<float> changedAll that I dispatch to ofApp, where I’ve added a listener accordingly.

GuiSettings.h

public:
	ofParameterGroup imageFilterSettingsGroup;
	ofParameter<float> power;
	void powerChanged(float& power);

	ofEvent<float> changedAll;

	GuiSettings();

GuiSettings.cpp

GuiSettings::GuiSettings() {
	imageFilterSettingsGroup.setName("image filter settings");
	imageFilterSettingsGroup.add(power.set("power", 5.0, 2.0, 24.0));
	power.addListener(this, &GuiSettings::powerChanged);

} 
// this is called
void GuiSettings::powerChanged(float& power)
{
	ofNotifyEvent(changedAll, power, this);
}

In my ofApp, I try to listen:

ofApp.h:

public:
    GuiSettings gui;
    void calculateTest(float & b);

ofApp.cpp:

void ofApp::setup() {
	gui = GuiSettings();
	ofAddListener(gui.changedAll, this, &ofApp::calculateTest);
}
void ofApp::calculateTest(float & b) {
	// never notified...
}

When debugging, I can verify that GuiSettings::powerChanged(float& power) is called, however, it seems to never reach my ofApp.
When running normally, changing the parameters changes nothing, when debugging, I get a mutex exception after ofNotifyEvent.

Also, the repo: github

Any help would be appreciated

Hi. it somehow gets caught inside the notification loop.
instead of doing such, in ofApp simple add a listener to the ofParameter in GuiSettings.

void ofApp::setup() {
	gui = GuiSettings(); // this line is unnecesary as the default constructor gets implicitly call simply because you have instantiated it.
	ofAddListener(gui.power.changedAll, this, &ofApp::calculateTest);
}