8 #include "public.sdk/source/vst/vstguieditor.h" 9 #include "pluginterfaces/vst/ivstplugview.h" 10 #include "../uidescription/uidescription.h" 11 #include "../uidescription/icontroller.h" 16 #if VST_VERSION >= 0x030607 17 #include "pluginterfaces/gui/iplugviewcontentscalesupport.h" 18 #define VST3_CONTENT_SCALE_SUPPORT 22 class ParameterChangeListener;
52 public Steinberg::Vst::IParameterFinder,
56 #ifdef VST3_CONTENT_SCALE_SUPPORT 57 ,
public Steinberg::IPlugViewContentScaleSupport
61 VST3Editor (Steinberg::Vst::EditController* controller, UTF8StringPtr templateName, UTF8StringPtr xmlFile);
62 VST3Editor (
UIDescription* desc, Steinberg::Vst::EditController* controller, UTF8StringPtr templateName, UTF8StringPtr xmlFile = 0);
64 bool exchangeView (UTF8StringPtr templateName);
65 void enableTooltips (
bool state);
67 bool setEditorSizeConstrains (
const CPoint& newMinimumSize,
const CPoint& newMaximumSize);
68 void getEditorSizeConstrains (
CPoint& minimumSize,
CPoint& maximumSize)
const;
69 bool requestResize (
const CPoint& newSize);
71 void setZoomFactor (
double factor);
72 double getZoomFactor ()
const {
return zoomFactor; }
74 void setAllowedZoomFactors (std::vector<double> zoomFactors) { allowedZoomFactors = zoomFactors; }
77 DELEGATE_REFCOUNT(Steinberg::Vst::VSTGUIEditor)
78 Steinberg::tresult PLUGIN_API queryInterface (const ::Steinberg::TUID iid,
void** obj)
override;
82 double getAbsScaleFactor ()
const;
86 void syncParameterTags ();
87 void save (
bool saveAs =
false);
88 bool enableEditing (
bool state);
90 bool PLUGIN_API open (
void* parent,
const PlatformType& type)
override;
91 void PLUGIN_API close ()
override;
93 void beginEdit (int32_t index)
override;
94 void endEdit (int32_t index)
override;
100 CMessageResult notify (
CBaseObject* sender, IdStringPtr message)
override;
102 bool beforeSizeChange (
const CRect& newSize,
const CRect& oldSize)
override;
104 Steinberg::tresult PLUGIN_API onSize (Steinberg::ViewRect* newSize)
override;
105 Steinberg::tresult PLUGIN_API canResize ()
override;
106 Steinberg::tresult PLUGIN_API checkSizeConstraint (Steinberg::ViewRect* rect)
override;
109 Steinberg::tresult PLUGIN_API findParameter (Steinberg::int32 xPos, Steinberg::int32 yPos, Steinberg::Vst::ParamID& resultTag)
override;
112 virtual void valueChanged (
CControl* pControl)
override;
113 virtual void controlBeginEdit (
CControl* pControl)
override;
114 virtual void controlEndEdit (
CControl* pControl)
override;
115 virtual void controlTagWillChange (
CControl* pControl)
override;
116 virtual void controlTagDidChange (
CControl* pControl)
override;
119 void onViewAdded (
CFrame* frame,
CView* view)
override;
120 void onViewRemoved (
CFrame* frame,
CView* view)
override;
123 void onMouseEntered (
CView* view,
CFrame* frame)
override {}
124 void onMouseExited (
CView* view,
CFrame* frame)
override {}
128 #ifdef VST3_CONTENT_SCALE_SUPPORT 129 Steinberg::tresult PLUGIN_API setContentScaleFactor (ScaleFactor factor)
override;
133 KeyboardHook* keyboardHook {
nullptr};
134 UIDescription* description {
nullptr};
135 VST3EditorDelegate* delegate {
nullptr};
136 IController* originalController {
nullptr};
137 typedef std::map<int32_t, ParameterChangeListener*> ParameterChangeListenerMap;
138 ParameterChangeListenerMap paramChangeListeners;
139 std::string viewName;
141 bool tooltipsEnabled {
true};
142 bool doCreateView {
false};
143 bool editingEnabled {
false};
144 bool requestResizeGuard {
false};
146 double contentScaleFactor {1.};
147 double zoomFactor {1.};
148 std::vector<double> allowedZoomFactors;
virtual COptionMenu * createContextMenu(const CPoint &pos, VST3Editor *editor)
create the context menu for the editor, will be added to the host menu
Definition: vst3editor.h:40
VST3 Editor with automatic parameter binding.
Definition: vst3editor.h:51
Rect structure.
Definition: crect.h:17
CMouseEventResult onMouseMoved(CFrame *frame, const CPoint &where, const CButtonState &buttons) override
a mouse move event happend on the frame at position where. If the observer handles this...
Definition: vst3editor.h:125
Definition: iuidescription.h:19
virtual CView * verifyView(CView *view, const UIAttributes &attributes, const IUIDescription *description, VST3Editor *editor)
verify a view after it was created
Definition: vst3editor.h:35
Definition: xmlparse.c:181
view added removed observer interface for CFrame
Definition: cframe.h:281
Base Object with reference counter.
Definition: vstguibase.h:276
XML description parser and view creator.
Definition: uidescription.h:24
Definition: vst3editor.cpp:95
virtual void didOpen(VST3Editor *editor)
called after the editor was opened
Definition: vst3editor.h:38
delegate extension to Steinberg::Vst::EditController for a VST3 Editor
Definition: vst3editor.h:29
virtual IController * createSubController(UTF8StringPtr name, const IUIDescription *description, VST3Editor *editor)
create a sub controller
Definition: vst3editor.h:44
Definition: customcontrols.cpp:8
base class of all VSTGUI controls
Definition: ccontrol.h:76
virtual CView * createCustomView(UTF8StringPtr name, const UIAttributes &attributes, const IUIDescription *description, VST3Editor *editor)
create a custom view
Definition: vst3editor.h:34
Definition: uiattributes.h:21
extension to IControlListener used by UIDescription
Definition: icontroller.h:20
Base Class of all view objects.
Definition: cview.h:44
CMouseEventResult onMouseDown(CFrame *frame, const CPoint &where, const CButtonState &buttons) override
a mouse down event happend on the frame at position where. If the observer handles this...
Definition: vst3editor.cpp:793
virtual bool findParameter(const CPoint &pos, Steinberg::Vst::ParamID ¶mID, VST3Editor *editor)
find a parameter
Definition: vst3editor.h:36
virtual void willClose(VST3Editor *editor)
called before the editor will close
Definition: vst3editor.h:39
Point structure.
Definition: cpoint.h:17
The CFrame is the parent container of all views.
Definition: cframe.h:32
virtual bool isPrivateParameter(const Steinberg::Vst::ParamID paramID)
check if parameter ID is private and should not be exposed to the host
Definition: vst3editor.h:37
generic mouse observer interface for CFrame
Definition: cframe.h:252