|
@ -6,6 +6,7 @@ |
|
|
#include <thread>
|
|
|
#include <thread>
|
|
|
#include "osc/OscReceivedElements.h"
|
|
|
#include "osc/OscReceivedElements.h"
|
|
|
#include "osc/OscPacketListener.h"
|
|
|
#include "osc/OscPacketListener.h"
|
|
|
|
|
|
#include "osc/OscOutboundPacketStream.h"
|
|
|
#include "ip/UdpSocket.h"
|
|
|
#include "ip/UdpSocket.h"
|
|
|
|
|
|
|
|
|
//Class from OSC library (oscpack). This calls our handleOscMsg() on every new message.
|
|
|
//Class from OSC library (oscpack). This calls our handleOscMsg() on every new message.
|
|
@ -169,6 +170,36 @@ DLLEXPORT char* getStringData(char* targetString, unsigned int targetSize, unsig |
|
|
return targetString; |
|
|
return targetString; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
DLLEXPORT void sendOscMessageInt(char* ip, unsigned int port, char* address, int payload) |
|
|
|
|
|
{ |
|
|
|
|
|
UdpTransmitSocket transmitSocket(IpEndpointName(ip, port)); |
|
|
|
|
|
char buffer[1024]; |
|
|
|
|
|
osc::OutboundPacketStream p(buffer, 1024); |
|
|
|
|
|
p << osc::BeginMessage(address) << payload << osc::EndMessage; |
|
|
|
|
|
|
|
|
|
|
|
transmitSocket.Send(p.Data(), p.Size()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
DLLEXPORT void sendOscMessageFloat(char* ip, unsigned int port, char* address, float payload) |
|
|
|
|
|
{ |
|
|
|
|
|
UdpTransmitSocket transmitSocket(IpEndpointName(ip, port)); |
|
|
|
|
|
char buffer[1024]; |
|
|
|
|
|
osc::OutboundPacketStream p(buffer, 1024); |
|
|
|
|
|
p << osc::BeginMessage(address) << payload << osc::EndMessage; |
|
|
|
|
|
|
|
|
|
|
|
transmitSocket.Send(p.Data(), p.Size()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
DLLEXPORT void sendOscMessageString(char* ip, unsigned int port, char* address, char* payload) |
|
|
|
|
|
{ |
|
|
|
|
|
UdpTransmitSocket transmitSocket(IpEndpointName(ip, port)); |
|
|
|
|
|
char buffer[1024]; |
|
|
|
|
|
osc::OutboundPacketStream p(buffer, 1024); |
|
|
|
|
|
p << osc::BeginMessage(address) << payload << osc::EndMessage; |
|
|
|
|
|
|
|
|
|
|
|
transmitSocket.Send(p.Data(), p.Size()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
void removeStoredString(int stringId) |
|
|
void removeStoredString(int stringId) |
|
|
{ |
|
|
{ |
|
|
for (UINT i = 0; i < storedStrings.size(); i++) |
|
|
for (UINT i = 0; i < storedStrings.size(); i++) |
|
|