void ofxOscSender::appendBundle( ofxOscBundle& bundle, osc::OutboundPacketStream& p ) { // recursively serialise the bundle p << osc::BeginBundleImmediate; for ( int i=0; i<bundle.getBundleCount(); i++ ) { appendBundle( bundle.getBundleAt( i ), p ); } for ( int i=0; i<bundle.getMessageCount(); i++ ) { appendMessage( bundle.getMessageAt( i ), p ); } p << osc::EndBundle; }
void ofxDaito::addMessage(string address, ofVec2f data) { ofxOscMessage msg; msg.setAddress(address); msg.addFloatArg(data.x); msg.addFloatArg(data.y); bundle.addMessage(msg); }
void ofxOscSender::appendParameter( ofxOscBundle & _bundle, const ofAbstractParameter & parameter, string address){ if(parameter.type()==typeid(ofParameterGroup).name()){ ofxOscBundle bundle; const ofParameterGroup & group = static_cast<const ofParameterGroup &>(parameter); for(std::size_t i=0;i<group.size();i++){ const ofAbstractParameter & p = group[i]; if(p.isSerializable()){ appendParameter(bundle,p,address+group.getEscapedName()+"/"); } } _bundle.addBundle(bundle); }else{ if(parameter.isSerializable()){ ofxOscMessage msg; appendParameter(msg,parameter,address); _bundle.addMessage(msg); } } }
void ofxDaito::addMessage(string address, int data) { ofxOscMessage msg; msg.setAddress(address); msg.addIntArg(data); bundle.addMessage(msg); }
void ofxDaito::clearBundle() { bundle.clear(); }