text
stringlengths
0
2.2M
if(getArgType(index) == OFXOSC_TYPE_DOUBLE){
// warn about possible conversion issue
ofLogWarning("ofxOscMessage")
<< "getArgAsTimetag(): converting double to Timetag "
<< "for argument " << index;
return (std::uint64_t)((ofxOscArgDouble*)args[index])->get();
}
else{
ofLogError("ofxOscMessage") << "getArgAsTimetag(): argument "
<< index << " is not a valid number";
return 0;
}
}
else{
return ((ofxOscArgTimetag*)args[index])->get();
}
}
//--------------------------------------------------------------
ofBuffer ofxOscMessage::getArgAsBlob(std::size_t index) const{
if(getArgType(index) != OFXOSC_TYPE_BLOB){
ofLogError("ofxOscMessage") << "getArgAsBlob(): argument "
<< index << " is not a blob";
return ofBuffer();
}
else{
return ((ofxOscArgBlob*)args[index])->get();
}
}
//--------------------------------------------------------------
std::uint32_t ofxOscMessage::getArgAsRgbaColor(std::size_t index) const{
if(getArgType(index) != OFXOSC_TYPE_RGBA_COLOR){
ofLogError("ofxOscMessage") << "getArgAsRgbaColor(): argument "
<< index << " is not an rgba color";
return 0;
}
else{
return ((ofxOscArgRgbaColor*)args[index])->get();
}
}
// set methods
//--------------------------------------------------------------
void ofxOscMessage::addIntArg(std::int32_t argument){
args.push_back(new ofxOscArgInt32(argument));
}
//--------------------------------------------------------------
void ofxOscMessage::addInt32Arg(std::int32_t argument){
args.push_back(new ofxOscArgInt32(argument));
}
//--------------------------------------------------------------
void ofxOscMessage::addInt64Arg(std::int64_t argument){
args.push_back(new ofxOscArgInt64(argument));
}
//--------------------------------------------------------------
void ofxOscMessage::addFloatArg(float argument){
args.push_back(new ofxOscArgFloat(argument));
}
//--------------------------------------------------------------
void ofxOscMessage::addDoubleArg(double argument){
args.push_back(new ofxOscArgDouble(argument));
}
//--------------------------------------------------------------
void ofxOscMessage::addStringArg(const std::string &argument){
args.push_back(new ofxOscArgString(argument));
}
//--------------------------------------------------------------
void ofxOscMessage::addSymbolArg(const std::string &argument){
args.push_back(new ofxOscArgSymbol(argument));
}
//--------------------------------------------------------------
void ofxOscMessage::addCharArg( char argument){
args.push_back(new ofxOscArgChar(argument));
}
//--------------------------------------------------------------
void ofxOscMessage::addMidiMessageArg(std::uint32_t argument){
args.push_back(new ofxOscArgMidiMessage(argument));
}
//--------------------------------------------------------------
void ofxOscMessage::addBoolArg(bool argument){
args.push_back(new ofxOscArgBool(argument));
}
//--------------------------------------------------------------
void ofxOscMessage::addNoneArg(){
args.push_back(new ofxOscArgNone());
}
//--------------------------------------------------------------
void ofxOscMessage::addTriggerArg(){