From 7ddd7e11a7b8596a7c7e992c14f16af33dcd45c7 Mon Sep 17 00:00:00 2001 From: LeonPS Date: Thu, 18 Jul 2024 15:53:54 +0100 Subject: [PATCH] Add default value to WebSlider attachment --- .../utilities/juce_ParameterAttachments.cpp | 3 ++- modules/juce_gui_extra/native/javascript/index.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/juce_audio_processors/utilities/juce_ParameterAttachments.cpp b/modules/juce_audio_processors/utilities/juce_ParameterAttachments.cpp index 0c2ca3e13406..1c516ba99b0b 100644 --- a/modules/juce_audio_processors/utilities/juce_ParameterAttachments.cpp +++ b/modules/juce_audio_processors/utilities/juce_ParameterAttachments.cpp @@ -310,7 +310,8 @@ void WebSliderParameterAttachment::sendInitialUpdate() object->setProperty ("numSteps", numSteps); object->setProperty ("interval", range.interval); - object->setProperty ("parameterIndex", parameter.getParameterIndex()); + object->setProperty ("parameterIndex", parameter.getParameterIndex()); + object->setProperty ("defaultValue", parameter.getDefaultValue()); sliderState.emitEvent (object.get()); attachment.sendInitialUpdate(); } diff --git a/modules/juce_gui_extra/native/javascript/index.js b/modules/juce_gui_extra/native/javascript/index.js index 228e29314246..8104641401e4 100644 --- a/modules/juce_gui_extra/native/javascript/index.js +++ b/modules/juce_gui_extra/native/javascript/index.js @@ -152,7 +152,8 @@ class SliderState { label: "", numSteps: 100, interval: 0, - parameterIndex: -1, + parameterIndex: -1, + defaultValue: 0 }; this.valueChangedEvent = new ListenerList(); this.propertiesChangedEvent = new ListenerList();