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