Browse Source

Add "/" to begin of OSC address if user doesn't. closes #6

tags/1.0
Ludwig Frühschütz 3 years ago
parent
commit
cdfa413d09
1 changed files with 7 additions and 2 deletions
  1. +7
    -2
      OSC2AHK/dllmain.cpp

+ 7
- 2
OSC2AHK/dllmain.cpp View File

@ -164,10 +164,15 @@ DLLEXPORT int close(unsigned int clearListeners)
DLLEXPORT int addListener(LPCSTR address_, unsigned int messageID_, unsigned int dataType_) DLLEXPORT int addListener(LPCSTR address_, unsigned int messageID_, unsigned int dataType_)
{ {
std::string addrStr(address_);
//All OSC addresses have to start with a '/'
if (addrStr[0] != '/') addrStr.insert(0, "/");
OutputDebugString(L"addListener: address="); OutputDebugString(L"addListener: address=");
OutputDebugStringA(address_);
OutputDebugStringA(addrStr.c_str());
OutputDebugString(L"\r\n"); OutputDebugString(L"\r\n");
listeners.push_back(Listener{ std::string(address_), dataType_, messageID_ });
listeners.push_back(Listener{ addrStr, dataType_, messageID_ });
return 0; return 0;
} }


Loading…
Cancel
Save