Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@MartinBspheroid
Created April 11, 2016 22:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MartinBspheroid/a8cd3653a257a7f7bebde9f4984c8ac4 to your computer and use it in GitHub Desktop.
Save MartinBspheroid/a8cd3653a257a7f7bebde9f4984c8ac4 to your computer and use it in GitHub Desktop.
void OSC_TestApp::setupReciever(int portNum)
{
if (mReciever)
{
mReciever->close();
mReciever.release();
mReciever = make_unique<osc::ReceiverUdp>(portNum);
} else
{
mReciever = make_unique<osc::ReceiverUdp>(portNum);
}
mReciever->setListener("*",[&](const osc::Message& msg)
{
adress = msg.getAddress();
for (int i = 0; i < msg.getNumArgs(); ++i)
{
console() << adress + "\t" << msg.getArgFloat(i) << endl;
}
});
mReciever->bind();
mReciever->listen();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment