本文整理汇总了C++中osc::ReceivedMessage::types方法的典型用法代码示例。如果您正苦于以下问题:C++ ReceivedMessage::types方法的具体用法?C++ ReceivedMessage::types怎么用?C++ ReceivedMessage::types使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osc::ReceivedMessage
的用法示例。
在下文中一共展示了ReceivedMessage::types方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: processOscMessage
bool App::processOscMessage(const osc::ReceivedMessage& message,
const osc::MessageSource& source)
{
LOG_DEBUG << "received " << message.path() << " " << message.types() << std::endl;
if(message.path() == getOscRootAddress() + "/scene")
{
if(message.types() == "s")
{
string scene = message.asString(0);
sceneManager.gotoScene(scene);
return true;
}
else if(message.types() == "i")
{
int index = message.asInt32(0);
sceneManager.gotoScene(index);
return true;
}
}
else if(message.path() == getOscRootAddress() + "/scene/prev")
{
sceneManager.prevScene();
return true;
}
else if(message.path() == getOscRootAddress() + "/scene/next")
{
sceneManager.nextScene();
return true;
}
else if(message.path() == getOscRootAddress() + "/quit")
{
exitMainLoop();
return true;
}
return false;
}
示例2: processOscMessage
bool Sprite::processOscMessage(const osc::ReceivedMessage& message,
const osc::MessageSource& source)
{
// call the base class
if(DrawableObject::processOscMessage(message, source))
{
return true;
}
if(message.path() == getOscRootAddress() + "/position" &&
message.types() == "ii")
{
//osc::ReceivedMessage::const_iterator arg = m.ArgumentsBegin();
pos.x = message.asInt32(0);
pos.y = message.asInt32(1);
return true;
}
else if(message.path() == getOscRootAddress() + "/position/x" &&
message.types() == "i")
{
//osc::ReceivedMessage::const_iterator arg = m.ArgumentsBegin();
pos.x = message.asInt32(0);
return true;
}
else if(message.path() == getOscRootAddress() + "/position/y" &&
message.types() == "i")
{
// osc::ReceivedMessage::const_iterator arg = m.ArgumentsBegin();
pos.y = message.asInt32(0);
return true;
}
else if(message.path() == getOscRootAddress() + "/center" &&
message.types() == "i")
{
//osc::ReceivedMessage::const_iterator arg = m.ArgumentsBegin();
setDrawFromCenter((bool) message.asInt32(0));
return true;
}
else if(message.path() == getOscRootAddress() + "/animate" &&
message.types() == "i")
{
//osc::ReceivedMessage::const_iterator arg = m.ArgumentsBegin();
bAnimate = (bool) message.asInt32(0);
return true;
}
else if(message.path() == getOscRootAddress() + "/overlay" &&
message.types() == "i")
{
bDrawAllLayers = (bool) message.asInt32(0);
return true;
}
return false;
}