diff --git a/README.md b/README.md index c96b9ef..50ee659 100644 --- a/README.md +++ b/README.md @@ -133,5 +133,47 @@ msghandlerString(oscType, data, msgID, hwnd) } ``` +### OSC send functions +The DLL also can be used to transmit OSC messages from AutoHotkey by using the following functions: + +#### Send integer message +```cpp +void sendOscMessageInt(char* ip, unsigned int port, char* address, int payload); +``` +Example call from AHK: +``` +ip := "192.168.1.2" +port := 8002 +addr := "/testmsg" +data := 42 +DllCall("OSC2AHK.dll\sendOscMessageInt", AStr, ip, UInt, port, AStr, addr, Int, data) +``` + +#### Send float message +```cpp +void sendOscMessageFloat(char* ip, unsigned int port, char* address, float payload); +``` +Example call from AHK: +``` +ip := "192.168.1.2" +port := 8002 +addr := "/my/msg" +data := 42.3 +DllCall("OSC2AHK.dll\sendOscMessageFloat", AStr, ip, UInt, port, AStr, addr, Float, data) +``` + +#### Send string message +```cpp +void sendOscMessageString(char* ip, unsigned int port, char* address, char* payload); +``` +Example call from AHK: +``` +ip := "192.168.1.2" +port := 8002 +addr := "/some/message" +data := "This is the string" +DllCall("OSC2AHK.dll\sendOscMessageString", AStr, ip, UInt, port, AStr, addr, AStr, data) +``` + ## Credits This DLL uses the [oscpack](http://www.rossbencina.com/code/oscpack) OSC implementation by Ross Bencina. \ No newline at end of file