43 splashScreen.deleteAndZero();
57void AudioProcessorEditor::initialise()
76 attachConstrainer (&defaultConstrainer);
77 resizeListener.
reset (
new AudioProcessorEditorListener (*
this));
84 resizableByHost = allowHostToResize;
88 if (useBottomRightCornerResizer != hasResizableCorner)
90 if (useBottomRightCornerResizer)
91 attachResizableCornerComponent();
100 int newMaximumHeight)
noexcept
102 if (constrainer !=
nullptr && constrainer != &defaultConstrainer)
109 resizableByHost = (newMinimumWidth != newMaximumWidth || newMinimumHeight != newMaximumHeight);
111 defaultConstrainer.setSizeLimits (newMinimumWidth, newMinimumHeight,
112 newMaximumWidth, newMaximumHeight);
114 if (constrainer ==
nullptr)
115 setConstrainer (&defaultConstrainer);
117 if (resizableCorner !=
nullptr)
118 attachResizableCornerComponent();
120 setBoundsConstrained (getBounds());
125 if (constrainer != newConstrainer)
127 attachConstrainer (newConstrainer);
129 if (constrainer !=
nullptr)
134 attachResizableCornerComponent();
140 if (constrainer != newConstrainer)
142 constrainer = newConstrainer;
147void AudioProcessorEditor::attachResizableCornerComponent()
152 editorResized (
true);
157 if (constrainer ==
nullptr)
167 newBounds.
getY() != currentBounds.getY() && newBounds.
getBottom() == currentBounds.getBottom(),
168 newBounds.
getX() != currentBounds.getX() && newBounds.
getRight() == currentBounds.getRight(),
169 newBounds.
getY() == currentBounds.getY() && newBounds.
getBottom() != currentBounds.getBottom(),
170 newBounds.
getX() == currentBounds.getX() && newBounds.
getRight() != currentBounds.getRight());
173void AudioProcessorEditor::editorResized (
bool wasResized)
183 bool resizerHidden =
false;
186 resizerHidden = peer->isFullScreen() || peer->isKioskMode();
192 const int resizerSize = 18;
195 resizerSize, resizerSize);
200void AudioProcessorEditor::updatePeer()
204 peer->setConstrainer (constrainer);
212 editorResized (
true);
217createUnityPeerFunctionType juce_createUnityPeerFn =
nullptr;
219ComponentPeer* AudioProcessorEditor::createNewPeer ([[maybe_unused]]
int styleFlags,
220 [[maybe_unused]]
void* nativeWindow)
222 if (juce_createUnityPeerFn !=
nullptr)
223 return juce_createUnityPeerFn (*
this);
225 return Component::createNewPeer (styleFlags, nativeWindow);
230 #if JUCE_MODULE_AVAILABLE_juce_opengl && JUCE_MAC
231 if (@available (macOS 10.14, *))
void setBoundsConstrained(Rectangle< int > newBounds)
Calls the window's setBounds method, after first checking these bounds with the current constrainer.
AudioProcessorEditor(AudioProcessor &) noexcept
Creates an editor for the specified processor.
virtual bool supportsHostMIDIControllerPresence(bool hostMIDIControllerIsAvailable)
Override this method to indicate if your editor supports the presence or absence of a host-provided M...
void setResizable(bool allowHostToResize, bool useBottomRightCornerResizer)
Sets whether the editor is resizable by the host and/or user.
virtual int getControlParameterIndex(Component &)
Called by certain plug-in wrappers to find out whether a component is used to control a parameter.
~AudioProcessorEditor() override
Destructor.
virtual void setControlHighlight(ParameterControlHighlightInfo)
Some types of plugin can call this to suggest that the control for a particular parameter should be h...
virtual void setScaleFactor(float newScale)
Can be called by a host to tell the editor that it should use a non-unity GUI scale.
void setResizeLimits(int newMinimumWidth, int newMinimumHeight, int newMaximumWidth, int newMaximumHeight) noexcept
This sets the maximum and minimum sizes for the window.
virtual bool wantsLayerBackedView() const
The plugin wrapper will call this function to decide whether to use a layer-backed view to host the e...
std::unique_ptr< ResizableCornerComponent > resizableCorner
The ResizableCornerComponent which is currently being used by this editor, or nullptr if it does not ...
AudioProcessor & processor
The AudioProcessor that this editor represents.
virtual void hostMIDIControllerIsAvailable(bool controllerIsAvailable)
Called to indicate if a host is providing a MIDI controller when the host reconfigures its layout.
void setConstrainer(ComponentBoundsConstrainer *newConstrainer)
Sets the bounds-constrainer object to use for resizing and dragging this window.
Used by the setParameterHighlighting() method.
Base class for audio processing classes or plugins.
AudioProcessorEditor * getActiveEditor() const noexcept
Returns the active editor, if there is one.
A class that imposes restrictions on a Component's size or position.
int getMaximumWidth() const noexcept
Returns the current maximum width.
void setBoundsForComponent(Component *component, Rectangle< int > bounds, bool isStretchingTop, bool isStretchingLeft, bool isStretchingBottom, bool isStretchingRight)
Checks the given bounds, and then sets the component to the corrected size.
int getMinimumWidth() const noexcept
Returns the current minimum width.
int getMinimumHeight() const noexcept
Returns the current minimum height.
int getMaximumHeight() const noexcept
Returns the current maximum height.
The Component class uses a ComponentPeer internally to create and manage a real operating-system wind...
The base class for all JUCE user-interface objects.
AffineTransform getTransform() const
Returns the transform that is currently being applied to this component.
void setTransform(const AffineTransform &transform)
Sets a transform matrix to be applied to this component.
void removeComponentListener(ComponentListener *listenerToRemove)
Removes a component listener.
int getHeight() const noexcept
Returns the component's height in pixels.
void addComponentListener(ComponentListener *newListener)
Adds a listener to be told about changes to the component hierarchy or position.
Rectangle< int > getBounds() const noexcept
Returns this component's bounding box.
bool isOnDesktop() const noexcept
Returns true if this component is currently showing on the desktop.
void setBounds(int x, int y, int width, int height)
Changes the component's position and size.
int getWidth() const noexcept
Returns the component's width in pixels.
ComponentPeer * getPeer() const
Returns the heavyweight window that contains this component.
void addChildComponent(Component *child, int zOrder=-1)
Adds a child component to this one.
The standard JUCE splash screen component.
Manages a rectangle and allows geometric operations to be performed on it.
ValueType getRight() const noexcept
Returns the x coordinate of the rectangle's right-hand-side.
ValueType getX() const noexcept
Returns the x coordinate of the rectangle's left-hand-side.
ValueType getBottom() const noexcept
Returns the y coordinate of the rectangle's bottom edge.
ValueType getY() const noexcept
Returns the y coordinate of the rectangle's top edge.