Helper class that relays audio parameter information to an object inside a WebBrowserComponent. More...
#include <juce_WebControlRelays.h>
Classes | |
struct | Listener |
Public Member Functions | |
WebSliderRelay (StringRef nameIn) | |
Creating a relay will ensure that a Javascript object under the provided name will be available in the specified WebBrowserComponent's context. | |
void | setValue (float newValue) |
float | getValue () const |
void | addListener (Listener *l) |
void | removeListener (Listener *l) |
WebBrowserComponent::Options | buildOptions (const WebBrowserComponent::Options &initialOptions) override |
void | emitEvent (const var &payload) |
Public Member Functions inherited from OptionsBuilder< WebBrowserComponent::Options > | |
virtual | ~OptionsBuilder ()=default |
WebBrowserComponent::Options | buildOptions () |
Helper class that relays audio parameter information to an object inside a WebBrowserComponent.
In order to create a relay you need to specify a WebBrowserComponent object and an identifier for the relayed state. This will result in a Javascript object becoming available inside the WebBrowserComponent under the provided identifier.
You can then use a WebSliderParameterAttachment as you would a SliderAttachment, to attach the relay to a RangedAudioParameter. This will synchronise the state and events of the Javascript object with the audio parameter at all times.
WebSliderRelay::WebSliderRelay | ( | StringRef | nameIn | ) |
Creating a relay will ensure that a Javascript object under the provided name will be available in the specified WebBrowserComponent's context.
Use the frontend framework's getSliderState function with the same name to get a hold of this object.
void WebSliderRelay::setValue | ( | float | newValue | ) |
float WebSliderRelay::getValue | ( | ) | const |
void WebSliderRelay::addListener | ( | Listener * | l | ) |
void WebSliderRelay::removeListener | ( | Listener * | l | ) |
|
overridevirtual |
Implements OptionsBuilder< WebBrowserComponent::Options >.
void WebSliderRelay::emitEvent | ( | const var & | payload | ) |