juce-framework / JUCE

JUCE is an open-source cross-platform C++ application framework for desktop and mobile applications, including VST, VST3, AU, AUv3, LV2 and AAX audio plug-ins.
https://juce.com
Other
6.54k stars 1.73k forks source link

[Bug]: (JUCE 8) WebSliderParameterAttachment returns INT_MAX for numSteps #1390

Closed caenopy closed 2 months ago

caenopy commented 3 months ago

Detailed steps on how to reproduce the bug

Build the WebViewPluginDemo in the JUCE 8 preview and look at

void WebSliderParameterAttachment::sendInitialUpdate()
{
    const auto range = parameter.getNormalisableRange();
    DynamicObject::Ptr object { new DynamicObject };
    object->setProperty (detail::WebSliderRelayEvents::Event::eventTypeKey, "propertiesChanged");
    object->setProperty ("start", range.start);
    object->setProperty ("end", range.end);
    object->setProperty ("skew", range.skew);
    object->setProperty ("name", parameter.getName (100));
    object->setProperty ("label", parameter.getLabel());
    object->setProperty ("numSteps", parameter.getNumSteps());
    object->setProperty ("interval", range.interval);
    sliderState.emitEvent (object.get());
    attachment.sendInitialUpdate();
}

What is the expected behaviour?

getNumSteps() should return something like ((range.end - range.start) / range.interval) + 1).

Operating systems

macOS

What versions of the operating systems?

Ventura 13.3

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

I have not tested against the develop branch

Code of Conduct

szarvas commented 2 months ago

Thank you for reporting the issue.

A fix is now available on the develop branch d2f3e920f7335e6daa70251fbc453c77137f01f9.