18#include "wdl_base64.h"
22IPluginBase::IPluginBase(
int nParams,
int nPresets)
23: EDITOR_DELEGATE_CLASS(nParams)
25 for (
int i = 0; i < nPresets; ++i)
29IPluginBase::~IPluginBase()
45#if defined TRACER_BUILD
70 case kAPIVST2:
return "VST2";
71 case kAPIVST3:
return "VST3";
72 case kAPIAU:
return "AU";
73 case kAPIAUv3:
return "AUv3";
74 case kAPIAAX:
return "AAX";
75 case kAPIAPP:
return "APP";
76 case kAPIWAM:
return "WAM";
77 case kAPIWEB:
return "WEB";
86#elif defined __aarch64__
88#elif defined ARCH_64BIT
99 str.SetFormatted(MAX_BUILD_INFO_STR_LEN,
"%s %s (%s), built on %s at %.5s ", version.Get(),
GetAPIStr(),
GetArchStr(), date, time);
108 int i, n = mParams.GetSize();
109 for (i = 0; i < n && savedOK; ++i)
111 IParam* pParam = mParams.Get(i);
112 Trace(TRACELOC,
"%d %s %f", i, pParam->
GetName(), pParam->
Value());
113 double v = pParam->
Value();
114 savedOK &= (chunk.
Put(&v) > 0);
122 int i, n = mParams.GetSize(), pos = startPos;
124 for (i = 0; i < n && pos >= 0; ++i)
126 IParam* pParam = mParams.Get(i);
128 pos = chunk.
Get(&v, pos);
130 Trace(TRACELOC,
"%d %s %f", i, pParam->
GetName(), pParam->
Value());
133 OnParamReset(kPresetRecall);
139void IPluginBase::InitParamRange(
int startIdx,
int endIdx,
int countStart,
const char* nameFmtStr,
double defaultVal,
double minVal,
double maxVal,
double step,
const char *label,
int flags,
const char *group,
const IParam::Shape& shape,
IParam::EParamUnit unit,
IParam::DisplayFunc displayFunc)
142 for (
auto p = startIdx; p <= endIdx; p++)
144 nameStr.SetFormatted(MAX_PARAM_NAME_LEN, nameFmtStr, countStart + (p-startIdx));
145 GetParam(p)->InitDouble(nameStr.Get(), defaultVal, minVal, maxVal, step, label, flags, group, shape, unit, displayFunc);
149void IPluginBase::CloneParamRange(
int cloneStartIdx,
int cloneEndIdx,
int startIdx,
const char* searchStr,
const char* replaceStr,
const char* newGroup)
151 for (
auto p = cloneStartIdx; p <= cloneEndIdx; p++)
153 IParam* pParam = GetParam(p);
154 int outIdx = startIdx + (p - cloneStartIdx);
155 GetParam(outIdx)->Init(*pParam, searchStr, replaceStr, newGroup);
156 GetParam(outIdx)->Set(pParam->
Value());
162 assert((startIdx + nParams) < NParams());
163 assert((destIdx + nParams) < NParams());
164 assert((startIdx + nParams) < destIdx);
166 for (
auto p = startIdx; p < startIdx + nParams; p++)
168 GetParam(destIdx++)->Set(GetParam(p)->Value());
174 WDL_PtrList<IParam> inParams, outParams;
176 for (
auto p = 0; p < NParams(); p++)
178 IParam* pParam = GetParam(p);
179 if(strcmp(pParam->
GetGroup(), inGroup) == 0)
181 inParams.Add(pParam);
183 else if(strcmp(pParam->
GetGroup(), outGroup) == 0)
185 outParams.Add(pParam);
189 assert(inParams.GetSize() == outParams.GetSize());
191 for (
auto p = 0; p < inParams.GetSize(); p++)
193 outParams.Get(p)->Set(inParams.Get(p)->Value());
199 for (
auto p = startIdx; p <= endIdx; p++)
201 func(p, * GetParam(p));
207 for (
auto p = 0; p < NParams(); p++)
209 IParam* pParam = GetParam(p);
210 if(strcmp(pParam->
GetGroup(), paramGroup) == 0)
259static IPreset* GetNextUninitializedPreset(WDL_PtrList<IPreset>* pPresets)
261 int n = pPresets->GetSize();
262 for (
int i = 0; i < n; ++i)
264 IPreset* pPreset = pPresets->Get(i);
265 if (!(pPreset->mInitialized))
275 for (
int i = 0; i < nPresets; ++i)
277 IPreset* pPreset = GetNextUninitializedPreset(&mPresets);
280 pPreset->mInitialized =
true;
281 strcpy(pPreset->mName, (name ? name :
"Empty"));
289 IPreset* pPreset = GetNextUninitializedPreset(&mPresets);
292 pPreset->mInitialized =
true;
293 strcpy(pPreset->mName, name);
295 int i, n = NParams();
300 for (i = 0; i < n; ++i)
302 GET_PARAM_FROM_VARARG(GetParam(i)->Type(), vp, v);
303 pPreset->mChunk.
Put(&v);
311 IPreset* pPreset = GetNextUninitializedPreset(&mPresets);
314 pPreset->mInitialized =
true;
315 strcpy(pPreset->mName, name);
317 int i = 0, n = NParams();
319 WDL_TypedBuf<double> vals;
321 double* pV = vals.Get();
322 for (i = 0; i < n; ++i, ++pV)
328 va_start(vp, nParamsNamed);
329 for (
int i = 0; i < nParamsNamed; ++i)
331 int paramIdx = (int) va_arg(vp,
int);
334 assert(paramIdx > kNoParameter && paramIdx < n);
335 GET_PARAM_FROM_VARARG(GetParam(paramIdx)->Type(), vp, *(vals.Get() + paramIdx));
340 for (
int i = 0; i < n; ++i, ++pV)
342 if (*pV == PARAM_UNINIT)
344 *pV = GetParam(i)->Value();
346 pPreset->mChunk.Put(pV);
353 IPreset* pPreset = GetNextUninitializedPreset(&mPresets);
356 pPreset->mInitialized =
true;
357 strcpy(pPreset->mName, name);
366 presetChunk.
Resize(sizeOfChunk);
367 wdl_base64decode(blob, presetChunk.
GetData(), sizeOfChunk);
372static void MakeDefaultUserPresetName(WDL_PtrList<IPreset>* pPresets,
char* str)
374 int nDefaultNames = 0;
375 int n = pPresets->GetSize();
376 for (
int i = 0; i < n; ++i)
378 IPreset* pPreset = pPresets->Get(i);
379 if (strstr(pPreset->mName, DEFAULT_USER_PRESET_NAME))
384 snprintf(str, MAX_PRESET_NAME_LEN,
"%s %d", DEFAULT_USER_PRESET_NAME, nDefaultNames + 1);
397 while (i < mPresets.GetSize())
399 IPreset* pPreset = mPresets.Get(i);
400 if (pPreset->mInitialized)
406 mPresets.Delete(i,
true);
414 bool restoredOK =
false;
415 if (idx >= 0 && idx < mPresets.GetSize())
417 IPreset* pPreset = mPresets.Get(idx);
419 if (!(pPreset->mInitialized))
421 pPreset->mInitialized =
true;
422 MakeDefaultUserPresetName(&mPresets, pPreset->mName);
432 mCurrentPresetIdx = idx;
442 if (CStringHasContents(name))
444 int n = mPresets.GetSize();
445 for (
int i = 0; i < n; ++i)
447 IPreset* pPreset = mPresets.Get(i);
448 if (!strcmp(pPreset->mName, name))
459 if (idx >= 0 && idx < mPresets.GetSize())
461 return mPresets.Get(idx)->mName;
468 if (mCurrentPresetIdx >= 0 && mCurrentPresetIdx < mPresets.GetSize())
470 IPreset* pPreset = mPresets.Get(mCurrentPresetIdx);
471 pPreset->mChunk.
Clear();
473 Trace(TRACELOC,
"%d %s", mCurrentPresetIdx, pPreset->mName);
477 if (CStringHasContents(name))
479 strcpy(pPreset->mName, name);
488 int n = mPresets.GetSize();
489 for (
int i = 0; i < n && savedOK; ++i)
491 IPreset* pPreset = mPresets.Get(i);
492 chunk.
PutStr(pPreset->mName);
494 Trace(TRACELOC,
"%d %s", i, pPreset->mName);
496 chunk.
Put(&pPreset->mInitialized);
497 if (pPreset->mInitialized)
499 savedOK &= (chunk.
PutChunk(&(pPreset->mChunk)) > 0);
509 int n = mPresets.GetSize(), pos = startPos;
510 for (
int i = 0; i < n && pos >= 0; ++i)
512 IPreset* pPreset = mPresets.Get(i);
513 pos = chunk.
GetStr(name, pos);
514 strcpy(pPreset->mName, name.Get());
516 Trace(TRACELOC,
"%d %s", i, pPreset->mName);
518 pos = chunk.
Get<
bool>(&(pPreset->mInitialized), pos);
519 if (pPreset->mInitialized)
524 pPreset->mChunk.
Clear();
535 bool sDumped =
false;
539 int i, n = NParams();
540 FILE* fp = fopenUTF8(filename,
"a");
547 for (i = 0; i < n; ++i)
549 const IParam* pParam = GetParam(i);
550 constexpr int maxLen = 32;
551 char paramVal[maxLen];
553 switch (pParam->
Type())
555 case IParam::kTypeBool:
556 snprintf(paramVal, maxLen,
"%s", (pParam->
Bool() ?
"true" :
"false"));
558 case IParam::kTypeInt:
559 snprintf(paramVal, maxLen,
"%d", pParam->
Int());
561 case IParam::kTypeEnum:
562 snprintf(paramVal, maxLen,
"%d", pParam->
Int());
564 case IParam::kTypeDouble:
566 snprintf(paramVal, maxLen,
"%.6f", pParam->
Value());
569 fprintf(fp,
", %s", paramVal);
578 bool sDumped =
false;
583 int i, n = NParams();
584 FILE* fp = fopenUTF8(filename,
"a");
590 fprintf(fp,
" MakePresetFromNamedParams(\"%s\", %d",
GetPresetName(idx), n);
591 for (i = 0; i < n; ++i)
593 const IParam* pParam = GetParam(i);
594 constexpr int maxLen = 32;
595 char paramVal[maxLen];
596 switch (pParam->
Type())
598 case IParam::kTypeBool:
599 snprintf(paramVal, maxLen,
"%s", (pParam->
Bool() ?
"true" :
"false"));
601 case IParam::kTypeInt:
602 snprintf(paramVal, maxLen,
"%d", pParam->
Int());
604 case IParam::kTypeEnum:
605 snprintf(paramVal, maxLen,
"%d", pParam->
Int());
607 case IParam::kTypeDouble:
609 snprintf(paramVal, maxLen,
"%.6f", pParam->
Value());
612 fprintf(fp,
",\n %s, %s", paramEnumNames[i], paramVal);
621 FILE* fp = fopenUTF8(filename,
"a");
627 fprintf(fp,
"MakePresetFromBlob(\"%s\", \"",
GetPresetName(idx));
629 char buf[MAX_BLOB_LENGTH];
631 IByteChunk* pPresetChunk = &mPresets.Get(mCurrentPresetIdx)->mChunk;
632 uint8_t* byteStart = pPresetChunk->
GetData();
634 wdl_base64encode(byteStart, buf, pPresetChunk->
Size());
636 fprintf(fp,
"%s\", %i);\n", buf, pPresetChunk->
Size());
646 if (CStringHasContents(file))
648 FILE* fp = fopenUTF8(file,
"wb");
652 int32_t chunkMagic = WDL_bswap32(
'CcnK');
653 int32_t byteSize = 0;
655 int32_t fxpVersion = WDL_bswap32(kFXPVersionNum);
658 int32_t numParams = WDL_bswap32(NParams());
660 memset(prgName, 0, 28);
663 pgm.
Put(&chunkMagic);
670 fxpMagic = WDL_bswap32(
'FPCh');
675 chunkSize = WDL_bswap32(state.
Size());
676 byteSize = WDL_bswap32(state.
Size() + 60);
680 pgm.
Put(&fxpVersion);
682 pgm.
Put(&pluginVersion);
690 fxpMagic = WDL_bswap32(
'FxCk');
694 pgm.
Put(&fxpVersion);
696 pgm.
Put(&pluginVersion);
700 for (
int i = 0; i< NParams(); i++)
703 v32.f = (float) GetParam(i)->GetNormalized();
704 unsigned int swapped = WDL_bswap32(v32.int32);
719 if (CStringHasContents(file))
721 FILE* fp = fopenUTF8(file,
"wb");
725 int32_t chunkMagic = WDL_bswap32(
'CcnK');
726 int32_t byteSize = 0;
728 int32_t fxbVersion = WDL_bswap32(kFXBVersionNum);
731 int32_t numPgms = WDL_bswap32(
NPresets());
734 memset(future, 0, 124);
736 bnk.
Put(&chunkMagic);
743 fxbMagic = WDL_bswap32(
'FBCh');
748 chunkSize = WDL_bswap32(state.
Size());
749 byteSize = WDL_bswap32(160 + state.
Size() );
753 bnk.
Put(&fxbVersion);
755 bnk.
Put(&pluginVersion);
757 bnk.
Put(¤tPgm);
765 fxbMagic = WDL_bswap32(
'FxBk');
769 bnk.
Put(&fxbVersion);
771 bnk.
Put(&pluginVersion);
773 bnk.
Put(¤tPgm);
776 int32_t fxpMagic = WDL_bswap32(
'FxCk');
777 int32_t fxpVersion = WDL_bswap32(kFXPVersionNum);
778 int32_t numParams = WDL_bswap32(NParams());
780 for (
int p = 0; p <
NPresets(); p++)
782 IPreset* pPreset = mPresets.Get(p);
785 memset(prgName, 0, 28);
786 strcpy(prgName, pPreset->mName);
788 bnk.
Put(&chunkMagic);
792 bnk.
Put(&fxpVersion);
794 bnk.
Put(&pluginVersion);
800 for (
int i = 0; i< NParams(); i++)
803 pos = pPreset->mChunk.
Get(&v, pos);
806 v32.f = (float) GetParam(i)->ToNormalized(v);
807 uint32_t swapped = WDL_bswap32(v32.int32);
824 if (CStringHasContents(file))
826 FILE* fp = fopenUTF8(file,
"rb");
833 fseek(fp , 0 , SEEK_END);
834 fileSize = ftell(fp);
837 pgm.
Resize((
int) fileSize);
838 fread(pgm.
GetData(), fileSize, 1, fp);
845 int32_t byteSize = 0;
849 int32_t pluginVersion;
853 pos = pgm.
Get(&chunkMagic, pos);
854 chunkMagic = WDL_bswap_if_le(chunkMagic);
855 pos = pgm.
Get(&byteSize, pos);
856 byteSize = WDL_bswap_if_le(byteSize);
857 pos = pgm.
Get(&fxpMagic, pos);
858 fxpMagic = WDL_bswap_if_le(fxpMagic);
859 pos = pgm.
Get(&fxpVersion, pos);
860 fxpVersion = WDL_bswap_if_le(fxpVersion);
861 pos = pgm.
Get(&pluginID, pos);
862 pluginID = WDL_bswap_if_le(pluginID);
863 pos = pgm.
Get(&pluginVersion, pos);
864 pluginVersion = WDL_bswap_if_le(pluginVersion);
865 pos = pgm.
Get(&numParams, pos);
866 numParams = WDL_bswap_if_le(numParams);
867 pos = pgm.
GetBytes(prgName, 28, pos);
869 if (chunkMagic !=
'CcnK')
return false;
870 if (fxpVersion != kFXPVersionNum)
return false;
878 pos = pgm.
Get(&chunkSize, pos);
879 chunkSize = WDL_bswap_if_le(chunkSize);
889 else if (fxpMagic ==
'FxCk')
892 for (
int i = 0; i< NParams(); i++)
895 pos = pgm.
Get(&v32.int32, pos);
896 v32.int32 = WDL_bswap_if_le(v32.int32);
897 GetParam(i)->SetNormalized((
double) v32.f);
915 if (CStringHasContents(file))
917 FILE* fp = fopenUTF8(file,
"rb");
924 fseek(fp , 0 , SEEK_END);
925 fileSize = ftell(fp);
928 bnk.
Resize((
int) fileSize);
929 fread(bnk.
GetData(), fileSize, 1, fp);
936 int32_t byteSize = 0;
940 int32_t pluginVersion;
944 memset(future, 0, 124);
946 pos = bnk.
Get(&chunkMagic, pos);
947 chunkMagic = WDL_bswap_if_le(chunkMagic);
948 pos = bnk.
Get(&byteSize, pos);
949 byteSize = WDL_bswap_if_le(byteSize);
950 pos = bnk.
Get(&fxbMagic, pos);
951 fxbMagic = WDL_bswap_if_le(fxbMagic);
952 pos = bnk.
Get(&fxbVersion, pos);
953 fxbVersion = WDL_bswap_if_le(fxbVersion);
954 pos = bnk.
Get(&pluginID, pos);
955 pluginID = WDL_bswap_if_le(pluginID);
956 pos = bnk.
Get(&pluginVersion, pos);
957 pluginVersion = WDL_bswap_if_le(pluginVersion);
958 pos = bnk.
Get(&numPgms, pos);
959 numPgms = WDL_bswap_if_le(numPgms);
960 pos = bnk.
Get(¤tPgm, pos);
961 currentPgm = WDL_bswap_if_le(currentPgm);
962 pos = bnk.
GetBytes(future, 124, pos);
964 if (chunkMagic !=
'CcnK')
return false;
973 pos = bnk.
Get(&chunkSize, pos);
974 chunkSize = WDL_bswap_if_le(chunkSize);
982 else if (fxbMagic ==
'FxBk')
989 int32_t pluginVersion;
993 for(
int i = 0; i<numPgms; i++)
995 pos = bnk.
Get(&chunkMagic, pos);
996 chunkMagic = WDL_bswap_if_le(chunkMagic);
998 pos = bnk.
Get(&byteSize, pos);
999 byteSize = WDL_bswap_if_le(byteSize);
1001 pos = bnk.
Get(&fxpMagic, pos);
1002 fxpMagic = WDL_bswap_if_le(fxpMagic);
1004 pos = bnk.
Get(&fxpVersion, pos);
1005 fxpVersion = WDL_bswap_if_le(fxpVersion);
1007 pos = bnk.
Get(&pluginID, pos);
1008 pluginID = WDL_bswap_if_le(pluginID);
1010 pos = bnk.
Get(&pluginVersion, pos);
1011 pluginVersion = WDL_bswap_if_le(pluginVersion);
1013 pos = bnk.
Get(&numParams, pos);
1014 numParams = WDL_bswap_if_le(numParams);
1016 if (chunkMagic !=
'CcnK')
return false;
1017 if (fxpMagic !=
'FxCk')
return false;
1018 if (fxpVersion != kFXPVersionNum)
return false;
1019 if (numParams != NParams())
return false;
1021 pos = bnk.
GetBytes(prgName, 28, pos);
1026 for (
int j = 0; j< NParams(); j++)
1028 WDL_EndianFloat v32;
1029 pos = bnk.
Get(&v32.int32, pos);
1030 v32.int32 = WDL_bswap_if_le(v32.int32);
1031 GetParam(j)->SetNormalized((
double) v32.f);
Manages a block of memory, for plug-in settings store/recall.
static int GetIPlugVerFromChunk(const IByteChunk &chunk, int &position)
Helper method to retrieve the IPlug version number from the beginning of the byte chunk.
int Put(const T *pVal)
Copies arbitary typed data into the IByteChunk.
int GetBytes(void *pDst, int nBytesToCopy, int startPos) const
Copy raw bytes from the IByteChunk, returning the new position for subsequent calls.
int PutStr(const char *str)
Put a string into the IByteChunk.
int Get(T *pDst, int startPos) const
Get arbitary typed data from the IByteChunk.
int PutBytes(const void *pSrc, int nBytesToCopy)
Copies data into the chunk, placing it at the end, resizing if necessary.
void Clear()
Clears the chunk (resizes to 0)
uint8_t * GetData()
Gets a ptr to the chunk data.
static void InitChunkWithIPlugVer(IByteChunk &chunk)
This method is used in order to place the IPlug version number in the chunk when serialising data.
int Size() const
Returns the current size of the chunk.
int Resize(int newSize)
Resizes the chunk.
int GetStr(WDL_String &str, int startPos) const
Get a string from the IByteChunk.
int PutChunk(const IByteChunk *pRHS)
Put another IByteChunk into this one.
void SetToDefault()
Replaces the parameter's current value with the default one
EParamType Type() const
Get the parameter's type.
void Set(double value)
Sets the parameter value.
std::function< void(double, WDL_String &)> DisplayFunc
DisplayFunc allows custom parameter display functions, defined by a lambda matching this signature.
void SetNormalized(double normalizedValue)
Sets the parameter value from a normalized range (usually coming from the linked IControl)
EParamUnit
Used by AudioUnit plugins to determine the appearance of parameters, based on the kind of data they r...
const char * GetName() const
Returns the parameter's name.
bool Bool() const
Returns the parameter's value as a boolean.
void PrintDetails() const
Helper to print the parameter details to debug console in debug builds.
int Int() const
Returns the parameter's value as an integer.
const char * GetGroup() const
Returns the parameter's group.
double Value() const
Gets a readable value of the parameter.
void ForParamInRange(int startIdx, int endIdx, std::function< void(int paramIdx, IParam ¶m)> func)
Modify a range of parameters with a lamda function.
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.
virtual int UnserializeState(const IByteChunk &chunk, int startPos)
Override this method to unserialize custom state data, if your plugin does state chunks.
void DefaultParamValues()
Set all parameters to their default values.
void DumpMakePresetFromNamedParamsSrc(const char *file, const char *paramEnumNames[]) const
Writes a call to MakePresetFromNamedParams() for the current preset to a new text file.
bool SerializeParams(IByteChunk &chunk) const
Serializes the current double precision floating point, non-normalised values (IParam::mValue) of all...
int GetPluginVersion(bool decimal) const
Get the plug-in version number.
const char * GetArchStr() const
void RandomiseParamValues()
Randomise all parameters.
void MakePresetFromBlob(const char *name, const char *blob, int sizeOfChunk)
Creates a preset from a base64 encoded CString.
int UnserializePresets(const IByteChunk &chunk, int startPos)
[VST2 only] Called when the VST2 host calls effSetChunk for a bank *
bool LoadPresetFromFXP(const char *file)
Load VST2 format preset.
virtual bool SerializeState(IByteChunk &chunk) const
Override this method to serialize custom state data, if your plugin does state chunks.
bool DoesStateChunks() const
void ModifyCurrentPreset(const char *name=0)
This method should update the current preset with current values NOTE: This is only relevant for VST2...
int GetCurrentPresetIdx() const
Get the index of the current, active preset.
int UnserializeParams(const IByteChunk &chunk, int startPos)
Unserializes double precision floating point, non-normalised values from a byte chunk into mParams.
void EnsureDefaultPreset()
[VST2 only] Called to fill uninitialzed presets
int GetHostVersion(bool decimal) const
Get the host version number as an integer.
void CopyParamValues(int startIdx, int destIdx, int nParams)
Copy a range of parameter values.
virtual void InformHostOfPresetChange()
Implemented by the API class, called by the UI (etc) when the plug-in initiates a program/preset chan...
void GetPluginVersionStr(WDL_String &str) const
Gets the plug-in version as a string.
void MakePresetFromNamedParams(const char *name, int nParamsNamed,...)
Create a baked-in factory preset, specifiying parameter values with a list of parameter index and val...
void DumpPresetBlob(const char *file) const
Writes a call to MakePresetFromBlob() for the current preset to a new text file.
bool RestorePreset(int idx)
Restore a preset by index.
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.
void GetHostVersionStr(WDL_String &str) const
Get the host version number as a string.
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.
const char * GetAPIStr() const
bool SerializePresets(IByteChunk &chunk) const
[VST2 only] Called when the VST2 host calls effGetChunk for a bank *
void ForParamInGroup(const char *paramGroup, std::function< void(int paramIdx, IParam ¶m)> func)
Modify a parameter group simulataneously.
const char * GetPresetName(int idx) const
Get the name a preset.
bool LoadBankFromFXB(const char *file)
Load VST2 format bank [VST2 only].
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.
void DumpMakePresetSrc(const char *file) const
Writes a call to MakePreset() for the current preset to a new text file.
bool SavePresetAsFXP(const char *file) const
Save current state as a VST2 format preset.
void PruneUninitializedPresets()
[AUV2 only] Removes any presets that weren't initialized
void PrintParamValues()
Default parameter values for a parameter group
virtual void OnPresetsModified()
[VST2 only] Called when the preset name is changed by the host
void MakePresetFromChunk(const char *name, IByteChunk &chunk)
Creates a preset from an IByteChunk containging serialized data.
int NPresets() const
Gets the number of factory presets.
bool SaveBankAsFXB(const char *file) const
Save current bank as a VST2 format bank [VST2 only].
void MakePreset(const char *name,...)
Create a baked-in factory preset, specifiying parameter values sequentially usage: MakePreset(name,...
static int GetDecimalVersion(int versionInteger)
Helper function to get the version number as a decimal integer.
static void GetVersionStr(int versionInteger, WDL_String &str)
Helper function to get the semantic version number as a string from an integer.
Base struct for parameter shaping.
A struct used for specifying baked-in factory presets.