Example #1
0
string OscController::getParameterName(ofAbstractParameter &parameter){
    string paramName = "";
    const vector<string> hierarchy = parameter.getGroupHierarchyNames();
    for(int i=0; i<(int)hierarchy.size()-1; i++){
        paramName += hierarchy[i] + ".";
    }
    paramName += parameter.getEscapedName();

    return paramName;
}
Example #2
0
void ofxOscSender::sendParameter( const ofAbstractParameter & parameter){
	if(!parameter.isSerializable()) return;
	if(parameter.type()==typeid(ofParameterGroup).name()){
		string address = "/";
		const vector<string> hierarchy = parameter.getGroupHierarchyNames();
		for(int i=0;i<(int)hierarchy.size()-1;i++){
			address+=hierarchy[i] + "/";
		}
		ofxOscBundle bundle;
		appendParameter(bundle,parameter,address);
		sendBundle(bundle);
	}else{
		string address = "";
		const vector<string> hierarchy = parameter.getGroupHierarchyNames();
		for(int i=0;i<(int)hierarchy.size()-1;i++){
			address+= "/" + hierarchy[i];
		}
		if(address.length()) address += "/";
		ofxOscMessage msg;
		appendParameter(msg,parameter,address);
		sendMessage(msg, false);
	}
}