Skip to content

Instantly share code, notes, and snippets.

@fpruitt
Created August 5, 2013 15:40
Show Gist options
  • Save fpruitt/6156915 to your computer and use it in GitHub Desktop.
Save fpruitt/6156915 to your computer and use it in GitHub Desktop.
void testApp::onMessage( ofxLibwebsockets::Event& args )
{
// if(args.json != NULL)
// {
//// string df_str = args.json["TYPE"].toStyledString();
// cout << args.json.toStyledString() << endl;
// }
// //ofLog(OF_LOG_NOTICE, args.json["TYPE"]);
if(args.json != NULL)
{
if(args.json["TYPE"] == MSG_TYPE_FRAME)
{
if(args.json["ORIGIN"] != EVENT_LOCATION)
{
tileFrame = args.json;
ofLog(OF_LOG_NOTICE, " ### got message FRAME!");
ofLog(OF_LOG_NOTICE, args.json.toStyledString());
}
else
cout<<"Dropping frame from same source...\n";
}
else if(args.json["TYPE"] == MSG_TYPE_STREAM)
{
if(args.json["ORIGIN"] == EVENT_LOCATION)
{
ofLog(OF_LOG_NOTICE, " ### got message STREAM!");
ofLog(OF_LOG_NOTICE, args.json.toStyledString());
currentFrame=args.json;
}
else
cout<<"Dropping Stream Packet from same opposite source...\n";
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment