本文整理汇总了C++中ofPtr::getSynthParam方法的典型用法代码示例。如果您正苦于以下问题:C++ ofPtr::getSynthParam方法的具体用法?C++ ofPtr::getSynthParam怎么用?C++ ofPtr::getSynthParam使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ofPtr
的用法示例。
在下文中一共展示了ofPtr::getSynthParam方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: saveSynth
void bankManager::saveSynth(ofxXmlSettings & XML, ofPtr<triggerZone> z){
vector<synthParam> defSp = synthDictionary::getSynthParams(z->getSynthType());
for(int i = 0; i < defSp.size(); i++){
synthParam sp = z->getSynthParam(i);
XML.addTag(defSp[i].name);
if(XML.pushTag(defSp[i].name)){
XML.addValue("ABS_VAL", sp.abs_val);
XML.addValue("MIN_VAL", sp.min_val);
XML.addValue("MAX_VAL", sp.max_val);
XML.addValue("MAP", (int)sp.map);
XML.popTag();
}
}
}
示例2: populateSynthCanvas
void testApp::populateSynthCanvas(ofPtr<triggerZone> zn){
if(synthCanvas != NULL)delete synthCanvas;
synthCanvas = new ofxUIScrollableCanvas(ofGetWidth()/2 - tabBarWidth * 0.9 , 0, tabBarWidth * 1.8, 200);
synthCanvas->setColorFill(ofxUIColor(200));
synthCanvas->setColorFillHighlight(ofxUIColor(255));
synthCanvas->setColorBack(ofxUIColor(20, 20, 20, 150));
synthCanvas->setVisible(false);
synthCanvas->setSnapping(false);
vector<synthParam> sp = synthDictionary::getSynthParams(zn->getSynthType());
mapTypeLabels.clear();
for(int i = 0; i < sp.size(); i ++){
synthCanvas->addLabel(sp[i].name, OFX_UI_FONT_MEDIUM);
synthParam c_sp = zn->getSynthParam(i);
ofxUISlider * absl = new ofxUISlider("abs_val" , sp[i].sl_min, sp[i].sl_max, c_sp.abs_val , 100,20);
synthCanvas->addWidgetDown(absl);
absl->setID(i);
ofxUISlider * mvsl = new ofxUISlider("min_val" , sp[i].sl_min, sp[i].sl_max, c_sp.min_val , 100,20);
synthCanvas->addWidgetRight(mvsl);
mvsl->setID(i);
ofxUISlider * mxsl = new ofxUISlider("max_val" , sp[i].sl_min, sp[i].sl_max, c_sp.max_val , 100,20);
synthCanvas->addWidgetRight(mxsl);
mxsl->setID(i);
ofxUITextArea * l = new ofxUITextArea("MAP_TYPE", "MAP_TYPE: " + synthDictionary::getMapString(c_sp.map), 180,20,0,0, OFX_UI_FONT_SMALL);
synthCanvas->addWidgetRight(l);
l->setID(i);
mapTypeLabels.push_back(l);
ofxUILabelButton * zb = (ofxUILabelButton *)synthCanvas->addWidgetRight(new ofxUILabelButton("MINUS", true, 25));
ofxUILabelButton * zc = (ofxUILabelButton *)synthCanvas->addWidgetRight(new ofxUILabelButton( "PLUS", true ,25));
zb->setLabelText("-");
zc->setLabelText("+");
zb->setID(i);
zc->setID(i);
synthCanvas->addWidgetDown(new ofxUILabel("", OFX_UI_FONT_SMALL));
synthCanvas->addSpacer();
}
ofAddListener(synthCanvas->newGUIEvent,this,&testApp::synthEvents);
}