Compare commits
No commits in common. "ee649473c3b8e94768b69fedcf6a13e7d77bded7" and "c0f962d2be9c6db7bcbc11284e16eaf78d2e0e5c" have entirely different histories.
ee649473c3
...
c0f962d2be
@ -51,8 +51,8 @@ END
|
|||||||
//
|
//
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION 1,0,0,0
|
FILEVERSION 0,3,0,0
|
||||||
PRODUCTVERSION 1,0,0,0
|
PRODUCTVERSION 0,3,0,0
|
||||||
FILEFLAGSMASK 0x3fL
|
FILEFLAGSMASK 0x3fL
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
FILEFLAGS 0x1L
|
FILEFLAGS 0x1L
|
||||||
@ -69,12 +69,12 @@ BEGIN
|
|||||||
BEGIN
|
BEGIN
|
||||||
VALUE "CompanyName", "Eleton Audio"
|
VALUE "CompanyName", "Eleton Audio"
|
||||||
VALUE "FileDescription", "AutoHotkey OSC integration"
|
VALUE "FileDescription", "AutoHotkey OSC integration"
|
||||||
VALUE "FileVersion", "1.0.0.0"
|
VALUE "FileVersion", "0.3.0.0"
|
||||||
VALUE "InternalName", "OSC2AHK.dll"
|
VALUE "InternalName", "OSC2AHK.dll"
|
||||||
VALUE "LegalCopyright", "Copyright (C) 2021"
|
VALUE "LegalCopyright", "Copyright (C) 2021"
|
||||||
VALUE "OriginalFilename", "OSC2AHK.dll"
|
VALUE "OriginalFilename", "OSC2AHK.dll"
|
||||||
VALUE "ProductName", "OSC2AHK"
|
VALUE "ProductName", "OSC2AHK"
|
||||||
VALUE "ProductVersion", "1.0.0.0"
|
VALUE "ProductVersion", "0.3.0.0"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
|
@ -22,7 +22,6 @@ protected:
|
|||||||
handleOscMsg(m);
|
handleOscMsg(m);
|
||||||
}
|
}
|
||||||
catch (osc::Exception& e) {
|
catch (osc::Exception& e) {
|
||||||
(void)e;
|
|
||||||
// any parsing errors such as unexpected argument types, or
|
// any parsing errors such as unexpected argument types, or
|
||||||
// missing arguments get thrown as exceptions.
|
// missing arguments get thrown as exceptions.
|
||||||
OutputDebugString(L"ProcessMessage: Error while parsing message: ...");
|
OutputDebugString(L"ProcessMessage: Error while parsing message: ...");
|
||||||
@ -85,16 +84,12 @@ BOOL APIENTRY DllMain( HMODULE hModule,
|
|||||||
switch (ul_reason_for_call)
|
switch (ul_reason_for_call)
|
||||||
{
|
{
|
||||||
case DLL_PROCESS_ATTACH:
|
case DLL_PROCESS_ATTACH:
|
||||||
OutputDebugString(L"DLL_PROCESS_ATTACH\r\n");
|
|
||||||
break;
|
break;
|
||||||
case DLL_THREAD_ATTACH:
|
case DLL_THREAD_ATTACH:
|
||||||
OutputDebugString(L"DLL_THREAD_ATTACH\r\n");
|
|
||||||
break;
|
break;
|
||||||
case DLL_THREAD_DETACH:
|
case DLL_THREAD_DETACH:
|
||||||
OutputDebugString(L"DLL_THREAD_DETACH\r\n");
|
|
||||||
break;
|
break;
|
||||||
case DLL_PROCESS_DETACH:
|
case DLL_PROCESS_DETACH:
|
||||||
OutputDebugString(L"DLL_THREAD_DETACH\r\n");
|
|
||||||
close();
|
close();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -110,20 +105,6 @@ DLLEXPORT int open(HWND targetWindowHandle, unsigned int port)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Check if sock is currently free to use
|
|
||||||
if (sock)
|
|
||||||
{
|
|
||||||
if (sock->IsBound()) //Sock is currently opened. User should call close() first!
|
|
||||||
{
|
|
||||||
OutputDebugString(L"open: seems to be opened already!\r\n");
|
|
||||||
return 3;
|
|
||||||
}
|
|
||||||
else //Probably something went wrong in UDP socket, just try closing and reopening it...
|
|
||||||
{
|
|
||||||
close(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned int timeout = 500; //timout for port opening, in ms
|
unsigned int timeout = 500; //timout for port opening, in ms
|
||||||
|
|
||||||
/*Store handle to Autohotkey window globally*/
|
/*Store handle to Autohotkey window globally*/
|
||||||
@ -152,9 +133,7 @@ DLLEXPORT int close(unsigned int clearListeners)
|
|||||||
{
|
{
|
||||||
sock->AsynchronousBreak();
|
sock->AsynchronousBreak();
|
||||||
}
|
}
|
||||||
if(oscThread) oscThread->join();
|
oscThread->join();
|
||||||
delete sock;
|
|
||||||
sock = nullptr;
|
|
||||||
oscThread = NULL;
|
oscThread = NULL;
|
||||||
hwnd = NULL;
|
hwnd = NULL;
|
||||||
if (clearListeners) listeners.clear();
|
if (clearListeners) listeners.clear();
|
||||||
@ -219,16 +198,6 @@ DLLEXPORT void sendOscMessageInt(char* ip, unsigned int port, char* address, int
|
|||||||
transmitSocket.Send(p.Data(), p.Size());
|
transmitSocket.Send(p.Data(), p.Size());
|
||||||
}
|
}
|
||||||
|
|
||||||
DLLEXPORT void sendOscMessageInt2(char* ip, unsigned int port, char* address, int payload1, int payload2)
|
|
||||||
{
|
|
||||||
UdpTransmitSocket transmitSocket(IpEndpointName(ip, port));
|
|
||||||
char buffer[1024];
|
|
||||||
osc::OutboundPacketStream p(buffer, 1024);
|
|
||||||
p << osc::BeginMessage(address) << payload1 << payload2 << osc::EndMessage;
|
|
||||||
|
|
||||||
transmitSocket.Send(p.Data(), p.Size());
|
|
||||||
}
|
|
||||||
|
|
||||||
DLLEXPORT void sendOscMessageFloat(char* ip, unsigned int port, char* address, float payload)
|
DLLEXPORT void sendOscMessageFloat(char* ip, unsigned int port, char* address, float payload)
|
||||||
{
|
{
|
||||||
UdpTransmitSocket transmitSocket(IpEndpointName(ip, port));
|
UdpTransmitSocket transmitSocket(IpEndpointName(ip, port));
|
||||||
@ -239,16 +208,6 @@ DLLEXPORT void sendOscMessageFloat(char* ip, unsigned int port, char* address, f
|
|||||||
transmitSocket.Send(p.Data(), p.Size());
|
transmitSocket.Send(p.Data(), p.Size());
|
||||||
}
|
}
|
||||||
|
|
||||||
DLLEXPORT void sendOscMessageFloat2(char* ip, unsigned int port, char* address, float payload1, float payload2)
|
|
||||||
{
|
|
||||||
UdpTransmitSocket transmitSocket(IpEndpointName(ip, port));
|
|
||||||
char buffer[1024];
|
|
||||||
osc::OutboundPacketStream p(buffer, 1024);
|
|
||||||
p << osc::BeginMessage(address) << payload1 << payload2 << osc::EndMessage;
|
|
||||||
|
|
||||||
transmitSocket.Send(p.Data(), p.Size());
|
|
||||||
}
|
|
||||||
|
|
||||||
DLLEXPORT void sendOscMessageString(char* ip, unsigned int port, char* address, char* payload)
|
DLLEXPORT void sendOscMessageString(char* ip, unsigned int port, char* address, char* payload)
|
||||||
{
|
{
|
||||||
UdpTransmitSocket transmitSocket(IpEndpointName(ip, port));
|
UdpTransmitSocket transmitSocket(IpEndpointName(ip, port));
|
||||||
@ -259,16 +218,6 @@ DLLEXPORT void sendOscMessageString(char* ip, unsigned int port, char* address,
|
|||||||
transmitSocket.Send(p.Data(), p.Size());
|
transmitSocket.Send(p.Data(), p.Size());
|
||||||
}
|
}
|
||||||
|
|
||||||
DLLEXPORT void sendOscMessageString2(char* ip, unsigned int port, char* address, char* payload1, char* payload2)
|
|
||||||
{
|
|
||||||
UdpTransmitSocket transmitSocket(IpEndpointName(ip, port));
|
|
||||||
char buffer[1024];
|
|
||||||
osc::OutboundPacketStream p(buffer, 1024);
|
|
||||||
p << osc::BeginMessage(address) << payload1 << payload2 << 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++)
|
||||||
@ -548,7 +497,7 @@ int handleOscMsg(const osc::ReceivedMessage& m)
|
|||||||
/* Debugging function to test messaging. Probably will be removed later. */
|
/* Debugging function to test messaging. Probably will be removed later. */
|
||||||
DLLEXPORT int testMsg(HWND windowHandle, unsigned int messageID)
|
DLLEXPORT int testMsg(HWND windowHandle, unsigned int messageID)
|
||||||
{
|
{
|
||||||
float theFloat = (float)1.01;
|
float theFloat = 1.01;
|
||||||
int lParam = reinterpret_cast<int&>(theFloat);
|
int lParam = reinterpret_cast<int&>(theFloat);
|
||||||
|
|
||||||
PostMessage(hwnd, 0x1002, 0, lParam); //post to message queue
|
PostMessage(hwnd, 0x1002, 0, lParam); //post to message queue
|
||||||
|
@ -25,11 +25,8 @@ extern "C" DLLEXPORT int addListener(LPCSTR address, unsigned int messageID, uns
|
|||||||
extern "C" DLLEXPORT int removeListener(LPCSTR address);
|
extern "C" DLLEXPORT int removeListener(LPCSTR address);
|
||||||
extern "C" DLLEXPORT char* getStringData(char* targetString, unsigned int targetSize, unsigned int StringID);
|
extern "C" DLLEXPORT char* getStringData(char* targetString, unsigned int targetSize, unsigned int StringID);
|
||||||
extern "C" DLLEXPORT void sendOscMessageInt(char* ip, unsigned int port, char* address, int payload);
|
extern "C" DLLEXPORT void sendOscMessageInt(char* ip, unsigned int port, char* address, int payload);
|
||||||
extern "C" DLLEXPORT void sendOscMessageInt2(char* ip, unsigned int port, char* address, int payload1, int payload2);
|
|
||||||
extern "C" DLLEXPORT void sendOscMessageFloat(char* ip, unsigned int port, char* address, float payload);
|
extern "C" DLLEXPORT void sendOscMessageFloat(char* ip, unsigned int port, char* address, float payload);
|
||||||
extern "C" DLLEXPORT void sendOscMessageFloat2(char* ip, unsigned int port, char* address, float payload1, float payload2);
|
|
||||||
extern "C" DLLEXPORT void sendOscMessageString(char* ip, unsigned int port, char* address, char* payload);
|
extern "C" DLLEXPORT void sendOscMessageString(char* ip, unsigned int port, char* address, char* payload);
|
||||||
extern "C" DLLEXPORT void sendOscMessageString2(char* ip, unsigned int port, char* address, char* payload1, char* payload2);
|
|
||||||
int handleOscMsg(const osc::ReceivedMessage& m);
|
int handleOscMsg(const osc::ReceivedMessage& m);
|
||||||
bool isMatchingOscType(unsigned int msgType, unsigned int listenerTypeField);
|
bool isMatchingOscType(unsigned int msgType, unsigned int listenerTypeField);
|
||||||
bool isMatchingOSCAddress(const char* address, const char* pattern);
|
bool isMatchingOSCAddress(const char* address, const char* pattern);
|
||||||
|
44
msgtest.ahk
44
msgtest.ahk
@ -21,9 +21,7 @@ DllCall("LoadLibrary", "Str", "x64\Debug\OSC2AHK.dll", "Ptr")
|
|||||||
|
|
||||||
OnMessage(0x1002, "msghandlerFloat")
|
OnMessage(0x1002, "msghandlerFloat")
|
||||||
|
|
||||||
success := DllCall("OSC2AHK.dll\open", UInt, hWnd, UInt, 7003)
|
DllCall("OSC2AHK.dll\open", UInt, hWnd, UInt, 7002)
|
||||||
if (success != 0)
|
|
||||||
msgbox, Failed to open port!
|
|
||||||
|
|
||||||
DllCall("OSC2AHK.dll\addListener", AStr, "/test1", UInt, 0x1001, UInt, oscTypeInt)
|
DllCall("OSC2AHK.dll\addListener", AStr, "/test1", UInt, 0x1001, UInt, oscTypeInt)
|
||||||
OnMessage(0x1001, "msghandlerInt")
|
OnMessage(0x1001, "msghandlerInt")
|
||||||
@ -124,42 +122,10 @@ do_exit:
|
|||||||
Esc::
|
Esc::
|
||||||
ExitApp
|
ExitApp
|
||||||
|
|
||||||
+a::
|
^a::
|
||||||
;ret := DllCall("OSC2AHK.dll\open", UInt, hWnd, UInt, 7002)
|
VarSetCapacity(theStr, 10)
|
||||||
;MsgBox, %ret%
|
theStr := DllCall("OSC2AHK.dll\getStringData", AStr, theStr, UInt, 10, UInt, 0, "Cdecl AStr")
|
||||||
ip := "127.0.0.1"
|
msgbox,%theStr%
|
||||||
port := 8002
|
|
||||||
addr := "/testmsg"
|
|
||||||
data := 42
|
|
||||||
data2 := 43
|
|
||||||
DllCall("OSC2AHK.dll\sendOscMessageInt", AStr, ip, UInt, port, AStr, addr, Int, data)
|
|
||||||
return
|
|
||||||
|
|
||||||
+s::
|
|
||||||
ip := "127.0.0.1"
|
|
||||||
port := 8002
|
|
||||||
addr := "/float/msg"
|
|
||||||
data := 42.3
|
|
||||||
data2 := 54.4
|
|
||||||
DllCall("OSC2AHK.dll\sendOscMessageFloat2", AStr, ip, UInt, port, AStr, addr, Float, data, Float, data2)
|
|
||||||
return
|
|
||||||
|
|
||||||
+d::
|
|
||||||
ip := "127.0.0.1"
|
|
||||||
port := 8002
|
|
||||||
addr := "/msg/string"
|
|
||||||
data := "This is the string"
|
|
||||||
data2:= "Second string"
|
|
||||||
DllCall("OSC2AHK.dll\sendOscMessageString2", AStr, ip, UInt, port, AStr, addr, AStr, data, AStr, data2)
|
|
||||||
return
|
|
||||||
|
|
||||||
+f::
|
|
||||||
ip := "127.0.0.1"
|
|
||||||
port := 8002
|
|
||||||
addr := "/msg/string"
|
|
||||||
data := "This is the string"
|
|
||||||
DllCall("OSC2AHK.dll\sendOscMessageString", AStr, ip, UInt, port, AStr, addr, AStr, data)
|
|
||||||
return
|
|
||||||
; DllCall("OSC2AHK.dll\close", UInt, 0)
|
; DllCall("OSC2AHK.dll\close", UInt, 0)
|
||||||
;msgbox,esc
|
;msgbox,esc
|
||||||
; DllCall("OSC2AHK.dll\open", UInt, hWnd, UInt, 7001)
|
; DllCall("OSC2AHK.dll\open", UInt, hWnd, UInt, 7001)
|
Loading…
x
Reference in New Issue
Block a user