JUCE v8.0.9
JUCE API
 
Loading...
Searching...
No Matches
juce::WebComboBoxRelay Class Referenceabstract

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

#include <juce_WebControlRelays.h>

Inheritance diagram for juce::WebComboBoxRelay:
Collaboration diagram for juce::WebComboBoxRelay:

Classes

struct  Listener
 

Public Member Functions

 WebComboBoxRelay (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 addListener (Listener *l)
 
WebBrowserComponent::Options buildOptions ()
 
WebBrowserComponent::Options buildOptions (const WebBrowserComponent::Options &initialOptions) override
 
virtual WebBrowserComponent::Options buildOptions (const WebBrowserComponent::Options &initialOptions)=0
 
void emitEvent (const var &payload)
 
void removeListener (Listener *l)
 
void setValue (float newValue)
 

Private Member Functions

void handleEvent (const var &event)
 
void webViewConstructed (WebBrowserComponent *) override
 Called from the WebBrowserComponent constructor.
 
void webViewDestructed (WebBrowserComponent *) override
 Called from the WebBrowserComponent destructor.
 

Private Attributes

WebBrowserComponentbrowser = nullptr
 
Identifier eventId { "__juce__comboBox" + name }
 
ListenerList< Listenerlisteners
 
String name
 

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 an identifier for the relayed state. This will result in a Javascript object becoming available inside the WebBrowserComponent under the provided identifier.

Pass the relay object to WebBrowserComponent::Options::withOptionsFrom() to associate it with a WebBrowserComponent instance.

You can then use a WebComboBoxParameterAttachment as you would a ComboBoxParameterAttachment, 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
WebComboBoxRelay filterTypeComboRelay { "filterTypeCombo" };
WebBrowserComponent webComponent { WebBrowserComponent::Options{}::withOptionsFrom (filterTypeComboRelay) };
Options to configure WebBrowserComponent.
Definition juce_WebBrowserComponent.h:122
A component that displays an embedded web browser.
Definition juce_WebBrowserComponent.h:84
Helper class that relays audio parameter information to an object inside a WebBrowserComponent.
Definition juce_WebControlRelays.h:227
// In your Javascript GUI code you obtain an object from the framework
import * as Juce from "juce-framework-frontend";
const comboBoxState = Juce.getComboBoxState("filterTypeCombo");
See also
WebComboBoxParameterAttachment

@tags{GUI}

Constructor & Destructor Documentation

◆ WebComboBoxRelay()

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

Member Function Documentation

◆ addListener()

void juce::WebComboBoxRelay::addListener ( Listener l)

◆ buildOptions() [1/3]

◆ buildOptions() [2/3]

WebBrowserComponent::Options juce::WebComboBoxRelay::buildOptions ( const WebBrowserComponent::Options initialOptions)
override

◆ buildOptions() [3/3]

virtual WebBrowserComponent::Options OptionsBuilder< WebBrowserComponent::Options >::buildOptions ( const WebBrowserComponent::Options &  initialOptions)
pure virtualinherited

◆ emitEvent()

void juce::WebComboBoxRelay::emitEvent ( const var payload)

◆ handleEvent()

void juce::WebComboBoxRelay::handleEvent ( const var event)
private

◆ removeListener()

void juce::WebComboBoxRelay::removeListener ( Listener l)

◆ setValue()

void juce::WebComboBoxRelay::setValue ( float  newValue)

◆ webViewConstructed()

void juce::WebComboBoxRelay::webViewConstructed ( WebBrowserComponent )
overrideprivatevirtual

Called from the WebBrowserComponent constructor.

Implements juce::WebViewLifetimeListener.

◆ webViewDestructed()

void juce::WebComboBoxRelay::webViewDestructed ( WebBrowserComponent )
overrideprivatevirtual

Called from the WebBrowserComponent destructor.

Implements juce::WebViewLifetimeListener.

Member Data Documentation

◆ browser

WebBrowserComponent* juce::WebComboBoxRelay::browser = nullptr
private

◆ eventId

Identifier juce::WebComboBoxRelay::eventId { "__juce__comboBox" + name }
private

◆ listeners

ListenerList<Listener> juce::WebComboBoxRelay::listeners
private

◆ name

String juce::WebComboBoxRelay::name
private

The documentation for this class was generated from the following file: