本文整理汇总了C++中ofxOscMessage::getArgAsInt方法的典型用法代码示例。如果您正苦于以下问题:C++ ofxOscMessage::getArgAsInt方法的具体用法?C++ ofxOscMessage::getArgAsInt怎么用?C++ ofxOscMessage::getArgAsInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ofxOscMessage
的用法示例。
在下文中一共展示了ofxOscMessage::getArgAsInt方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getMsgContent
string ofApp::getMsgContent(ofxOscMessage m){
bool DISPLAY_ALL = false;
string msg_string = "";
int iTotalArg = m.getNumArgs(), i = -1;
if (DISPLAY_ALL){
msg_string += ", port: " + m.getAddress();
}
if (++i < iTotalArg && DISPLAY_ALL) msg_string += "NAME: " + m.getArgAsString(i);
if (++i < iTotalArg) msg_string += " " + m.getArgAsString(i); //STATUS
if (++i < iTotalArg) msg_string += " " + m.getArgAsString(i); //FILE
if (++i < iTotalArg && DISPLAY_ALL) msg_string += ", POSITION: " + ofToString(m.getArgAsInt(i));
if (++i < iTotalArg && DISPLAY_ALL) msg_string += ", DURATION: " + ofToString(m.getArgAsInt(i));
if (++i < iTotalArg) msg_string += ", LOOPING: " + ofToString(m.getArgAsInt(i));
if (++i < iTotalArg && DISPLAY_ALL) msg_string += ", VOLUME: " + ofToString(m.getArgAsInt(i));
if (++i < iTotalArg && DISPLAY_ALL) msg_string += ", MUTE: " + m.getArgAsString(i);
if (++i < iTotalArg && DISPLAY_ALL) msg_string += ", ZOOM: " + ofToString(m.getArgAsInt(i));
if (++i < iTotalArg && DISPLAY_ALL) msg_string += ", BLUR: " + ofToString(m.getArgAsInt(i));
return msg_string;
}
示例2: confirmMessage
void ofApp::confirmMessage(ofxOscMessage m){
//figure out which pi
string sIp = m.getRemoteIp();
string msgContent = getMsgContent(m);
int iCurPi = -1;
if (hasEnding(sIp, pi1_ip)){
iCurPi = 0;
m_bOscConfirmations[0] = true;
logMsg("got msg from 1: " + msgContent);
}
else if (hasEnding(sIp, pi2_ip)){
iCurPi = 1;
m_bOscConfirmations[1] = true;
logMsg("got msg from 2: " + msgContent);
}
else if (hasEnding(sIp, pi3_ip)){
iCurPi = 2;
m_bOscConfirmations[2] = true;
logMsg("got msg from 3: " + msgContent);
}
else if (hasEnding(sIp, pi4_ip)){
iCurPi = 3;
m_bOscConfirmations[3] = true;
logMsg("got msg from 4: " + msgContent);
} else {
logMsg("got msg from UNKNOWN " + sIp + ": " + msgContent);
}
//update corresponding status
string sCurStatus = "";
int iCurArg = 1;
string sStatus = m.getArgAsString(iCurArg++);
string sFile = m.getArgAsString(iCurArg++);
iCurArg += 2;
bool bLoop = m.getArgAsInt(iCurArg++);
if (hasEnding(sStatus, "stoped")){
sCurStatus += "Stopped";
} else {
if (bLoop){
sCurStatus += "Loop\t";
} else {
sCurStatus += "Play\t";
}
sCurStatus += sFile;
}
m_sRpiStatuses[iCurPi] = sCurStatus;
}
示例3: getOscMessageArg
int getOscMessageArg(const ofxOscMessage& message, int i) {
return message.getArgAsInt(i);
}
示例4: oscReceiveEvent
void ofxTidalISF::oscReceiveEvent(ofxOscMessage &m){
//ISF
if(m.getAddress() == "/ofplay"){
//get layer num
int l = 0;
for (int i = 0; i < m.getNumArgs(); i+=2) {
string argName = m.getArgAsString(i);
if (argName == "l") {
l = m.getArgAsInt(i+1);
}
}
//set current inst
for (int i = 0; i < m.getNumArgs(); i+=2) {
string argName = m.getArgAsString(i);
if (argName == "s") {
isfLayers[l]->currentISF = m.getArgAsString(i+1);
}
}
//send params
for (int i = 0; i < m.getNumArgs(); i+=2) {
string argName = m.getArgAsString(i);
//find argName in floatArgs
vector<string>::iterator cIter = find(floatArgs.begin(),floatArgs.end() , argName);
if (cIter != floatArgs.end()) {
float argValue = m.getArgAsFloat(i+1);
for(int j = 0; j < isfLayers[l]->isfs.size(); j++){
if(isfLayers[l]->isfs[j]->getName() == isfLayers[l]->currentISF){
isfLayers[l]->isfs[j]->setUniform<float>(argName, argValue);
}
}
}
}
}
//PostProcess
if(m.getAddress() == "/post"){
//reset postprocess
restPostProcess();
//set postProcess name
for (int i = 0; i < m.getNumArgs(); i+=2) {
string argName = m.getArgAsString(i);
string postName;
if (argName == "s") {
postName = m.getArgAsString(i+1);
if (postName == "bloom") bloom->setEnabled(true);
if (postName == "kaleido") kaleido->setEnabled(true);
if (postName == "noise") noise->setEnabled(true);
if (postName == "rgb") rgb->setEnabled(true);
if (postName == "edge") edge->setEnabled(true);
if (postName == "pixel") pixel->setEnabled(true);
if (postName == "darken") darken->setEnabled(true);
if (postName == "contrast") contrast->setEnabled(true);
if (postName == "conv") conv->setEnabled(true);
if (postName == "dof") dof->setEnabled(true);
if (postName == "sss") sss->setEnabled(true);
if (postName == "fxaa") fxaa->setEnabled(true);
if (postName == "vtilt") vtilt->setEnabled(true);
if (postName == "htilt") htilt->setEnabled(true);
if (postName == "god") god->setEnabled(true);
if (postName == "bleach") bleach->setEnabled(true);
if (postName == "lut") lut->setEnabled(true);
if (postName == "toon") toon->setEnabled(true);
}
}
}
}