JUCE icon indicating copy to clipboard operation
JUCE copied to clipboard

[Bug] With workaround in source: OSCSender cannot be used to set parameters.

Open julonexus opened this issue 1 year ago • 0 comments

Detailed steps on how to reproduce the bug

OSCSender trim the end charatcer if it is "/". So, as per this documentation : https://tostibroeders.nl/wp-content/uploads/2020/02/X32-OSC.pdf "/" commands to set nodes (that is not /node"), is removed and cannot be understand.

Write :

void test(juce::OSCSender&  sender) {
sender.send("/", juce::String("ch/01/config 'T' 1 YE 1"));
}

It will send something like

"~~~,s~~ch/01/config 'T' 1 YE 1~"

Where it should be

"/~~~,s~~ch/01/config 'T' 1 YE 1~"

The workaround is simply to add the check on trimmedEnd to not be at the beginning of the string : "if (trimmedEnd < end && trimmedEnd > text)" at https://github.com/juce-framework/JUCE/blob/22df0d2266007bccb25d6ed52b9907f60d04e971/modules/juce_core/text/juce_String.cpp#L1727

Or maybe to just add if (isNotEmpty() && (charactersToRetain != "/" || text != "/")) at https://github.com/juce-framework/JUCE/blob/22df0d2266007bccb25d6ed52b9907f60d04e971/modules/juce_core/text/juce_String.cpp#L1713

What is the expected behaviour?

Keep"/" address pattern.

Operating systems

Windows

What versions of the operating systems?

Windows 11

Architectures

64-bit

Stacktrace

No response

Plug-in formats (if applicable)

No response

Plug-in host applications (DAWs) (if applicable)

No response

Testing on the develop branch

The bug is present on the develop branch

Code of Conduct

  • [X] I agree to follow the Code of Conduct

julonexus avatar Oct 12 '23 20:10 julonexus