Ejemplo n.º 1
0
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 &param){
	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();
        }
    }
}
Ejemplo n.º 4
0
void ofParameterGroup::remove(ofAbstractParameter &param){
	for(auto & p: obj->parameters){
		if(p->isReferenceTo(param)){
			remove(param.getName());
			return;
		}
	}
}
Ejemplo n.º 5
0
//--------------------------------------------------------------
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();
    }
}