Skip to content

Instantly share code, notes, and snippets.

@moebiussurfing
Last active May 18, 2020 05:34
Show Gist options
  • Save moebiussurfing/f5e6d2b978ed9bb68f6cd8fd1f895320 to your computer and use it in GitHub Desktop.
Save moebiussurfing/f5e6d2b978ed9bb68f6cd8fd1f895320 to your computer and use it in GitHub Desktop.
openFrameworks - bool parameter lambda callback listener: button and toggle
//group
ofAddListener(params.parameterChangedE(), this, &ofxGpuLutCube::Changed_params);
//toggle
ofEventListener listener;
listener = SHOW_CONTROL.newListener([this](bool b) {
OSC_Helper.setVisiblePlots(b);
//std::cout << b << std::endl;
});
//buttons
listener_bPrev = bPrevious.newListener([this](const void * sender) {
ofParameter<void> * p = (ofParameter<void> *)sender;
string name = p->getName();
ofLogNotice("ofxGpuLutCube") << "Changed_button_param: 'PREVIOUS'";
if (name == "PREVIOUS")
{
previous();
}
});
listener_bNext = bNext.newListener([this](const void * sender) {
ofParameter<void> * p = (ofParameter<void> *)sender;
string name = p->getName();
ofLogNotice("ofxGpuLutCube") << "Changed_button_param: 'NEXT'";
if (name == "NEXT")
{
next();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment