text stringlengths 0 2.2M |
|---|
case OFXOSC_TYPE_BLOB:
|
args.push_back(new ofxOscArgBlob(other.getArgAsBlob(i)));
|
break;
|
case OFXOSC_TYPE_RGBA_COLOR:
|
args.push_back(new ofxOscArgRgbaColor(other.getArgAsRgbaColor(i)));
|
break;
|
default:
|
ofLogError("ofxOscMessage") << "copy(): bad argument type "
|
<< other.getArgType(i) << " '" << (char) other.getArgType(i) << "'";
|
break;
|
}
|
}
|
return *this;
|
}
|
//--------------------------------------------------------------
|
void ofxOscMessage::clear(){
|
address = "";
|
remoteHost = "";
|
remotePort = 0;
|
for(unsigned int i = 0; i < args.size(); ++i){
|
delete args[i];
|
}
|
args.clear();
|
}
|
//--------------------------------------------------------------
|
void ofxOscMessage::setAddress(const std::string &address){
|
this->address = address;
|
}
|
//--------------------------------------------------------------
|
std::string ofxOscMessage::getAddress() const{
|
return address;
|
}
|
//--------------------------------------------------------------
|
std::string ofxOscMessage::getRemoteIp() const{
|
return remoteHost;
|
}
|
//--------------------------------------------------------------
|
std::string ofxOscMessage::getRemoteHost() const{
|
return remoteHost;
|
}
|
//--------------------------------------------------------------
|
int ofxOscMessage::getRemotePort() const{
|
return remotePort;
|
}
|
// get methods
|
//--------------------------------------------------------------
|
std::size_t ofxOscMessage::getNumArgs() const{
|
return args.size();
|
}
|
//--------------------------------------------------------------
|
ofxOscArgType ofxOscMessage::getArgType(std::size_t index) const{
|
if(index >= args.size()) {
|
ofLogError("ofxOscMessage") << "getArgType(): index "
|
<< index << " out of bounds";
|
return OFXOSC_TYPE_INDEXOUTOFBOUNDS;
|
}
|
else{
|
return args[index]->getType();
|
}
|
}
|
//--------------------------------------------------------------
|
std::string ofxOscMessage::getArgTypeName(std::size_t index) const{
|
if(index >= args.size()) {
|
ofLogError("ofxOscMessage") << "getArgTypeName(): index "
|
<< index << " out of bounds";
|
return "INDEX OUT OF BOUNDS";
|
}
|
else{
|
return args[index]->getTypeName();
|
}
|
}
|
//--------------------------------------------------------------
|
std::string ofxOscMessage::getTypeString() const {
|
std::string types = "";
|
for(std::size_t i = 0; i < args.size(); ++i) {
|
types += args[i]->getTypeName();
|
}
|
return types;
|
}
|
//--------------------------------------------------------------
|
std::int32_t ofxOscMessage::getArgAsInt(std::size_t index) const{
|
return getArgAsInt32(index);
|
}
|
//--------------------------------------------------------------
|
std::int32_t ofxOscMessage::getArgAsInt32(std::size_t index) const{
|
if(getArgType(index) != OFXOSC_TYPE_INT32){
|
if(getArgType(index) == OFXOSC_TYPE_INT64){
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.