LMMS
Loading...
Searching...
No Matches
juce::AudioProcessorEditor Class Reference

#include <juce_AudioProcessorEditor.h>

Inheritance diagram for juce::AudioProcessorEditor:
juce::Component juce::MouseListener juce::GenericAudioProcessorEditor

Classes

struct  ParameterControlHighlightInfo
struct  AudioProcessorEditorListener

Public Member Functions

 ~AudioProcessorEditor () override
AudioProcessorgetAudioProcessor () const noexcept
virtual void setControlHighlight (ParameterControlHighlightInfo)
virtual int getControlParameterIndex (Component &)
virtual bool supportsHostMIDIControllerPresence (bool hostMIDIControllerIsAvailable)
virtual void hostMIDIControllerIsAvailable (bool controllerIsAvailable)
virtual void setScaleFactor (float newScale)
void setResizable (bool allowHostToResize, bool useBottomRightCornerResizer)
bool isResizable () const noexcept
void setResizeLimits (int newMinimumWidth, int newMinimumHeight, int newMaximumWidth, int newMaximumHeight) noexcept
ComponentBoundsConstrainergetConstrainer () noexcept
void setConstrainer (ComponentBoundsConstrainer *newConstrainer)
void setBoundsConstrained (Rectangle< int > newBounds)
AudioProcessorEditorHostContextgetHostContext () const noexcept
void setHostContext (AudioProcessorEditorHostContext *context) noexcept
Public Member Functions inherited from juce::Component
 Component () noexcept
 ~Component () override
 Component (const String &componentName) noexcept
String getName () const noexcept
virtual void setName (const String &newName)
String getComponentID () const noexcept
void setComponentID (const String &newID)
virtual void setVisible (bool shouldBeVisible)
bool isVisible () const noexcept
virtual void visibilityChanged ()
bool isShowing () const
virtual void addToDesktop (int windowStyleFlags, void *nativeWindowToAttachTo=nullptr)
void removeFromDesktop ()
bool isOnDesktop () const noexcept
ComponentPeergetPeer () const
virtual void userTriedToCloseWindow ()
virtual void minimisationStateChanged (bool isNowMinimised)
virtual float getDesktopScaleFactor () const
void toFront (bool shouldAlsoGainKeyboardFocus)
void toBack ()
void toBehind (Component *other)
void setAlwaysOnTop (bool shouldStayOnTop)
bool isAlwaysOnTop () const noexcept
int getX () const noexcept
int getY () const noexcept
int getWidth () const noexcept
int getHeight () const noexcept
int getRight () const noexcept
Point< intgetPosition () const noexcept
int getBottom () const noexcept
Rectangle< intgetBounds () const noexcept
Rectangle< intgetLocalBounds () const noexcept
Rectangle< intgetBoundsInParent () const noexcept
int getScreenX () const
int getScreenY () const
Point< intgetScreenPosition () const
Rectangle< intgetScreenBounds () const
Point< intgetLocalPoint (const Component *sourceComponent, Point< int > pointRelativeToSourceComponent) const
Point< float > getLocalPoint (const Component *sourceComponent, Point< float > pointRelativeToSourceComponent) const
Rectangle< intgetLocalArea (const Component *sourceComponent, Rectangle< int > areaRelativeToSourceComponent) const
Rectangle< float > getLocalArea (const Component *sourceComponent, Rectangle< float > areaRelativeToSourceComponent) const
Point< intlocalPointToGlobal (Point< int > localPoint) const
Point< float > localPointToGlobal (Point< float > localPoint) const
Rectangle< intlocalAreaToGlobal (Rectangle< int > localArea) const
Rectangle< float > localAreaToGlobal (Rectangle< float > localArea) const
void setTopLeftPosition (int x, int y)
void setTopLeftPosition (Point< int > newTopLeftPosition)
void setTopRightPosition (int x, int y)
void setSize (int newWidth, int newHeight)
void setBounds (int x, int y, int width, int height)
void setBounds (Rectangle< int > newBounds)
void setBoundsRelative (float proportionalX, float proportionalY, float proportionalWidth, float proportionalHeight)
void setBoundsRelative (Rectangle< float > proportionalArea)
void setBoundsInset (BorderSize< int > borders)
void setBoundsToFit (Rectangle< int > targetArea, Justification justification, bool onlyReduceInSize)
void setCentrePosition (int x, int y)
void setCentrePosition (Point< int > newCentrePosition)
void setCentreRelative (float x, float y)
void centreWithSize (int width, int height)
void setTransform (const AffineTransform &transform)
AffineTransform getTransform () const
bool isTransformed () const noexcept
int proportionOfWidth (float proportion) const noexcept
int proportionOfHeight (float proportion) const noexcept
int getParentWidth () const noexcept
int getParentHeight () const noexcept
Rectangle< intgetParentMonitorArea () const
int getNumChildComponents () const noexcept
ComponentgetChildComponent (int index) const noexcept
int getIndexOfChildComponent (const Component *child) const noexcept
const Array< Component * > & getChildren () const noexcept
ComponentfindChildWithID (StringRef componentID) const noexcept
void addChildComponent (Component *child, int zOrder=-1)
void addChildComponent (Component &child, int zOrder=-1)
void addAndMakeVisible (Component *child, int zOrder=-1)
void addAndMakeVisible (Component &child, int zOrder=-1)
void addChildAndSetID (Component *child, const String &componentID)
void removeChildComponent (Component *childToRemove)
ComponentremoveChildComponent (int childIndexToRemove)
void removeAllChildren ()
void deleteAllChildren ()
ComponentgetParentComponent () const noexcept
template<class TargetClass>
TargetClass * findParentComponentOfClass () const
ComponentgetTopLevelComponent () const noexcept
bool isParentOf (const Component *possibleChild) const noexcept
virtual void parentHierarchyChanged ()
virtual void childrenChanged ()
virtual bool hitTest (int x, int y)
void setInterceptsMouseClicks (bool allowClicksOnThisComponent, bool allowClicksOnChildComponents) noexcept
void getInterceptsMouseClicks (bool &allowsClicksOnThisComponent, bool &allowsClicksOnChildComponents) const noexcept
bool contains (Point< int > localPoint)
bool contains (Point< float > localPoint)
bool reallyContains (Point< int > localPoint, bool returnTrueIfWithinAChild)
bool reallyContains (Point< float > localPoint, bool returnTrueIfWithinAChild)
ComponentgetComponentAt (int x, int y)
ComponentgetComponentAt (Point< int > position)
ComponentgetComponentAt (Point< float > position)
void repaint ()
void repaint (int x, int y, int width, int height)
void repaint (Rectangle< int > area)
void setBufferedToImage (bool shouldBeBuffered)
Image createComponentSnapshot (Rectangle< int > areaToGrab, bool clipImageToComponentBounds=true, float scaleFactor=1.0f)
void paintEntireComponent (Graphics &context, bool ignoreAlphaLevel)
void setPaintingIsUnclipped (bool shouldPaintWithoutClipping) noexcept
bool isPaintingUnclipped () const noexcept
void setComponentEffect (ImageEffectFilter *newEffect)
ImageEffectFiltergetComponentEffect () const noexcept
LookAndFeelgetLookAndFeel () const noexcept
void setLookAndFeel (LookAndFeel *newLookAndFeel)
virtual void lookAndFeelChanged ()
void sendLookAndFeelChange ()
void setOpaque (bool shouldBeOpaque)
bool isOpaque () const noexcept
void setBroughtToFrontOnMouseClick (bool shouldBeBroughtToFront) noexcept
bool isBroughtToFrontOnMouseClick () const noexcept
void setExplicitFocusOrder (int newFocusOrderIndex)
int getExplicitFocusOrder () const
void setFocusContainerType (FocusContainerType containerType) noexcept
bool isFocusContainer () const noexcept
bool isKeyboardFocusContainer () const noexcept
ComponentfindFocusContainer () const
ComponentfindKeyboardFocusContainer () const
void setWantsKeyboardFocus (bool wantsFocus) noexcept
bool getWantsKeyboardFocus () const noexcept
void setMouseClickGrabsKeyboardFocus (bool shouldGrabFocus)
bool getMouseClickGrabsKeyboardFocus () const noexcept
void grabKeyboardFocus ()
void giveAwayKeyboardFocus ()
bool hasKeyboardFocus (bool trueIfChildIsFocused) const
void moveKeyboardFocusToSibling (bool moveToNext)
virtual std::unique_ptr< ComponentTraversercreateFocusTraverser ()
virtual std::unique_ptr< ComponentTraversercreateKeyboardFocusTraverser ()
void setHasFocusOutline (bool hasFocusOutline) noexcept
bool hasFocusOutline () const noexcept
bool isEnabled () const noexcept
void setEnabled (bool shouldBeEnabled)
virtual void enablementChanged ()
float getAlpha () const noexcept
void setAlpha (float newAlpha)
virtual void alphaChanged ()
void setMouseCursor (const MouseCursor &cursorType)
virtual MouseCursor getMouseCursor ()
void updateMouseCursor () const
virtual void paint (Graphics &g)
virtual void paintOverChildren (Graphics &g)
void mouseMove (const MouseEvent &event) override
void mouseEnter (const MouseEvent &event) override
void mouseExit (const MouseEvent &event) override
void mouseDown (const MouseEvent &event) override
void mouseDrag (const MouseEvent &event) override
void mouseUp (const MouseEvent &event) override
void mouseDoubleClick (const MouseEvent &event) override
void mouseWheelMove (const MouseEvent &event, const MouseWheelDetails &wheel) override
void mouseMagnify (const MouseEvent &event, float scaleFactor) override
void setRepaintsOnMouseActivity (bool shouldRepaint) noexcept
void addMouseListener (MouseListener *newListener, bool wantsEventsForAllNestedChildComponents)
void removeMouseListener (MouseListener *listenerToRemove)
void addKeyListener (KeyListener *newListener)
void removeKeyListener (KeyListener *listenerToRemove)
virtual bool keyPressed (const KeyPress &key)
virtual bool keyStateChanged (bool isKeyDown)
virtual void modifierKeysChanged (const ModifierKeys &modifiers)
virtual void focusGained (FocusChangeType cause)
virtual void focusLost (FocusChangeType cause)
virtual void focusOfChildComponentChanged (FocusChangeType cause)
bool isMouseOver (bool includeChildren=false) const
bool isMouseButtonDown (bool includeChildren=false) const
bool isMouseOverOrDragging (bool includeChildren=false) const
Point< intgetMouseXYRelative () const
virtual void resized ()
virtual void moved ()
virtual void childBoundsChanged (Component *child)
virtual void parentSizeChanged ()
virtual void broughtToFront ()
void addComponentListener (ComponentListener *newListener)
void removeComponentListener (ComponentListener *listenerToRemove)
void postCommandMessage (int commandId)
virtual void handleCommandMessage (int commandId)
void enterModalState (bool takeKeyboardFocus=true, ModalComponentManager::Callback *callback=nullptr, bool deleteWhenDismissed=false)
void exitModalState (int returnValue)
bool isCurrentlyModal (bool onlyConsiderForemostModalComponent=true) const noexcept
bool isCurrentlyBlockedByAnotherModalComponent () const
virtual bool canModalEventBeSentToComponent (const Component *targetComponent)
virtual void inputAttemptWhenModal ()
NamedValueSetgetProperties () noexcept
const NamedValueSetgetProperties () const noexcept
Colour findColour (int colourID, bool inheritFromParent=false) const
void setColour (int colourID, Colour newColour)
void removeColour (int colourID)
bool isColourSpecified (int colourID) const
void copyAllExplicitColoursTo (Component &target) const
virtual void colourChanged ()
voidgetWindowHandle () const
PositionergetPositioner () const noexcept
void setPositioner (Positioner *newPositioner)
void setCachedComponentImage (CachedComponentImage *newCachedImage)
CachedComponentImagegetCachedComponentImage () const noexcept
void setViewportIgnoreDragFlag (bool ignoreDrag) noexcept
bool getViewportIgnoreDragFlag () const noexcept
String getTitle () const noexcept
void setTitle (const String &newTitle)
String getDescription () const noexcept
void setDescription (const String &newDescription)
String getHelpText () const noexcept
void setHelpText (const String &newHelpText)
void setAccessible (bool shouldBeAccessible)
bool isAccessible () const noexcept
AccessibilityHandlergetAccessibilityHandler ()
void invalidateAccessibilityHandler ()
void setFocusContainer (bool shouldBeFocusContainer) noexcept
void contains (int, int)=delete
Public Member Functions inherited from juce::MouseListener
virtual ~MouseListener ()=default

Public Attributes

AudioProcessorprocessor
std::unique_ptr< ResizableCornerComponentresizableCorner

Protected Member Functions

 AudioProcessorEditor (AudioProcessor &) noexcept
 AudioProcessorEditor (AudioProcessor *) noexcept

Private Member Functions

ComponentPeercreateNewPeer (int styleFlags, void *) override
void initialise ()
void editorResized (bool wasResized)
void updatePeer ()
void attachConstrainer (ComponentBoundsConstrainer *)
void attachResizableCornerComponent ()

Private Attributes

std::unique_ptr< AudioProcessorEditorListenerresizeListener
bool resizableByHost = false
ComponentBoundsConstrainer defaultConstrainer
ComponentBoundsConstrainerconstrainer = nullptr
AudioProcessorEditorHostContexthostContext = nullptr
AffineTransform hostScaleTransform

Additional Inherited Members

Public Types inherited from juce::Component
enum class  FocusContainerType { none , focusContainer , keyboardFocusContainer }
enum  FocusChangeType { focusChangedByMouseClick , focusChangedByTabKey , focusChangedDirectly }
Static Public Member Functions inherited from juce::Component
static float JUCE_CALLTYPE getApproximateScaleFactorForComponent (const Component *targetComponent)
static Component *JUCE_CALLTYPE getCurrentlyFocusedComponent () noexcept
static void JUCE_CALLTYPE unfocusAllComponents ()
static void JUCE_CALLTYPE beginDragAutoRepeat (int millisecondsBetweenCallbacks)
static bool JUCE_CALLTYPE isMouseButtonDownAnywhere () noexcept
static int JUCE_CALLTYPE getNumCurrentlyModalComponents () noexcept
static Component *JUCE_CALLTYPE getCurrentlyModalComponent (int index=0) noexcept
Static Protected Member Functions inherited from juce::Component
static std::unique_ptr< AccessibilityHandlercreateIgnoredAccessibilityHandler (Component &)

Detailed Description

Base class for the component that acts as the GUI for an AudioProcessor.

Derive your editor component from this class, and create an instance of it by overriding the AudioProcessor::createEditor() method.

See also
AudioProcessor, GenericAudioProcessorEditor

@tags{Audio}

Constructor & Destructor Documentation

◆ AudioProcessorEditor() [1/2]

juce::AudioProcessorEditor::AudioProcessorEditor ( AudioProcessor & p)
protectednoexcept

Creates an editor for the specified processor.

◆ AudioProcessorEditor() [2/2]

juce::AudioProcessorEditor::AudioProcessorEditor ( AudioProcessor * p)
protectednoexcept

Creates an editor for the specified processor.

◆ ~AudioProcessorEditor()

juce::AudioProcessorEditor::~AudioProcessorEditor ( )
override

Destructor.

Member Function Documentation

◆ attachConstrainer()

void juce::AudioProcessorEditor::attachConstrainer ( ComponentBoundsConstrainer * newConstrainer)
private

◆ attachResizableCornerComponent()

void juce::AudioProcessorEditor::attachResizableCornerComponent ( )
private

◆ createNewPeer()

ComponentPeer * juce::AudioProcessorEditor::createNewPeer ( int styleFlags,
void * nativeWindow )
overrideprivatevirtual

Reimplemented from juce::Component.

◆ editorResized()

void juce::AudioProcessorEditor::editorResized ( bool wasResized)
private

◆ getAudioProcessor()

AudioProcessor * juce::AudioProcessorEditor::getAudioProcessor ( ) const
inlinenoexcept

Returns a pointer to the processor that this editor represents.

This method is here to support legacy code, but it's easier to just use the AudioProcessorEditor::processor member variable directly to get this object.

◆ getConstrainer()

ComponentBoundsConstrainer * juce::AudioProcessorEditor::getConstrainer ( )
inlinenoexcept

Returns the bounds constrainer object that this window is using.

You can access this to change its properties.

◆ getControlParameterIndex()

int juce::AudioProcessorEditor::getControlParameterIndex ( Component & )
virtual

Called by certain plug-in wrappers to find out whether a component is used to control a parameter.

If the given component represents a particular plugin parameter, then this method should return the index of that parameter. If not, it should return -1. Currently only AAX plugins will call this, and implementing it is optional.

◆ getHostContext()

AudioProcessorEditorHostContext * juce::AudioProcessorEditor::getHostContext ( ) const
inlinenoexcept

Gets a context object, if one is available.

Returns nullptr if the host does not provide any information that the editor can query.

The returned pointer is non-owning, so do not attempt to free it.

◆ hostMIDIControllerIsAvailable()

void juce::AudioProcessorEditor::hostMIDIControllerIsAvailable ( bool controllerIsAvailable)
virtual

Called to indicate if a host is providing a MIDI controller when the host reconfigures its layout.

Use this as an opportunity to hide or display your own onscreen keyboard or other input component.

Currently only AUv3 plug-ins compiled for MacOS 10.13 or iOS 11.0 (or later) support this functionality.

◆ initialise()

void juce::AudioProcessorEditor::initialise ( )
private

◆ isResizable()

bool juce::AudioProcessorEditor::isResizable ( ) const
inlinenoexcept

Returns true if the host is allowed to resize the editor's parent window.

See also
setResizable

◆ setBoundsConstrained()

void juce::AudioProcessorEditor::setBoundsConstrained ( Rectangle< int > newBounds)

Calls the window's setBounds method, after first checking these bounds with the current constrainer.

See also
setConstrainer

◆ setConstrainer()

void juce::AudioProcessorEditor::setConstrainer ( ComponentBoundsConstrainer * newConstrainer)

Sets the bounds-constrainer object to use for resizing and dragging this window.

A pointer to the object you pass in will be kept, but it won't be deleted by this object, so it's the caller's responsibility to manage it.

If you pass a nullptr, then no constraints will be placed on the positioning of the window.

◆ setControlHighlight()

void juce::AudioProcessorEditor::setControlHighlight ( ParameterControlHighlightInfo )
virtual

Some types of plugin can call this to suggest that the control for a particular parameter should be highlighted.

Currently only AAX plugins will call this, and implementing it is optional.

◆ setHostContext()

void juce::AudioProcessorEditor::setHostContext ( AudioProcessorEditorHostContext * context)
inlinenoexcept

Sets a context object that can be queried to find information that the host makes available to the plugin.

You will only need to call this function if you are implementing a plugin host.

◆ setResizable()

void juce::AudioProcessorEditor::setResizable ( bool allowHostToResize,
bool useBottomRightCornerResizer )

Sets whether the editor is resizable by the host and/or user.

Parameters
allowHostToResizewhether the editor's parent window can be resized by the host. Even if this is false, you can still resize your window yourself by calling setBounds (for example, when a user clicks on a button in your editor to drop out a panel) which will bypass any resizable/constraints checks.
useBottomRightCornerResizerif this is true, a ResizableCornerComponent will be added to the editor's bottom-right to allow the user to resize the editor regardless of the value of allowHostToResize.
See also
setResizeLimits, isResizable

◆ setResizeLimits()

void juce::AudioProcessorEditor::setResizeLimits ( int newMinimumWidth,
int newMinimumHeight,
int newMaximumWidth,
int newMaximumHeight )
noexcept

This sets the maximum and minimum sizes for the window.

If the window's current size is outside these limits, it will be resized to make sure it's within them.

If you pass in a different minimum and maximum size, this will mark the editor as resizable by the host.

A direct call to setBounds() will bypass any constraint checks, but when the window is dragged by the user or resized by other indirect means, the constrainer will limit the numbers involved.

Note that if you have set a custom constrainer for this editor then this will have no effect, and if you have removed the constrainer with setConstrainer (nullptr); then this will re-add the default constrainer with the new limits.

See also
setResizable

◆ setScaleFactor()

void juce::AudioProcessorEditor::setScaleFactor ( float newScale)
virtual

Can be called by a host to tell the editor that it should use a non-unity GUI scale.

◆ supportsHostMIDIControllerPresence()

bool juce::AudioProcessorEditor::supportsHostMIDIControllerPresence ( bool hostMIDIControllerIsAvailable)
virtual

Override this method to indicate if your editor supports the presence or absence of a host-provided MIDI controller.

Currently only AUv3 plug-ins compiled for MacOS 10.13 or iOS 11.0 (or later) support this functionality, and even then the host may choose to ignore this information.

The default behaviour is to report support for both cases.

◆ updatePeer()

void juce::AudioProcessorEditor::updatePeer ( )
private

Member Data Documentation

◆ constrainer

ComponentBoundsConstrainer* juce::AudioProcessorEditor::constrainer = nullptr
private

◆ defaultConstrainer

ComponentBoundsConstrainer juce::AudioProcessorEditor::defaultConstrainer
private

◆ hostContext

AudioProcessorEditorHostContext* juce::AudioProcessorEditor::hostContext = nullptr
private

◆ hostScaleTransform

AffineTransform juce::AudioProcessorEditor::hostScaleTransform
private

◆ processor

AudioProcessor& juce::AudioProcessorEditor::processor

The AudioProcessor that this editor represents.

◆ resizableByHost

bool juce::AudioProcessorEditor::resizableByHost = false
private

◆ resizableCorner

std::unique_ptr<ResizableCornerComponent> juce::AudioProcessorEditor::resizableCorner

The ResizableCornerComponent which is currently being used by this editor, or nullptr if it does not have one.

◆ resizeListener

std::unique_ptr<AudioProcessorEditorListener> juce::AudioProcessorEditor::resizeListener
private

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