26#include "IPlugStructs.h"
53 for (
int i = 0; i < nParams; i++)
86 int NParams()
const {
return mParams.GetSize(); }
98#pragma mark - Methods you may want to override...
112 Trace(TRACELOC,
"idx:%i src:%s\n", paramIdx, ParamSourceStrs[source]);
131 for (
int i = 0; i <
NParams(); ++i)
147 virtual bool OnMessage(
int msgTag,
int ctrlTag,
int dataSize,
const void* pData) {
return false; }
164#pragma mark - Methods for sending values TO the user interface
169 for (
int i = 0; i <
NParams(); ++i)
228#pragma mark - Methods for sending values FROM the user interface
262 virtual bool EditorResizeFromUI(
int viewWidth,
int viewHeight,
bool needsPlatformResize) {
return false; }
291#pragma mark - Editor resizing
292 void SetEditorSize(
int width,
int height) { mEditorWidth = width; mEditorHeight = height; }
301 mMinWidth = std::min(widthLo, widthHi);
302 mMaxWidth = std::max(widthLo, widthHi);
303 mMinHeight = std::min(heightLo, heightHi);
304 mMaxHeight = std::max(heightLo, heightHi);
313 int GetMinWidth()
const {
return mMinWidth; }
314 int GetMaxWidth()
const {
return mMaxWidth; }
315 int GetMinHeight()
const {
return mMinHeight; }
316 int GetMaxHeight()
const {
return mMaxHeight; }
324 if(w >= mMinWidth && w <= mMaxWidth && h >= mMinHeight && h <= mMaxHeight)
330 w =
Clip(w, mMinWidth, mMaxWidth);
331 h =
Clip(h, mMinHeight, mMaxHeight);
359 friend class IPlugWEB;
366 WDL_PtrList<IParam> mParams;
369 int mEditorWidth = 0;
371 int mEditorHeight = 0;
373 int mMinWidth = 10, mMaxWidth = 100000, mMinHeight = 10, mMaxHeight = 100000;
MIDI and sysex structs/utilites.
Manages a block of memory, for plug-in settings store/recall.
This pure virtual interface delegates communication in both directions between a UI editor and someth...
IParam * AddParam()
Adds an IParam to the parameters ptr list Note: This is only used in special circumstances,...
virtual void OnSysexMsgUI(const ISysEx &msg)
Handle incoming SysEx messages sent to the user interface.
virtual int UnserializeEditorState(const IByteChunk &chunk, int startPos)
Unserializes editor state (such as scale).
virtual void OnParamReset(EParamSource source)
Called when parameters have changed to inform the plugin of the changes Override only if you need to ...
virtual void OnUIClose()
Override this method to do something before the UI is closed.
virtual void BeginInformHostOfParamChangeFromUI(int paramIdx)=0
Called by the UI at the beginning of a parameter change gesture, in order to notify the host (via a c...
virtual void OnParamChange(int paramIdx, EParamSource source, int sampleOffset=-1)
Override this method to do something to your DSP when a parameter changes.
IParam * GetParam(int paramIdx)
Get a pointer to one of the delegate's IParam objects.
virtual void OnParamChange(int paramIdx)
Another version of the OnParamChange method without an EParamSource, for backwards compatibility / si...
virtual void OnParamChangeUI(int paramIdx, EParamSource source=kUnknown)
Override this method to do something when a parameter changes on the main/UI thread Like OnParamChang...
virtual void SendParameterValueFromUI(int paramIdx, double normalizedValue)
SPVFUI Called by the UI during a parameter change gesture, in order to notify the host of the new val...
virtual void EndInformHostOfParamChangeFromUI(int paramIdx)=0
Called by the user interface at the end of a parameter change gesture, in order to notify the host (v...
virtual void * OpenWindow(void *pParent)
If you are not using IGraphics, you can implement this method to attach to the native parent view e....
virtual void SendControlValueFromDelegate(int ctrlTag, double normalizedValue)
SendControlValueFromDelegate (Abbreviation: SCVFD) WARNING: should not be called on the realtime audi...
virtual void SendMidiMsgFromUI(const IMidiMsg &msg)
SendMidiMsgFromUI (Abbreviation: SMMFUI) This method should be used when sending a MIDI message from ...
virtual void OnMidiMsgUI(const IMidiMsg &msg)
Handle incoming MIDI messages sent to the user interface.
virtual void CloseWindow()
If you are not using IGraphics you can if you need to free resources etc when the window closes.
virtual void SetScreenScale(float scale)
Can be used by a host API to inform the editor of screen scale changes.
void SendCurrentParamValuesFromDelegate()
Loops through all parameters, calling SendParameterValueFromDelegate() with the current value of the ...
void SetSizeConstraints(int widthLo, int widthHi, int heightLo, int heightHi)
void RemoveParam(int idx)
Remove an IParam at a particular index Note: This is only used in special circumstances,...
virtual void DeferMidiMsg(const IMidiMsg &msg)
This method is needed, for remote editors to avoid a feedback loop.
const IParam * GetParam(int paramIdx) const
Get a const pointer to one of the delegate's IParam objects (for const methods)
virtual void SendControlMsgFromDelegate(int ctrlTag, int msgTag, int dataSize=0, const void *pData=nullptr)
SendControlMsgFromDelegate (Abbreviation: SCMFD) WARNING: should not be called on the realtime audio ...
virtual void DeferSysexMsg(const ISysEx &msg)
This method is needed, for remote editors to avoid a feedback loop.
virtual bool SerializeEditorState(IByteChunk &chunk) const
Serializes the editor state (such as scale) into a binary chunk.
virtual void SendParameterValueFromDelegate(int paramIdx, double value, bool normalized)
SendParameterValueFromDelegate (Abbreviation: SPVFD) WARNING: should not be called on the realtime au...
virtual void SendArbitraryMsgFromUI(int msgTag, int ctrlTag=kNoTag, int dataSize=0, const void *pData=nullptr)
SendArbitraryMsgFromUI (Abbreviation: SAMFUI)
virtual bool OnMessage(int msgTag, int ctrlTag, int dataSize, const void *pData)
This could be implemented in either DSP or EDITOR to receive a message from the other one.
virtual bool OnKeyUp(const IKeyPress &key)
KeyDown handler, in order to get keystrokes from certain hosts/plugin formats that send key press mes...
int GetEditorHeight() const
virtual void DirtyParametersFromUI()
When modifying a range of parameters in the editor, it can be necessary to broadcast that fact via th...
virtual void SendSysexMsgFromUI(const ISysEx &msg)
SendMidiMsgFromUI (Abbreviation: SSMFUI) If a plug-in can send Sysex data as a result of actions in t...
virtual bool OnKeyDown(const IKeyPress &key)
KeyDown handler, in order to get keystrokes from certain hosts/plugin formats that send key press mes...
int GetEditorWidth() const
virtual void SendArbitraryMsgFromDelegate(int msgTag, int dataSize=0, const void *pData=nullptr)
SendArbitraryMsgFromDelegate (Abbreviation: SAMFD) WARNING: should not be called on the realtime audi...
virtual void SendMidiMsgFromDelegate(const IMidiMsg &msg)
SendMidiMsgFromDelegate (Abbreviation: SMMFD) WARNING: should not be called on the realtime audio thr...
virtual bool ConstrainEditorResize(int &w, int &h) const
Constrain the incoming editor width and height values based on the minimum and maximum.
virtual bool EditorResizeFromUI(int viewWidth, int viewHeight, bool needsPlatformResize)
If the editor changes UI dimensions, e.g.
virtual void OnRestoreState()
This is called by API classes after restoring state and by IPluginBase::RestorePreset().
virtual void SendSysexMsgFromDelegate(const ISysEx &msg)
SendSysexMsgFromDelegate (Abbreviation: SSMFD) WARNING: should not be called on the realtime audio th...
virtual void OnParentWindowResize(int width, int height)
Called by app wrappers when the OS window scaling buttons/resizers are used.
virtual void OnUIOpen()
Override this method to do something before the UI is opened.
void SetNormalized(double normalizedValue)
Sets the parameter value from a normalized range (usually coming from the linked IControl)
AAX API base class for an IPlug plug-in.
The base class of an IPlug plug-in, which interacts with the different plug-in APIs.
Standalone application base class for an IPlug plug-in.
AudioUnit v2 API base class for an IPlug plug-in.
AudioUnit v3 API base class for an IPlug plug-in.
VST2.4 API base class for an IPlug plug-in.
VST3 Controller API-base class for a distributed IPlug VST3 plug-in.
VST3 base class for a non-distributed IPlug VST3 plug-in.
VST3 Processor API-base class for a distributed IPlug VST3 plug-in.
WebAudioModule (WAM) API base class.
Base class that contains plug-in info and state manipulation methods.
EParamSource
Used to identify the source of a parameter change.
BEGIN_IPLUG_NAMESPACE T Clip(T x, T lo, T hi)
Clips the value x between lo and hi.
Used for key press info, such as ASCII representation, virtual key (mapped to win32 codes) and modifi...
Encapsulates a MIDI message and provides helper functions.
A struct for dealing with SysEx messages.