iPlug2 - C++ Audio Plug-in Framework
|
Base class that contains plug-in info and state manipulation methods. More...
#include <IPlugPluginBase.h>
Public Member Functions | |
IPluginBase (int nParams, int nPresets) | |
IPluginBase (const IPluginBase &)=delete | |
IPluginBase & | operator= (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 (name is normalized) More... | |
void | GetRawHostStr (WDL_String &str) const |
Get raw host name (as it is reported from the host) 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... | |
IPreset * | GetPreset (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 containing 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 ¶m)> func) |
Modify a range of parameters with a lamda function. More... | |
void | ForParamInGroup (const char *paramGroup, std::function< void(int paramIdx, IParam ¶m)> 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 |
Base class that contains plug-in info and state manipulation methods.
Definition at line 26 of file IPlugPluginBase.h.
IPluginBase::IPluginBase | ( | int | nParams, |
int | nPresets | ||
) |
Definition at line 22 of file IPlugPluginBase.cpp.
|
virtual |
Definition at line 29 of file IPlugPluginBase.cpp.
|
inline |
Called to add a parameter group name, when a unique group name is discovered.
name | CString for the unique group name |
Definition at line 118 of file IPlugPluginBase.h.
References NParamGroups().
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.
cloneStartIdx | The index of the first parameter to clone |
cloneEndIdx | The index of the last parameter to clone |
startIdx | The start of the cloned range |
searchStr | A CString to search for in the input parameter name |
replaceStr | A CString to replace searchStr in the output parameter name |
newGroup | If the new parameter should have a different group, update here |
Definition at line 157 of file IPlugPluginBase.cpp.
References IParam::Value().
void IPluginBase::CopyParamValues | ( | const char * | inGroup, |
const char * | outGroup | ||
) |
Copy a range of parameter values for a parameter group.
inGroup | The name of the group to copy from |
outGroup | The name of the group to copy to |
Definition at line 180 of file IPlugPluginBase.cpp.
References IParam::GetGroup().
void IPluginBase::CopyParamValues | ( | int | startIdx, |
int | destIdx, | ||
int | nParams | ||
) |
Copy a range of parameter values.
startIdx | The index of the first parameter value to copy |
destIdx | The index of the first destination parameter |
nParams | The number of parameters to copy |
Definition at line 168 of file IPlugPluginBase.cpp.
|
inline |
Copy source preset to preset at index.
pSrc | source preset |
destIdx | index of internal destination preset |
Definition at line 209 of file IPlugPluginBase.h.
References IByteChunk::Clear(), and IByteChunk::PutChunk().
void IPluginBase::DefaultParamValues | ( | ) |
Set all parameters to their default values.
Definition at line 225 of file IPlugPluginBase.cpp.
References DefaultParamValues().
Referenced by DefaultParamValues().
void IPluginBase::DefaultParamValues | ( | const char * | paramGroup | ) |
Default parameter values for a parameter group.
paramGroup | The name of the group to modify |
Definition at line 237 of file IPlugPluginBase.cpp.
References ForParamInGroup(), and IParam::SetToDefault().
void IPluginBase::DefaultParamValues | ( | int | startIdx, |
int | endIdx | ||
) |
Default parameter values within a range.
startIdx | The index of the first parameter to modify |
endIdx | The index of the last parameter to modify |
Definition at line 230 of file IPlugPluginBase.cpp.
References ForParamInRange(), and IParam::SetToDefault().
|
inline |
true
if the plug-in has been set up to do state chunks, via config.h Definition at line 130 of file IPlugPluginBase.h.
Referenced by LoadBankFromFXB(), LoadPresetFromFXP(), SaveBankAsFXB(), and SavePresetAsFXP().
void IPluginBase::DumpMakePresetFromNamedParamsSrc | ( | const char * | file, |
const char * | paramEnumNames[] | ||
) | const |
Writes a call to MakePresetFromNamedParams() for the current preset to a new text file.
file | The full path of the file to write or overwrite |
paramEnumNames | A list of all parameter names. e.g. const char* pParamNames[] = {"kParam1", "kParam2", "kParam3"}; |
Definition at line 584 of file IPlugPluginBase.cpp.
References IParam::Bool(), GetCurrentPresetIdx(), GetPresetName(), IParam::Int(), IParam::Type(), and IParam::Value().
void IPluginBase::DumpMakePresetSrc | ( | const char * | file | ) | const |
Writes a call to MakePreset() for the current preset to a new text file.
file | The full path of the file to write or overwrite. |
Definition at line 541 of file IPlugPluginBase.cpp.
References IParam::Bool(), GetCurrentPresetIdx(), GetPresetName(), IParam::Int(), IParam::Type(), and IParam::Value().
void IPluginBase::DumpPresetBlob | ( | const char * | file | ) | const |
Writes a call to MakePresetFromBlob() for the current preset to a new text file.
file | The full path of the file to write or overwrite. |
Definition at line 627 of file IPlugPluginBase.cpp.
References GetCurrentPresetIdx(), IByteChunk::GetData(), GetPresetName(), and IByteChunk::Size().
void IPluginBase::EnsureDefaultPreset | ( | ) |
[VST2 only] Called to fill uninitialzed presets
Definition at line 395 of file IPlugPluginBase.cpp.
References MakeDefaultPreset().
void IPluginBase::ForParamInGroup | ( | const char * | paramGroup, |
std::function< void(int paramIdx, IParam ¶m)> | func | ||
) |
Modify a parameter group simulataneously.
paramGroup | The name of the group to modify |
func | A lambda function to modify the parameter. Ideas: you could randomise the parameter value or reset to default |
Definition at line 213 of file IPlugPluginBase.cpp.
References IParam::GetGroup().
Referenced by DefaultParamValues(), and RandomiseParamValues().
void IPluginBase::ForParamInRange | ( | int | startIdx, |
int | endIdx, | ||
std::function< void(int paramIdx, IParam ¶m)> | func | ||
) |
Modify a range of parameters with a lamda function.
startIdx | The index of the first parameter to modify |
endIdx | The index of the last parameter to modify |
func | A 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 205 of file IPlugPluginBase.cpp.
Referenced by DefaultParamValues(), PrintParamValues(), and RandomiseParamValues().
|
inline |
Definition at line 84 of file IPlugPluginBase.h.
Referenced by GetAPIStr().
const char * IPluginBase::GetAPIStr | ( | ) | const |
Definition at line 66 of file IPlugPluginBase.cpp.
References GetAPI().
Referenced by GetBuildInfoStr().
|
inline |
Definition at line 108 of file IPlugPluginBase.h.
const char * IPluginBase::GetArchStr | ( | ) | const |
Definition at line 83 of file IPlugPluginBase.cpp.
Referenced by 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.
str | WDL_String will be set with the Plugin name, architecture, api, build date, build time |
date | CString, use DATE macro |
time | CString, use TIME macro |
Definition at line 100 of file IPlugPluginBase.cpp.
References GetAPIStr(), GetArchStr(), and GetPluginVersionStr().
|
inline |
Definition at line 105 of file IPlugPluginBase.h.
|
inline |
Get the index of the current, active preset.
Definition at line 167 of file IPlugPluginBase.h.
Referenced by DumpMakePresetFromNamedParamsSrc(), DumpMakePresetSrc(), DumpPresetBlob(), LoadPresetFromFXP(), IVBakedPresetManagerControl::OnAttached(), SaveBankAsFXB(), and SavePresetAsFXP().
|
inline |
Definition at line 64 of file IPlugPluginBase.h.
Referenced by GetHostStr(), and IPlugVST2::HostSpecificInit().
|
inline |
true
if the plug-in allows reszing via the host's window chrome, as defined in config.h Definition at line 102 of file IPlugPluginBase.h.
|
inline |
Get the host name (name is normalized)
str | WDL_String into which to write the host name |
Definition at line 68 of file IPlugPluginBase.h.
References GetHost(), and GetHostNameStr().
int IPluginBase::GetHostVersion | ( | bool | decimal | ) | const |
Get the host version number as an integer.
decimal | true indicates decimal format = VVVVRRMM, otherwise hexadecimal 0xVVVVRRMM. |
Definition at line 53 of file IPlugPluginBase.cpp.
References GetDecimalVersion().
void IPluginBase::GetHostVersionStr | ( | WDL_String & | str | ) | const |
Get the host version number as a string.
str | string into which to write the host version |
Definition at line 61 of file IPlugPluginBase.cpp.
References GetVersionStr().
|
inline |
Definition at line 61 of file IPlugPluginBase.h.
|
inline |
Get the manufacturer name as a CString.
Definition at line 52 of file IPlugPluginBase.h.
|
inline |
Get the parameter group name as a particular index.
idx | The index to return |
Definition at line 123 of file IPlugPluginBase.h.
|
inline |
Definition at line 37 of file IPlugPluginBase.h.
int IPluginBase::GetPluginVersion | ( | bool | decimal | ) | const |
Get the plug-in version number.
decimal | Sets the output format |
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().
void IPluginBase::GetPluginVersionStr | ( | WDL_String & | str | ) | const |
Gets the plug-in version as a string.
str | WDL_String to write to The output format is vX.M.m, where X - version, M - major, m - minor |
_DEBUG
is defined, D
is appended to the version string TRACER_BUILD
is defined, T
is appended to the version string Definition at line 42 of file IPlugPluginBase.cpp.
References GetVersionStr().
Referenced by GetBuildInfoStr().
|
inline |
Get a ptr to a factory preset @ param idx The index number of the preset you are referring to.
Definition at line 180 of file IPlugPluginBase.h.
const char * IPluginBase::GetPresetName | ( | int | idx | ) | const |
Get the name a preset.
idx | The index of the preset whose name to get |
Definition at line 465 of file IPlugPluginBase.cpp.
Referenced by DumpMakePresetFromNamedParamsSrc(), DumpMakePresetSrc(), DumpPresetBlob(), IVBakedPresetManagerControl::OnAttached(), and SavePresetAsFXP().
|
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.
|
inline |
Get raw host name (as it is reported from the host)
str | WDL_String into which to write the host name |
Definition at line 72 of file IPlugPluginBase.h.
|
inline |
Definition at line 58 of file IPlugPluginBase.h.
Referenced by LoadBankFromFXB(), LoadPresetFromFXP(), SaveBankAsFXB(), and SavePresetAsFXP().
|
inline |
true
if the plug-in is meant to have a UI, as defined in config.h Definition at line 99 of file IPlugPluginBase.h.
Referenced by IPlugAAX::EditorResize(), IPlugCLAP::EditorResize(), IPlugVST2::EditorResize(), IPlugVST3::EditorResize(), and IPlugVST3Controller::EditorResize().
|
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 126 of file IPlugPluginBase.h.
|
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 174 of file IPlugPluginBase.h.
Referenced by LoadBankFromFXB(), and LoadPresetFromFXP().
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
startIdx | The index of the first parameter to initialise |
endIdx | The index of the last parameter to initialise |
countStart | An 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 |
nameFmtStr | A limited format string where i can be used to get the index + countStart, in the range of parameters specified |
defaultVal | A default real value for the parameter |
minVal | A minimum real value for the parameter |
maxVal | A Maximum real value for the parameter |
step | The parameter step |
label | A CString label for the parameter e.g. "decibels" |
flags | Any flags, see IParam::EFlags |
group | A CString group name for the parameter, e.g. "envelope" |
shape | A IParam::Shape class to determine how the parameter shape should be skewed |
unit | An IParam::EParamUnit which can be used in audiounit plug-ins to specify certain kinds of parameter |
displayFunc | An IParam::DisplayFunc lambda function to specify a custom display function |
Definition at line 147 of file IPlugPluginBase.cpp.
bool IPluginBase::LoadBankFromFXB | ( | const char * | file | ) |
Load VST2 format bank [VST2 only].
file | The full path of the file to load |
Definition at line 921 of file IPlugPluginBase.cpp.
References DoesStateChunks(), IByteChunk::Get(), IByteChunk::GetBytes(), IByteChunk::GetData(), IByteChunk::GetIPlugVerFromChunk(), GetUniqueID(), InformHostOfPresetChange(), ModifyCurrentPreset(), IByteChunk::Resize(), RestorePreset(), and UnserializePresets().
bool IPluginBase::LoadPresetFromFXP | ( | const char * | file | ) |
Load VST2 format preset.
file | The full path of the file to load |
Definition at line 830 of file IPlugPluginBase.cpp.
References DoesStateChunks(), IByteChunk::Get(), IByteChunk::GetBytes(), GetCurrentPresetIdx(), IByteChunk::GetData(), IByteChunk::GetIPlugVerFromChunk(), GetUniqueID(), InformHostOfPresetChange(), ModifyCurrentPreset(), IByteChunk::Resize(), RestorePreset(), and UnserializeState().
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
name | The name to give the presets |
nPresets | The number of presets to fill with default values |
Definition at line 281 of file IPlugPluginBase.cpp.
References SerializeState().
Referenced by EnsureDefaultPreset().
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.
name | The preset name |
... | The list of parameter values, ordered sequentially according to paramIdx |
Definition at line 295 of file IPlugPluginBase.cpp.
References IByteChunk::Put().
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
name | The preset name |
blob | The base64 encoded string |
sizeOfChunk | The binary string size |
Definition at line 371 of file IPlugPluginBase.cpp.
References IByteChunk::GetData(), MakePresetFromChunk(), and IByteChunk::Resize().
void IPluginBase::MakePresetFromChunk | ( | const char * | name, |
IByteChunk & | chunk | ||
) |
Creates a preset from an IByteChunk containing serialized data.
This can be used when your plugin state includes arbitary data, other than just parameters.
name | The preset name |
chunk | An IByteChunk where the preset data has been serialized |
Definition at line 359 of file IPlugPluginBase.cpp.
References IByteChunk::PutChunk().
Referenced by MakePresetFromBlob().
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.
name | The preset name |
nParamsNamed | The 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 316 of file IPlugPluginBase.cpp.
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?
name | CString name of the modified preset |
Definition at line 474 of file IPlugPluginBase.cpp.
References IByteChunk::Clear(), and SerializeState().
Referenced by LoadBankFromFXB(), and LoadPresetFromFXP().
|
inline |
Definition at line 113 of file IPlugPluginBase.h.
Referenced by AddParamGroup().
|
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
Definition at line 189 of file IPlugPluginBase.h.
Referenced by IVBakedPresetManagerControl::OnAttached(), SaveBankAsFXB(), and SetCurrentPresetIdx().
|
inlinevirtual |
[VST2 only] Called when the preset name is changed by the host
Definition at line 260 of file IPlugPluginBase.h.
Referenced by RestorePreset().
void IPluginBase::PrintParamValues | ( | ) |
Default parameter values for a parameter group
Definition at line 259 of file IPlugPluginBase.cpp.
References ForParamInRange(), and IParam::PrintDetails().
void IPluginBase::PruneUninitializedPresets | ( | ) |
[AUV2 only] Removes any presets that weren't initialized
Definition at line 401 of file IPlugPluginBase.cpp.
void IPluginBase::RandomiseParamValues | ( | ) |
Randomise all parameters.
Definition at line 244 of file IPlugPluginBase.cpp.
References RandomiseParamValues().
Referenced by RandomiseParamValues().
void IPluginBase::RandomiseParamValues | ( | const char * | paramGroup | ) |
Randomise parameter values for a parameter group.
paramGroup | The name of the group to modify |
Definition at line 254 of file IPlugPluginBase.cpp.
References ForParamInGroup(), and IParam::SetNormalized().
void IPluginBase::RandomiseParamValues | ( | int | startIdx, |
int | endIdx | ||
) |
Randomise parameter values within a range.
NOTE for more flexibility in terms of RNG etc, use ForParamInRange()
startIdx | The index of the first parameter to modify |
endIdx | The index of the last parameter to modify |
Definition at line 249 of file IPlugPluginBase.cpp.
References ForParamInRange(), and IParam::SetNormalized().
bool IPluginBase::RestorePreset | ( | const char * | name | ) |
Restore a preset by name.
CString | name of the preset to restore |
true
on success Definition at line 448 of file IPlugPluginBase.cpp.
References RestorePreset().
bool IPluginBase::RestorePreset | ( | int | idx | ) |
Restore a preset by index.
This should also update mCurrentPresetIdx
idx | The index of the preset to restore |
true
on success Definition at line 419 of file IPlugPluginBase.cpp.
References OnPresetsModified(), SerializeState(), and UnserializeState().
Referenced by LoadBankFromFXB(), LoadPresetFromFXP(), RestorePreset(), and UnserializePresets().
bool IPluginBase::SaveBankAsFXB | ( | const char * | file | ) | const |
Save current bank as a VST2 format bank [VST2 only].
file | The full path of the file to write or overwrite |
Definition at line 725 of file IPlugPluginBase.cpp.
References DoesStateChunks(), IByteChunk::Get(), GetCurrentPresetIdx(), IByteChunk::GetData(), GetPluginVersion(), GetUniqueID(), IByteChunk::InitChunkWithIPlugVer(), NPresets(), IByteChunk::Put(), IByteChunk::PutBytes(), SerializePresets(), and IByteChunk::Size().
bool IPluginBase::SavePresetAsFXP | ( | const char * | file | ) | const |
Save current state as a VST2 format preset.
file | The full path of the file to write or overwrite |
Definition at line 652 of file IPlugPluginBase.cpp.
References DoesStateChunks(), GetCurrentPresetIdx(), IByteChunk::GetData(), GetPluginVersion(), GetPresetName(), GetUniqueID(), IByteChunk::InitChunkWithIPlugVer(), IByteChunk::Put(), IByteChunk::PutBytes(), SerializeState(), and IByteChunk::Size().
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.
chunk | The output chunk to serialize to. Will append data if the chunk has already been started. |
true
if the serialization was successful Definition at line 109 of file IPlugPluginBase.cpp.
References IParam::GetName(), IByteChunk::Put(), and IParam::Value().
Referenced by SerializeState().
bool IPluginBase::SerializePresets | ( | IByteChunk & | chunk | ) | const |
[VST2 only] Called when the VST2 host calls effGetChunk for a bank *
chunk | IByteChunk where the presets will be serialized |
Definition at line 492 of file IPlugPluginBase.cpp.
References IByteChunk::Put(), IByteChunk::PutChunk(), and IByteChunk::PutStr().
Referenced by SaveBankAsFXB().
|
inlinevirtual |
Override this method to serialize custom state data, if your plugin does state chunks.
chunk | The output bytechunk where data can be serialized |
true
if serialization was successful Definition at line 146 of file IPlugPluginBase.h.
References SerializeParams().
Referenced by MakeDefaultPreset(), ModifyCurrentPreset(), RestorePreset(), SavePresetAsFXP(), and UnserializePresets().
|
inlinevirtual |
VST3 ONLY! - THIS IS ONLY INCLUDED FOR COMPATIBILITY - NOONE ELSE SHOULD NEED IT!
chunk | The output bytechunk where data can be serialized. |
true
if serialization was successful Definition at line 158 of file IPlugPluginBase.h.
|
inline |
Set the index of the current, active preset.
idx | The index of the current preset |
Definition at line 171 of file IPlugPluginBase.h.
References NPresets().
int IPluginBase::UnserializeParams | ( | const IByteChunk & | chunk, |
int | startPos | ||
) |
Unserializes double precision floating point, non-normalised values from a byte chunk into mParams.
chunk | The incoming chunk where parameter values are stored to unserialize |
startPos | The start position in the chunk where parameter values are stored |
Definition at line 124 of file IPlugPluginBase.cpp.
References IByteChunk::Get(), IParam::GetName(), IParam::Set(), and IParam::Value().
Referenced by UnserializeState().
int IPluginBase::UnserializePresets | ( | const IByteChunk & | chunk, |
int | startPos | ||
) |
[VST2 only] Called when the VST2 host calls effSetChunk for a bank *
chunk | IByteChunk where the preset bank will be unserialized |
startPos | The starting position in the chunk for the preset bank |
Definition at line 513 of file IPlugPluginBase.cpp.
References IByteChunk::Clear(), IByteChunk::Get(), IByteChunk::GetStr(), RestorePreset(), SerializeState(), and UnserializeState().
Referenced by LoadBankFromFXB().
|
inlinevirtual |
Override this method to unserialize custom state data, if your plugin does state chunks.
Implementations should call UnserializeParams() after custom data is unserialized
chunk | The incoming chunk containing the state data. |
startPos | The position in the chunk where the data starts |
Definition at line 153 of file IPlugPluginBase.h.
References UnserializeParams().
Referenced by LoadPresetFromFXP(), RestorePreset(), and UnserializePresets().
|
inlinevirtual |
VST3 ONLY! - THIS IS ONLY INCLUDED FOR COMPATIBILITY - NOONE ELSE SHOULD NEED IT!
chunk | chunk The incoming chunk containing the state data. |
Definition at line 163 of file IPlugPluginBase.h.
|
friend |
Definition at line 388 of file IPlugPluginBase.h.
|
friend |
Definition at line 397 of file IPlugPluginBase.h.
|
friend |
Definition at line 387 of file IPlugPluginBase.h.
|
friend |
Definition at line 393 of file IPlugPluginBase.h.
|
friend |
Definition at line 394 of file IPlugPluginBase.h.
|
friend |
Definition at line 389 of file IPlugPluginBase.h.
|
friend |
Definition at line 390 of file IPlugPluginBase.h.
|
friend |
Definition at line 391 of file IPlugPluginBase.h.
|
friend |
Definition at line 392 of file IPlugPluginBase.h.
|
friend |
Definition at line 396 of file IPlugPluginBase.h.
|
friend |
Definition at line 395 of file IPlugPluginBase.h.