Loading...
Searching...
No Matches
WebToggleButtonRelay Class Reference

Helper class that relays audio parameter information to an object inside a WebBrowserComponent. More...

#include <juce_WebControlRelays.h>

Inheritance diagram for WebToggleButtonRelay:

Classes

struct  Listener
 

Public Member Functions

 WebToggleButtonRelay (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 setToggleState (bool newState)
 
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 ()
 

Detailed Description

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 WebToggleButtonParameterAttachment as you would a ButtonParameterAttachment, 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.

// Add a relay to your AudioProcessorEditor members
WebToggleButtonRelay muteToggleRelay { webComponent, "muteToggle" };
Helper class that relays audio parameter information to an object inside a WebBrowserComponent.
Definition juce_WebControlRelays.h:145
// In your Javascript GUI code you obtain an object from the framework
import * as Juce from "juce-framework-frontend";
const checkboxState = Juce.getToggleState("muteToggle");
See also
WebToggleButtonParameterAttachment

Constructor & Destructor Documentation

◆ WebToggleButtonRelay()

WebToggleButtonRelay::WebToggleButtonRelay ( 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 getToggleState function with the same name to get a hold of this object.

Member Function Documentation

◆ setToggleState()

void WebToggleButtonRelay::setToggleState ( bool newState)

◆ addListener()

void WebToggleButtonRelay::addListener ( Listener * l)

◆ removeListener()

void WebToggleButtonRelay::removeListener ( Listener * l)

◆ buildOptions()

WebBrowserComponent::Options WebToggleButtonRelay::buildOptions ( const WebBrowserComponent::Options & initialOptions)
overridevirtual

◆ emitEvent()

void WebToggleButtonRelay::emitEvent ( const var & payload)

The documentation for this class was generated from the following file:
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram