iPlug2 - C++ Audio Plug-in Framework
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
IPluginBase Class Reference

Base class that contains plug-in info and state manipulation methods. More...

#include <IPlugPluginBase.h>

Inheritance diagram for IPluginBase:
[legend]

Public Member Functions

 IPluginBase (int nParams, int nPresets)
 
 IPluginBase (const IPluginBase &)=delete
 
IPluginBaseoperator= (const IPluginBase &)=delete
 
const char * GetPluginName () const
 
int GetPluginVersion (bool decimal) const
 Get the plug-in version number. More...
 
void GetPluginVersionStr (WDL_String &str) const
 Gets the plug-in version as a string. More...
 
const char * GetMfrName () const
 Get the manufacturer name as a CString. More...
 
const char * GetProductName () const
 Get the product name as a CString. More...
 
int GetUniqueID () const
 
int GetMfrID () const
 
EHost GetHost () const
 
void GetHostStr (WDL_String &str) const
 Get the host name as a CString. More...
 
int GetHostVersion (bool decimal) const
 Get the host version number as an integer. More...
 
void GetHostVersionStr (WDL_String &str) const
 Get the host version number as a string. More...
 
EAPI GetAPI () const
 
const char * GetAPIStr () const
 
const char * GetArchStr () const
 
void GetBuildInfoStr (WDL_String &str, const char *date, const char *time) const
 Get the build date of the plug-in and architecture/api details in one string. More...
 
bool HasUI () const
 
bool GetHostResizeEnabled () const
 
const char * GetBundleID () const
 
const char * GetAppGroupID () const
 
int NParamGroups () const
 
int AddParamGroup (const char *name)
 Called to add a parameter group name, when a unique group name is discovered. More...
 
const char * GetParamGroupName (int idx) const
 Get the parameter group name as a particular index. More...
 
virtual void InformHostOfParameterDetailsChange ()
 Implemented by the API class, call this if you update parameter labels and hopefully the host should update it's displays (not applicable to all APIs) More...
 
bool DoesStateChunks () const
 
bool SerializeParams (IByteChunk &chunk) const
 Serializes the current double precision floating point, non-normalised values (IParam::mValue) of all parameters, into a binary byte chunk. More...
 
int UnserializeParams (const IByteChunk &chunk, int startPos)
 Unserializes double precision floating point, non-normalised values from a byte chunk into mParams. More...
 
virtual bool SerializeState (IByteChunk &chunk) const
 Override this method to serialize custom state data, if your plugin does state chunks. More...
 
virtual int UnserializeState (const IByteChunk &chunk, int startPos)
 Override this method to unserialize custom state data, if your plugin does state chunks. More...
 
virtual bool SerializeVST3CtrlrState (IByteChunk &chunk) const
 VST3 ONLY! - THIS IS ONLY INCLUDED FOR COMPATIBILITY - NOONE ELSE SHOULD NEED IT! More...
 
virtual int UnserializeVST3CtrlrState (const IByteChunk &chunk, int startPos)
 VST3 ONLY! - THIS IS ONLY INCLUDED FOR COMPATIBILITY - NOONE ELSE SHOULD NEED IT! More...
 
int GetCurrentPresetIdx () const
 Get the index of the current, active preset. More...
 
void SetCurrentPresetIdx (int idx)
 Set the index of the current, active preset. More...
 
virtual void InformHostOfPresetChange ()
 Implemented by the API class, called by the UI (etc) when the plug-in initiates a program/preset change (not applicable to all APIs) More...
 
IPresetGetPreset (int idx)
 Get a ptr to a factory preset @ param idx The index number of the preset you are referring to. More...
 
void ModifyCurrentPreset (const char *name=0)
 This method should update the current preset with current values NOTE: This is only relevant for VST2 plug-ins, which is the only format to have the notion of banks? More...
 
int NPresets () const
 Gets the number of factory presets. More...
 
bool RestorePreset (int idx)
 Restore a preset by index. More...
 
bool RestorePreset (const char *name)
 Restore a preset by name. More...
 
const char * GetPresetName (int idx) const
 Get the name a preset. More...
 
void CopyPreset (IPreset *pSrc, int destIdx, bool copyname=false)
 Copy source preset to preset at index. More...
 
void MakeDefaultPreset (const char *name=0, int nPresets=1)
 This method can be used to initialize baked-in factory presets with the default parameter values. More...
 
void MakePreset (const char *name,...)
 Create a baked-in factory preset, specifiying parameter values sequentially usage: MakePreset(name, param1, param2, ..., paramN) See DumpMakePresetSrc() which is a utility that can be used to create the code for MakePreset() calls. More...
 
void MakePresetFromNamedParams (const char *name, int nParamsNamed,...)
 Create a baked-in factory preset, specifiying parameter values with a list of parameter index and value pairs usage: MakePresetFromNamedParams(name, nParamsNamed, paramEnum1, paramVal1, paramEnum2, paramVal2, ..., paramEnumN, paramVal2) See DumpMakePresetFromNamedParamsSrc() which is a utility that can be used to create the code for MakePreset() calls nParamsNamed may be less than the total number of params. More...
 
void MakePresetFromChunk (const char *name, IByteChunk &chunk)
 Creates a preset from an IByteChunk containging serialized data. More...
 
void MakePresetFromBlob (const char *name, const char *blob, int sizeOfChunk)
 Creates a preset from a base64 encoded CString. More...
 
void PruneUninitializedPresets ()
 [AUV2 only] Removes any presets that weren't initialized More...
 
virtual void OnPresetsModified ()
 [VST2 only] Called when the preset name is changed by the host More...
 
void EnsureDefaultPreset ()
 [VST2 only] Called to fill uninitialzed presets More...
 
bool SerializePresets (IByteChunk &chunk) const
 [VST2 only] Called when the VST2 host calls effGetChunk for a bank *
More...
 
int UnserializePresets (const IByteChunk &chunk, int startPos)
 [VST2 only] Called when the VST2 host calls effSetChunk for a bank *
More...
 
void DumpMakePresetSrc (const char *file) const
 Writes a call to MakePreset() for the current preset to a new text file. More...
 
void DumpMakePresetFromNamedParamsSrc (const char *file, const char *paramEnumNames[]) const
 Writes a call to MakePresetFromNamedParams() for the current preset to a new text file. More...
 
void DumpPresetBlob (const char *file) const
 Writes a call to MakePresetFromBlob() for the current preset to a new text file. More...
 
bool SavePresetAsFXP (const char *file) const
 Save current state as a VST2 format preset. More...
 
bool SaveBankAsFXB (const char *file) const
 Save current bank as a VST2 format bank [VST2 only]. More...
 
bool LoadPresetFromFXP (const char *file)
 Load VST2 format preset. More...
 
bool LoadBankFromFXB (const char *file)
 Load VST2 format bank [VST2 only]. More...
 
void InitParamRange (int startIdx, int endIdx, int countStart, const char *nameFmtStr, double defaultVal, double minVal, double maxVal, double step, const char *label="", int flags=0, const char *group="", const IParam::Shape &shape=IParam::ShapeLinear(), IParam::EParamUnit unit=IParam::kUnitCustom, IParam::DisplayFunc displayFunc=nullptr)
 Initialise a range of parameters simultaneously. More...
 
void CloneParamRange (int cloneStartIdx, int cloneEndIdx, int startIdx, const char *searchStr="", const char *replaceStr="", const char *newGroup="")
 Clone a range of parameters, optionally doing a string substitution on the parameter name. More...
 
void ForParamInRange (int startIdx, int endIdx, std::function< void(int paramIdx, IParam &param)> func)
 Modify a range of parameters with a lamda function. More...
 
void ForParamInGroup (const char *paramGroup, std::function< void(int paramIdx, IParam &param)> func)
 Modify a parameter group simulataneously. More...
 
void CopyParamValues (int startIdx, int destIdx, int nParams)
 Copy a range of parameter values. More...
 
void CopyParamValues (const char *inGroup, const char *outGroup)
 Copy a range of parameter values for a parameter group. More...
 
void RandomiseParamValues ()
 Randomise all parameters. More...
 
void RandomiseParamValues (int startIdx, int endIdx)
 Randomise parameter values within a range. More...
 
void RandomiseParamValues (const char *paramGroup)
 Randomise parameter values for a parameter group. More...
 
void DefaultParamValues ()
 Set all parameters to their default values. More...
 
void DefaultParamValues (int startIdx, int endIdx)
 Default parameter values within a range. More...
 
void DefaultParamValues (const char *paramGroup)
 Default parameter values for a parameter group. More...
 
void PrintParamValues ()
 Default parameter values for a parameter group
More...
 

Friends

class IPlugAPP
 
class IPlugAAX
 
class IPlugVST2
 
class IPlugVST3
 
class IPlugVST3Controller
 
class IPlugVST3Processor
 
class IPlugAU
 
class IPlugAUv3
 
class IPlugWEB
 
class IPlugWAM
 
class IPlugAPIBase
 

Detailed Description

Base class that contains plug-in info and state manipulation methods.

Definition at line 26 of file IPlugPluginBase.h.

Constructor & Destructor Documentation

◆ IPluginBase()

IPluginBase::IPluginBase ( int  nParams,
int  nPresets 
)

Definition at line 22 of file IPlugPluginBase.cpp.

◆ ~IPluginBase()

IPluginBase::~IPluginBase ( )
virtual

Definition at line 29 of file IPlugPluginBase.cpp.

Member Function Documentation

◆ AddParamGroup()

int IPluginBase::AddParamGroup ( const char *  name)
inline

Called to add a parameter group name, when a unique group name is discovered.

Parameters
nameCString for the unique group name
Returns
Number of parameter groups

Definition at line 114 of file IPlugPluginBase.h.

References NParamGroups().

◆ CloneParamRange()

void IPluginBase::CloneParamRange ( int  cloneStartIdx,
int  cloneEndIdx,
int  startIdx,
const char *  searchStr = "",
const char *  replaceStr = "",
const char *  newGroup = "" 
)

Clone a range of parameters, optionally doing a string substitution on the parameter name.

Parameters
cloneStartIdxThe index of the first parameter to clone
cloneEndIdxThe index of the last parameter to clone
startIdxThe start of the cloned range
searchStrA CString to search for in the input parameter name
replaceStrA CString to replace searchStr in the output parameter name
newGroupIf the new parameter should have a different group, update here

Definition at line 149 of file IPlugPluginBase.cpp.

References IParam::Value().

◆ CopyParamValues() [1/2]

void IPluginBase::CopyParamValues ( const char *  inGroup,
const char *  outGroup 
)

Copy a range of parameter values for a parameter group.

Parameters
inGroupThe name of the group to copy from
outGroupThe name of the group to copy to

Definition at line 172 of file IPlugPluginBase.cpp.

References IParam::GetGroup().

◆ CopyParamValues() [2/2]

void IPluginBase::CopyParamValues ( int  startIdx,
int  destIdx,
int  nParams 
)

Copy a range of parameter values.

Parameters
startIdxThe index of the first parameter value to copy
destIdxThe index of the first destination parameter
nParamsThe number of parameters to copy

Definition at line 160 of file IPlugPluginBase.cpp.

◆ CopyPreset()

void IPluginBase::CopyPreset ( IPreset pSrc,
int  destIdx,
bool  copyname = false 
)
inline

Copy source preset to preset at index.

Parameters
pSrcsource preset
destIdxindex of internal destination preset

Definition at line 205 of file IPlugPluginBase.h.

References IByteChunk::Clear(), and IByteChunk::PutChunk().

◆ DefaultParamValues() [1/3]

void IPluginBase::DefaultParamValues ( )

Set all parameters to their default values.

Definition at line 217 of file IPlugPluginBase.cpp.

References DefaultParamValues().

Referenced by DefaultParamValues().

◆ DefaultParamValues() [2/3]

void IPluginBase::DefaultParamValues ( const char *  paramGroup)

Default parameter values for a parameter group.

Parameters
paramGroupThe name of the group to modify

Definition at line 229 of file IPlugPluginBase.cpp.

References ForParamInGroup(), and IParam::SetToDefault().

◆ DefaultParamValues() [3/3]

void IPluginBase::DefaultParamValues ( int  startIdx,
int  endIdx 
)

Default parameter values within a range.

Parameters
startIdxThe index of the first parameter to modify
endIdxThe index of the last parameter to modify

Definition at line 222 of file IPlugPluginBase.cpp.

References ForParamInRange(), and IParam::SetToDefault().

◆ DoesStateChunks()

bool IPluginBase::DoesStateChunks ( ) const
inline
Returns
true if the plug-in has been set up to do state chunks, via config.h

Definition at line 126 of file IPlugPluginBase.h.

Referenced by LoadBankFromFXB(), LoadPresetFromFXP(), SaveBankAsFXB(), and SavePresetAsFXP().

◆ DumpMakePresetFromNamedParamsSrc()

void IPluginBase::DumpMakePresetFromNamedParamsSrc ( const char *  file,
const char *  paramEnumNames[] 
) const

Writes a call to MakePresetFromNamedParams() for the current preset to a new text file.

Parameters
fileThe full path of the file to write or overwrite
paramEnumNamesA list of all parameter names. e.g. const char* pParamNames[] = {"kParam1", "kParam2", "kParam3"};

Definition at line 576 of file IPlugPluginBase.cpp.

References IParam::Bool(), GetCurrentPresetIdx(), GetPresetName(), IParam::Int(), IParam::Type(), and IParam::Value().

◆ DumpMakePresetSrc()

void IPluginBase::DumpMakePresetSrc ( const char *  file) const

Writes a call to MakePreset() for the current preset to a new text file.

Parameters
fileThe full path of the file to write or overwrite.

Definition at line 533 of file IPlugPluginBase.cpp.

References IParam::Bool(), GetCurrentPresetIdx(), GetPresetName(), IParam::Int(), IParam::Type(), and IParam::Value().

◆ DumpPresetBlob()

void IPluginBase::DumpPresetBlob ( const char *  file) const

Writes a call to MakePresetFromBlob() for the current preset to a new text file.

Parameters
fileThe full path of the file to write or overwrite.

Definition at line 619 of file IPlugPluginBase.cpp.

References GetCurrentPresetIdx(), IByteChunk::GetData(), GetPresetName(), and IByteChunk::Size().

◆ EnsureDefaultPreset()

void IPluginBase::EnsureDefaultPreset ( )

[VST2 only] Called to fill uninitialzed presets

Definition at line 387 of file IPlugPluginBase.cpp.

References MakeDefaultPreset().

◆ ForParamInGroup()

void IPluginBase::ForParamInGroup ( const char *  paramGroup,
std::function< void(int paramIdx, IParam &param)>  func 
)

Modify a parameter group simulataneously.

Parameters
paramGroupThe name of the group to modify
funcA lambda function to modify the parameter. Ideas: you could randomise the parameter value or reset to default

Definition at line 205 of file IPlugPluginBase.cpp.

References IParam::GetGroup().

Referenced by DefaultParamValues(), and RandomiseParamValues().

◆ ForParamInRange()

void IPluginBase::ForParamInRange ( int  startIdx,
int  endIdx,
std::function< void(int paramIdx, IParam &param)>  func 
)

Modify a range of parameters with a lamda function.

Parameters
startIdxThe index of the first parameter to modify
endIdxThe index of the last parameter to modify
funcA lambda function to modify the parameter. Ideas: you could randomise the parameter value or reset to default, modify certain params based on their group

Definition at line 197 of file IPlugPluginBase.cpp.

Referenced by DefaultParamValues(), PrintParamValues(), and RandomiseParamValues().

◆ GetAPI()

EAPI IPluginBase::GetAPI ( ) const
inline
Returns
The The plug-in API, see EAPI enum for a list of possible APIs

Definition at line 80 of file IPlugPluginBase.h.

Referenced by GetAPIStr().

◆ GetAPIStr()

const char * IPluginBase::GetAPIStr ( ) const
Returns
Returns a CString describing the plug-in API, e.g. "VST2"

Definition at line 66 of file IPlugPluginBase.cpp.

References GetAPI().

Referenced by GetBuildInfoStr().

◆ GetAppGroupID()

const char * IPluginBase::GetAppGroupID ( ) const
inline

Definition at line 104 of file IPlugPluginBase.h.

◆ GetArchStr()

const char * IPluginBase::GetArchStr ( ) const
Returns
Returns a CString either "x86" or "x64", "arm64" or "WASM" describing the binary architecture

Definition at line 82 of file IPlugPluginBase.cpp.

Referenced by GetBuildInfoStr().

◆ GetBuildInfoStr()

void IPluginBase::GetBuildInfoStr ( WDL_String &  str,
const char *  date,
const char *  time 
) const

Get the build date of the plug-in and architecture/api details in one string.

Parameters
strWDL_String will be set with the Plugin name, architecture, api, build date, build time
dateCString, use DATE macro
timeCString, use TIME macro

Definition at line 95 of file IPlugPluginBase.cpp.

References GetAPIStr(), GetArchStr(), and GetPluginVersionStr().

◆ GetBundleID()

const char * IPluginBase::GetBundleID ( ) const
inline

Definition at line 101 of file IPlugPluginBase.h.

◆ GetCurrentPresetIdx()

int IPluginBase::GetCurrentPresetIdx ( ) const
inline

Get the index of the current, active preset.

Returns
The index of the current preset

Definition at line 163 of file IPlugPluginBase.h.

Referenced by DumpMakePresetFromNamedParamsSrc(), DumpMakePresetSrc(), DumpPresetBlob(), LoadPresetFromFXP(), IVBakedPresetManagerControl::OnAttached(), SaveBankAsFXB(), and SavePresetAsFXP().

◆ GetHost()

EHost IPluginBase::GetHost ( ) const
inline
Returns
The host if it has been identified, see EHost enum for a list of possible hosts

Definition at line 64 of file IPlugPluginBase.h.

Referenced by GetHostStr(), and IPlugVST2::HostSpecificInit().

◆ GetHostResizeEnabled()

bool IPluginBase::GetHostResizeEnabled ( ) const
inline
Returns
true if the plug-in allows reszing via the host's window chrome, as defined in config.h

Definition at line 98 of file IPlugPluginBase.h.

◆ GetHostStr()

void IPluginBase::GetHostStr ( WDL_String &  str) const
inline

Get the host name as a CString.

Parameters
strstring into which to write the host name

Definition at line 68 of file IPlugPluginBase.h.

References GetHost(), and GetHostNameStr().

◆ GetHostVersion()

int IPluginBase::GetHostVersion ( bool  decimal) const

Get the host version number as an integer.

Parameters
decimaltrue indicates decimal format = VVVVRRMM, otherwise hexadecimal 0xVVVVRRMM.
Returns
The host version number as an integer.

Definition at line 53 of file IPlugPluginBase.cpp.

References GetDecimalVersion().

◆ GetHostVersionStr()

void IPluginBase::GetHostVersionStr ( WDL_String &  str) const

Get the host version number as a string.

Parameters
strstring into which to write the host version

Definition at line 61 of file IPlugPluginBase.cpp.

References GetVersionStr().

◆ GetMfrID()

int IPluginBase::GetMfrID ( ) const
inline
Returns
The plug-in manufacturer's unique four character ID as an integer

Definition at line 61 of file IPlugPluginBase.h.

◆ GetMfrName()

const char * IPluginBase::GetMfrName ( ) const
inline

Get the manufacturer name as a CString.

Definition at line 52 of file IPlugPluginBase.h.

◆ GetParamGroupName()

const char * IPluginBase::GetParamGroupName ( int  idx) const
inline

Get the parameter group name as a particular index.

Parameters
idxThe index to return
Returns
CString for the unique group name

Definition at line 119 of file IPlugPluginBase.h.

◆ GetPluginName()

const char * IPluginBase::GetPluginName ( ) const
inline
Returns
the name of the plug-in as a CString

Definition at line 37 of file IPlugPluginBase.h.

◆ GetPluginVersion()

int IPluginBase::GetPluginVersion ( bool  decimal) const

Get the plug-in version number.

Parameters
decimalSets the output format
Returns
Effect version in VVVVRRMM (if decimal is true) or Hexadecimal 0xVVVVRRMM (if decimal is false) format

Definition at line 34 of file IPlugPluginBase.cpp.

References GetDecimalVersion().

Referenced by SaveBankAsFXB(), and SavePresetAsFXP().

◆ GetPluginVersionStr()

void IPluginBase::GetPluginVersionStr ( WDL_String &  str) const

Gets the plug-in version as a string.

Parameters
strWDL_String to write to The output format is vX.M.m, where X - version, M - major, m - minor
Note
If _DEBUG is defined, D is appended to the version string
If TRACER_BUILD is defined, T is appended to the version string

Definition at line 42 of file IPlugPluginBase.cpp.

References GetVersionStr().

Referenced by GetBuildInfoStr().

◆ GetPreset()

IPreset * IPluginBase::GetPreset ( int  idx)
inline

Get a ptr to a factory preset @ param idx The index number of the preset you are referring to.

Definition at line 176 of file IPlugPluginBase.h.

◆ GetPresetName()

const char * IPluginBase::GetPresetName ( int  idx) const

Get the name a preset.

Parameters
idxThe index of the preset whose name to get
Returns
CString preset name

Definition at line 457 of file IPlugPluginBase.cpp.

Referenced by DumpMakePresetFromNamedParamsSrc(), DumpMakePresetSrc(), DumpPresetBlob(), IVBakedPresetManagerControl::OnAttached(), and SavePresetAsFXP().

◆ GetProductName()

const char * IPluginBase::GetProductName ( ) const
inline

Get the product name as a CString.

A shipping product may contain multiple plug-ins, hence this. Not used in all APIs

Definition at line 55 of file IPlugPluginBase.h.

◆ GetUniqueID()

int IPluginBase::GetUniqueID ( ) const
inline
Returns
The plug-in's unique four character ID as an integer

Definition at line 58 of file IPlugPluginBase.h.

Referenced by LoadBankFromFXB(), LoadPresetFromFXP(), SaveBankAsFXB(), and SavePresetAsFXP().

◆ HasUI()

bool IPluginBase::HasUI ( ) const
inline
Returns
true if the plug-in is meant to have a UI, as defined in config.h

Definition at line 95 of file IPlugPluginBase.h.

Referenced by IPlugAAX::EditorResize(), IPlugVST2::EditorResize(), IPlugVST3::EditorResize(), and IPlugVST3Controller::EditorResize().

◆ InformHostOfParameterDetailsChange()

virtual void IPluginBase::InformHostOfParameterDetailsChange ( )
inlinevirtual

Implemented by the API class, call this if you update parameter labels and hopefully the host should update it's displays (not applicable to all APIs)

Reimplemented in IPlugAU, and IPlugVST3.

Definition at line 122 of file IPlugPluginBase.h.

◆ InformHostOfPresetChange()

virtual void IPluginBase::InformHostOfPresetChange ( )
inlinevirtual

Implemented by the API class, called by the UI (etc) when the plug-in initiates a program/preset change (not applicable to all APIs)

Reimplemented in IPlugAAX, IPlugAPP, IPlugAU, IPlugAUv3, IPlugVST2, IPlugVST3, and IPlugVST3Controller.

Definition at line 170 of file IPlugPluginBase.h.

Referenced by LoadBankFromFXB(), and LoadPresetFromFXP().

◆ InitParamRange()

void IPluginBase::InitParamRange ( int  startIdx,
int  endIdx,
int  countStart,
const char *  nameFmtStr,
double  defaultVal,
double  minVal,
double  maxVal,
double  step,
const char *  label = "",
int  flags = 0,
const char *  group = "",
const IParam::Shape shape = IParam::ShapeLinear(),
IParam::EParamUnit  unit = IParam::kUnitCustom,
IParam::DisplayFunc  displayFunc = nullptr 
)

Initialise a range of parameters simultaneously.

This mirrors the arguments available in IParam::InitDouble, for maximum flexibility

Parameters
startIdxThe index of the first parameter to initialise
endIdxThe index of the last parameter to initialise
countStartAn integer representing the start of the count in the format string. If the first parameter should have "0" in its name, set this to 0
nameFmtStrA limited format string where i can be used to get the index + countStart, in the range of parameters specified
defaultValA default real value for the parameter
minValA minimum real value for the parameter
maxValA Maximum real value for the parameter
stepThe parameter step
labelA CString label for the parameter e.g. "decibels"
flagsAny flags, see IParam::EFlags
groupA CString group name for the parameter, e.g. "envelope"
shapeA IParam::Shape class to determine how the parameter shape should be skewed
unitAn IParam::EParamUnit which can be used in audiounit plug-ins to specify certain kinds of parameter
displayFuncAn IParam::DisplayFunc lambda function to specify a custom display function

Definition at line 139 of file IPlugPluginBase.cpp.

◆ LoadBankFromFXB()

bool IPluginBase::LoadBankFromFXB ( const char *  file)

Load VST2 format bank [VST2 only].

Parameters
fileThe full path of the file to load
Returns
/c true on success

Definition at line 913 of file IPlugPluginBase.cpp.

References DoesStateChunks(), IByteChunk::Get(), IByteChunk::GetBytes(), IByteChunk::GetData(), IByteChunk::GetIPlugVerFromChunk(), GetUniqueID(), InformHostOfPresetChange(), ModifyCurrentPreset(), IByteChunk::Resize(), RestorePreset(), and UnserializePresets().

◆ LoadPresetFromFXP()

bool IPluginBase::LoadPresetFromFXP ( const char *  file)

◆ MakeDefaultPreset()

void IPluginBase::MakeDefaultPreset ( const char *  name = 0,
int  nPresets = 1 
)

This method can be used to initialize baked-in factory presets with the default parameter values.

It finds the first uninitialized preset and initializes nPresets that follow sequentially. Typically you would use it if you have configured you plugin bank to e.g. 32 presets, you provide e.g. 8 factory presets via MakePresetXXX, but you want to fill the rest of the 32 presets with default values

Parameters
nameThe name to give the presets
nPresetsThe number of presets to fill with default values

Definition at line 273 of file IPlugPluginBase.cpp.

References SerializeState().

Referenced by EnsureDefaultPreset().

◆ MakePreset()

void IPluginBase::MakePreset ( const char *  name,
  ... 
)

Create a baked-in factory preset, specifiying parameter values sequentially usage: MakePreset(name, param1, param2, ..., paramN) See DumpMakePresetSrc() which is a utility that can be used to create the code for MakePreset() calls.

Parameters
nameThe preset name
...The list of parameter values, ordered sequentially according to paramIdx

Definition at line 287 of file IPlugPluginBase.cpp.

References IByteChunk::Put().

◆ MakePresetFromBlob()

void IPluginBase::MakePresetFromBlob ( const char *  name,
const char *  blob,
int  sizeOfChunk 
)

Creates a preset from a base64 encoded CString.

This can be used when your plugin state includes arbitary data, other than just parameters. See DumpPresetBlob() which is a utility that can be used to create the code for DumpPresetBlob() calls

Parameters
nameThe preset name
blobThe base64 encoded string
sizeOfChunkThe binary string size

Definition at line 363 of file IPlugPluginBase.cpp.

References IByteChunk::GetData(), MakePresetFromChunk(), and IByteChunk::Resize().

◆ MakePresetFromChunk()

void IPluginBase::MakePresetFromChunk ( const char *  name,
IByteChunk chunk 
)

Creates a preset from an IByteChunk containging serialized data.

This can be used when your plugin state includes arbitary data, other than just parameters.

Parameters
nameThe preset name
chunkAn IByteChunk where the preset data has been serialized

Definition at line 351 of file IPlugPluginBase.cpp.

References IByteChunk::PutChunk().

Referenced by MakePresetFromBlob().

◆ MakePresetFromNamedParams()

void IPluginBase::MakePresetFromNamedParams ( const char *  name,
int  nParamsNamed,
  ... 
)

Create a baked-in factory preset, specifiying parameter values with a list of parameter index and value pairs usage: MakePresetFromNamedParams(name, nParamsNamed, paramEnum1, paramVal1, paramEnum2, paramVal2, ..., paramEnumN, paramVal2) See DumpMakePresetFromNamedParamsSrc() which is a utility that can be used to create the code for MakePreset() calls nParamsNamed may be less than the total number of params.

Parameters
nameThe preset name
nParamsNamedThe number of parameter index/value pairs. Parameters that are not set will be defaulted.
...The list of parameter index and value pairs

Definition at line 308 of file IPlugPluginBase.cpp.

◆ ModifyCurrentPreset()

void IPluginBase::ModifyCurrentPreset ( const char *  name = 0)

This method should update the current preset with current values NOTE: This is only relevant for VST2 plug-ins, which is the only format to have the notion of banks?

Parameters
nameCString name of the modified preset

Definition at line 466 of file IPlugPluginBase.cpp.

References IByteChunk::Clear(), and SerializeState().

Referenced by LoadBankFromFXB(), and LoadPresetFromFXP().

◆ NParamGroups()

int IPluginBase::NParamGroups ( ) const
inline
Returns
The number of unique parameter groups identified

Definition at line 109 of file IPlugPluginBase.h.

Referenced by AddParamGroup().

◆ NPresets()

int IPluginBase::NPresets ( ) const
inline

Gets the number of factory presets.

NOTE: some hosts don't like 0 presets, so even if you don't support factory presets, this method should return 1

Returns
The number of factory presets

Definition at line 185 of file IPlugPluginBase.h.

Referenced by IVBakedPresetManagerControl::OnAttached(), SaveBankAsFXB(), and SetCurrentPresetIdx().

◆ OnPresetsModified()

virtual void IPluginBase::OnPresetsModified ( )
inlinevirtual

[VST2 only] Called when the preset name is changed by the host

Definition at line 256 of file IPlugPluginBase.h.

Referenced by RestorePreset().

◆ PrintParamValues()

void IPluginBase::PrintParamValues ( )

Default parameter values for a parameter group

Definition at line 251 of file IPlugPluginBase.cpp.

References ForParamInRange(), and IParam::PrintDetails().

◆ PruneUninitializedPresets()

void IPluginBase::PruneUninitializedPresets ( )

[AUV2 only] Removes any presets that weren't initialized

Definition at line 393 of file IPlugPluginBase.cpp.

◆ RandomiseParamValues() [1/3]

void IPluginBase::RandomiseParamValues ( )

Randomise all parameters.

Definition at line 236 of file IPlugPluginBase.cpp.

References RandomiseParamValues().

Referenced by RandomiseParamValues().

◆ RandomiseParamValues() [2/3]

void IPluginBase::RandomiseParamValues ( const char *  paramGroup)

Randomise parameter values for a parameter group.

Parameters
paramGroupThe name of the group to modify

Definition at line 246 of file IPlugPluginBase.cpp.

References ForParamInGroup(), and IParam::SetNormalized().

◆ RandomiseParamValues() [3/3]

void IPluginBase::RandomiseParamValues ( int  startIdx,
int  endIdx 
)

Randomise parameter values within a range.

NOTE for more flexibility in terms of RNG etc, use ForParamInRange()

Parameters
startIdxThe index of the first parameter to modify
endIdxThe index of the last parameter to modify

Definition at line 241 of file IPlugPluginBase.cpp.

References ForParamInRange(), and IParam::SetNormalized().

◆ RestorePreset() [1/2]

bool IPluginBase::RestorePreset ( const char *  name)

Restore a preset by name.

Parameters
CStringname of the preset to restore
Returns
true on success

Definition at line 440 of file IPlugPluginBase.cpp.

References RestorePreset().

◆ RestorePreset() [2/2]

bool IPluginBase::RestorePreset ( int  idx)

Restore a preset by index.

This should also update mCurrentPresetIdx

Parameters
idxThe index of the preset to restore
Returns
true on success

Definition at line 411 of file IPlugPluginBase.cpp.

References OnPresetsModified(), SerializeState(), and UnserializeState().

Referenced by LoadBankFromFXB(), LoadPresetFromFXP(), RestorePreset(), and UnserializePresets().

◆ SaveBankAsFXB()

bool IPluginBase::SaveBankAsFXB ( const char *  file) const

Save current bank as a VST2 format bank [VST2 only].

Parameters
fileThe full path of the file to write or overwrite
Returns
/c true on success

Definition at line 717 of file IPlugPluginBase.cpp.

References DoesStateChunks(), IByteChunk::Get(), GetCurrentPresetIdx(), IByteChunk::GetData(), GetPluginVersion(), GetUniqueID(), IByteChunk::InitChunkWithIPlugVer(), NPresets(), IByteChunk::Put(), IByteChunk::PutBytes(), SerializePresets(), and IByteChunk::Size().

◆ SavePresetAsFXP()

bool IPluginBase::SavePresetAsFXP ( const char *  file) const

Save current state as a VST2 format preset.

Parameters
fileThe full path of the file to write or overwrite
Returns
/c true on success

Definition at line 644 of file IPlugPluginBase.cpp.

References DoesStateChunks(), GetCurrentPresetIdx(), IByteChunk::GetData(), GetPluginVersion(), GetPresetName(), GetUniqueID(), IByteChunk::InitChunkWithIPlugVer(), IByteChunk::Put(), IByteChunk::PutBytes(), SerializeState(), and IByteChunk::Size().

◆ SerializeParams()

bool IPluginBase::SerializeParams ( IByteChunk chunk) const

Serializes the current double precision floating point, non-normalised values (IParam::mValue) of all parameters, into a binary byte chunk.

Parameters
chunkThe output chunk to serialize to. Will append data if the chunk has already been started.
Returns
true if the serialization was successful

Definition at line 104 of file IPlugPluginBase.cpp.

References IParam::GetName(), IByteChunk::Put(), and IParam::Value().

Referenced by SerializeState().

◆ SerializePresets()

bool IPluginBase::SerializePresets ( IByteChunk chunk) const

[VST2 only] Called when the VST2 host calls effGetChunk for a bank *

Parameters
chunkIByteChunk where the presets will be serialized
Returns
/c true on success

Definition at line 484 of file IPlugPluginBase.cpp.

References IByteChunk::Put(), IByteChunk::PutChunk(), and IByteChunk::PutStr().

Referenced by SaveBankAsFXB().

◆ SerializeState()

virtual bool IPluginBase::SerializeState ( IByteChunk chunk) const
inlinevirtual

Override this method to serialize custom state data, if your plugin does state chunks.

Parameters
chunkThe output bytechunk where data can be serialized
Returns
true if serialization was successful

Definition at line 142 of file IPlugPluginBase.h.

References SerializeParams().

Referenced by MakeDefaultPreset(), ModifyCurrentPreset(), RestorePreset(), SavePresetAsFXP(), and UnserializePresets().

◆ SerializeVST3CtrlrState()

virtual bool IPluginBase::SerializeVST3CtrlrState ( IByteChunk chunk) const
inlinevirtual

VST3 ONLY! - THIS IS ONLY INCLUDED FOR COMPATIBILITY - NOONE ELSE SHOULD NEED IT!

Parameters
chunkThe output bytechunk where data can be serialized.
Returns
true if serialization was successful

Definition at line 154 of file IPlugPluginBase.h.

◆ SetCurrentPresetIdx()

void IPluginBase::SetCurrentPresetIdx ( int  idx)
inline

Set the index of the current, active preset.

Parameters
idxThe index of the current preset

Definition at line 167 of file IPlugPluginBase.h.

References NPresets().

◆ UnserializeParams()

int IPluginBase::UnserializeParams ( const IByteChunk chunk,
int  startPos 
)

Unserializes double precision floating point, non-normalised values from a byte chunk into mParams.

Parameters
chunkThe incoming chunk where parameter values are stored to unserialize
startPosThe start position in the chunk where parameter values are stored
Returns
The new chunk position (endPos)

Definition at line 119 of file IPlugPluginBase.cpp.

References IByteChunk::Get(), IParam::GetName(), IParam::Set(), and IParam::Value().

Referenced by UnserializeState().

◆ UnserializePresets()

int IPluginBase::UnserializePresets ( const IByteChunk chunk,
int  startPos 
)

[VST2 only] Called when the VST2 host calls effSetChunk for a bank *

Parameters
chunkIByteChunk where the preset bank will be unserialized
startPosThe starting position in the chunk for the preset bank
Returns
int The new chunk position (endPos).

Definition at line 505 of file IPlugPluginBase.cpp.

References IByteChunk::Clear(), IByteChunk::Get(), IByteChunk::GetStr(), RestorePreset(), SerializeState(), and UnserializeState().

Referenced by LoadBankFromFXB().

◆ UnserializeState()

virtual int IPluginBase::UnserializeState ( const IByteChunk chunk,
int  startPos 
)
inlinevirtual

Override this method to unserialize custom state data, if your plugin does state chunks.

Implementations should call UnserializeParams() after custom data is unserialized

Parameters
chunkThe incoming chunk containing the state data.
startPosThe position in the chunk where the data starts
Returns
The new chunk position (endPos)

Definition at line 149 of file IPlugPluginBase.h.

References UnserializeParams().

Referenced by LoadPresetFromFXP(), RestorePreset(), and UnserializePresets().

◆ UnserializeVST3CtrlrState()

virtual int IPluginBase::UnserializeVST3CtrlrState ( const IByteChunk chunk,
int  startPos 
)
inlinevirtual

VST3 ONLY! - THIS IS ONLY INCLUDED FOR COMPATIBILITY - NOONE ELSE SHOULD NEED IT!

Parameters
chunkchunk The incoming chunk containing the state data.
Returns
The new chunk position (endPos)

Definition at line 159 of file IPlugPluginBase.h.

Friends And Related Function Documentation

◆ IPlugAAX

friend class IPlugAAX
friend

Definition at line 384 of file IPlugPluginBase.h.

◆ IPlugAPIBase

friend class IPlugAPIBase
friend

Definition at line 393 of file IPlugPluginBase.h.

◆ IPlugAPP

friend class IPlugAPP
friend

Definition at line 383 of file IPlugPluginBase.h.

◆ IPlugAU

friend class IPlugAU
friend

Definition at line 389 of file IPlugPluginBase.h.

◆ IPlugAUv3

friend class IPlugAUv3
friend

Definition at line 390 of file IPlugPluginBase.h.

◆ IPlugVST2

friend class IPlugVST2
friend

Definition at line 385 of file IPlugPluginBase.h.

◆ IPlugVST3

friend class IPlugVST3
friend

Definition at line 386 of file IPlugPluginBase.h.

◆ IPlugVST3Controller

friend class IPlugVST3Controller
friend

Definition at line 387 of file IPlugPluginBase.h.

◆ IPlugVST3Processor

friend class IPlugVST3Processor
friend

Definition at line 388 of file IPlugPluginBase.h.

◆ IPlugWAM

friend class IPlugWAM
friend

Definition at line 392 of file IPlugPluginBase.h.

◆ IPlugWEB

friend class IPlugWEB
friend

Definition at line 391 of file IPlugPluginBase.h.


The documentation for this class was generated from the following files: