void ofParameterGroup::swapPositions(ofAbstractParameter & param1, ofAbstractParameter & param2){ auto iter = obj->parametersIndex.find(param1.getName()); if (iter != obj->parametersIndex.end()){ auto iter2 = obj->parametersIndex.find(param2.getName()); if(iter != obj->parametersIndex.end()) { swapPositions(obj->parametersIndex[param1.getName()], obj->parametersIndex[param2.getName()]); } } }
void ofParameterGroup::remove(ofAbstractParameter ¶m){ std::for_each(obj->parameters.begin(), obj->parameters.end(), [&](shared_ptr<ofAbstractParameter>& p){ if(p->isReferenceTo(param)){ remove(param.getName()); } }); }
void audioVisualApp::onSettingChanged(ofAbstractParameter &p) { string name = p.getName(); if(name == "Play!") { if(outputOn) { soundPlayer->play(); } } }
void ofParameterGroup::remove(ofAbstractParameter ¶m){ for(auto & p: obj->parameters){ if(p->isReferenceTo(param)){ remove(param.getName()); return; } } }
//-------------------------------------------------------------- void PartyCLApp::paramsChanged(ofAbstractParameter& param) { string paramName = param.getName(); if (paramName == clusterScale.getName() || paramName == velocityScale.getName()) { bReset = true; } }
void audioVisualApp::onClipChanged(ofAbstractParameter &p) { string clipName = soundClips[p.getName()]; if(soundPlayer->isPlaying()) { soundPlayer->stop(); } soundPlayer->load(clipName); if(outputOn) { soundPlayer->play(); } }