JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins

« « « Anklang Documentation
Loading...
Searching...
No Matches
juce_AudioProcessorEditor.h
Go to the documentation of this file.
1 /*
2 ==============================================================================
3
4 This file is part of the JUCE library.
5 Copyright (c) 2022 - Raw Material Software Limited
6
7 JUCE is an open source library subject to commercial or open-source
8 licensing.
9
10 By using JUCE, you agree to the terms of both the JUCE 7 End-User License
11 Agreement and JUCE Privacy Policy.
12
13 End User License Agreement: www.juce.com/juce-7-licence
14 Privacy Policy: www.juce.com/juce-privacy-policy
15
16 Or: You may also use this code under the terms of the GPL v3 (see
17 www.gnu.org/licenses).
18
19 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
20 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
21 DISCLAIMED.
22
23 ==============================================================================
24*/
25
26namespace juce
27{
28
29class AudioProcessorEditorListener;
30
31//==============================================================================
42class JUCE_API AudioProcessorEditor : public Component
43{
44protected:
45 //==============================================================================
48
51
52public:
54 ~AudioProcessorEditor() override;
55
56 //==============================================================================
59
65 AudioProcessor* getAudioProcessor() const noexcept { return &processor; }
66
67 //==============================================================================
70 {
71 int parameterIndex;
72 bool isHighlighted;
73 Colour suggestedColour;
74 };
75
81 virtual void setControlHighlight (ParameterControlHighlightInfo);
82
90 virtual int getControlParameterIndex (Component&);
91
101 virtual bool supportsHostMIDIControllerPresence (bool hostMIDIControllerIsAvailable);
102
112 virtual void hostMIDIControllerIsAvailable (bool controllerIsAvailable);
113
117 virtual void setScaleFactor (float newScale);
118
119 //==============================================================================
135 void setResizable (bool allowHostToResize, bool useBottomRightCornerResizer);
136
141 bool isResizable() const noexcept { return resizableByHost; }
142
161 void setResizeLimits (int newMinimumWidth,
162 int newMinimumHeight,
163 int newMaximumWidth,
164 int newMaximumHeight) noexcept;
165
170 ComponentBoundsConstrainer* getConstrainer() noexcept { return constrainer; }
171
179 void setConstrainer (ComponentBoundsConstrainer* newConstrainer);
180
186 void setBoundsConstrained (Rectangle<int> newBounds);
187
195 AudioProcessorEditorHostContext* getHostContext() const noexcept { return hostContext; }
196
202 void setHostContext (AudioProcessorEditorHostContext* context) noexcept { hostContext = context; }
203
208
224 virtual bool wantsLayerBackedView() const;
225
226private:
227 //==============================================================================
228 struct AudioProcessorEditorListener : public ComponentListener
229 {
230 AudioProcessorEditorListener (AudioProcessorEditor& e) : ed (e) {}
231
232 void componentMovedOrResized (Component&, bool, bool wasResized) override { ed.editorResized (wasResized); }
233 void componentParentHierarchyChanged (Component&) override { ed.updatePeer(); }
234
235 AudioProcessorEditor& ed;
236
237 JUCE_DECLARE_NON_COPYABLE (AudioProcessorEditorListener)
238 };
239
240 ComponentPeer* createNewPeer (int styleFlags, void*) override;
241
242 //==============================================================================
243 void initialise();
244 void editorResized (bool wasResized);
245 void updatePeer();
246 void attachConstrainer (ComponentBoundsConstrainer*);
247 void attachResizableCornerComponent();
248
249 //==============================================================================
251 bool resizableByHost = false;
252 ComponentBoundsConstrainer defaultConstrainer;
253 ComponentBoundsConstrainer* constrainer = nullptr;
254 AudioProcessorEditorHostContext* hostContext = nullptr;
255 Component::SafePointer<Component> splashScreen;
256 AffineTransform hostScaleTransform;
257
258 JUCE_DECLARE_NON_COPYABLE (AudioProcessorEditor)
259};
260
261} // namespace juce
Base class for the component that acts as the GUI for an AudioProcessor.
ComponentBoundsConstrainer * getConstrainer() noexcept
Returns the bounds constrainer object that this window is using.
AudioProcessor * getAudioProcessor() const noexcept
Returns a pointer to the processor that this editor represents.
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.
AudioProcessorEditorHostContext * getHostContext() const noexcept
Gets a context object, if one is available.
void setHostContext(AudioProcessorEditorHostContext *context) noexcept
Sets a context object that can be queried to find information that the host makes available to the pl...
bool isResizable() const noexcept
Returns true if the host is allowed to resize the editor's parent window.
Base class for audio processing classes or plugins.
Represents a colour, also including a transparency value.
Definition juce_Colour.h:38
A class that imposes restrictions on a Component's size or position.
Gets informed about changes to a component's hierarchy or position.
The base class for all JUCE user-interface objects.
Manages a rectangle and allows geometric operations to be performed on it.
#define JUCE_DECLARE_NON_COPYABLE(className)
This is a shorthand macro for deleting a class's copy constructor and copy assignment operator.
JUCE Namespace.
Calling AudioProcessorEditor::getHostContext() may return a pointer to an instance of this class.