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 kAPICLAP:
return "CLAP";
77 case kAPIWAM:
return "WAM";
78 case kAPIWEB:
return "WEB";
87#elif defined _M_ARM64EC
89#elif defined _M_ARM64 || defined __aarch64__
93#elif defined ARCH_64BIT
104 str.SetFormatted(MAX_BUILD_INFO_STR_LEN,
"%s %s (%s), built on %s at %.5s ", version.Get(),
GetAPIStr(),
GetArchStr(), date, time);
113 int i, n = mParams.GetSize();
114 for (i = 0; i < n && savedOK; ++i)
116 IParam* pParam = mParams.Get(i);
117 Trace(TRACELOC,
"%d %s %f", i, pParam->
GetName(), pParam->
Value());
118 double v = pParam->
Value();
119 savedOK &= (chunk.
Put(&v) > 0);
127 int i, n = mParams.GetSize(), pos = startPos;
129 for (i = 0; i < n && pos >= 0; ++i)
131 IParam* pParam = mParams.Get(i);
133 pos = chunk.
Get(&v, pos);
137 Trace(TRACELOC,
"%d %s %f", i, pParam->
GetName(), pParam->
Value());
141 OnParamReset(kPresetRecall);
147void 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)
150 for (
auto p = startIdx; p <= endIdx; p++)
152 nameStr.SetFormatted(MAX_PARAM_NAME_LEN, nameFmtStr, countStart + (p-startIdx));
153 GetParam(p)->InitDouble(nameStr.Get(), defaultVal, minVal, maxVal, step, label, flags, group, shape, unit, displayFunc);
157void IPluginBase::CloneParamRange(
int cloneStartIdx,
int cloneEndIdx,
int startIdx,
const char* searchStr,
const char* replaceStr,
const char* newGroup)
159 for (
auto p = cloneStartIdx; p <= cloneEndIdx; p++)
161 IParam* pParam = GetParam(p);
162 int outIdx = startIdx + (p - cloneStartIdx);
163 GetParam(outIdx)->Init(*pParam, searchStr, replaceStr, newGroup);
164 GetParam(outIdx)->Set(pParam->
Value());
170 assert((startIdx + nParams) < NParams());
171 assert((destIdx + nParams) < NParams());
172 assert((startIdx + nParams) < destIdx);
174 for (
auto p = startIdx; p < startIdx + nParams; p++)
176 GetParam(destIdx++)->Set(GetParam(p)->Value());
182 WDL_PtrList<IParam> inParams, outParams;
184 for (
auto p = 0; p < NParams(); p++)
186 IParam* pParam = GetParam(p);
187 if(strcmp(pParam->
GetGroup(), inGroup) == 0)
189 inParams.Add(pParam);
191 else if(strcmp(pParam->
GetGroup(), outGroup) == 0)
193 outParams.Add(pParam);
197 assert(inParams.GetSize() == outParams.GetSize());
199 for (
auto p = 0; p < inParams.GetSize(); p++)
201 outParams.Get(p)->Set(inParams.Get(p)->Value());
207 for (
auto p = startIdx; p <= endIdx; p++)
209 func(p, * GetParam(p));
215 for (
auto p = 0; p < NParams(); p++)
217 IParam* pParam = GetParam(p);
218 if(strcmp(pParam->
GetGroup(), paramGroup) == 0)
267static IPreset* GetNextUninitializedPreset(WDL_PtrList<IPreset>* pPresets)
269 int n = pPresets->GetSize();
270 for (
int i = 0; i < n; ++i)
272 IPreset* pPreset = pPresets->Get(i);
273 if (!(pPreset->mInitialized))
283 for (
int i = 0; i < nPresets; ++i)
285 IPreset* pPreset = GetNextUninitializedPreset(&mPresets);
288 pPreset->mInitialized =
true;
289 strcpy(pPreset->mName, (name ? name :
"Empty"));
297 IPreset* pPreset = GetNextUninitializedPreset(&mPresets);
300 pPreset->mInitialized =
true;
301 strcpy(pPreset->mName, name);
303 int i, n = NParams();
308 for (i = 0; i < n; ++i)
310 GET_PARAM_FROM_VARARG(GetParam(i)->Type(), vp, v);
311 pPreset->mChunk.
Put(&v);
319 IPreset* pPreset = GetNextUninitializedPreset(&mPresets);
322 pPreset->mInitialized =
true;
323 strcpy(pPreset->mName, name);
325 int i = 0, n = NParams();
327 WDL_TypedBuf<double> vals;
329 double* pV = vals.Get();
330 for (i = 0; i < n; ++i, ++pV)
336 va_start(vp, nParamsNamed);
337 for (
int i = 0; i < nParamsNamed; ++i)
339 int paramIdx = (int) va_arg(vp,
int);
342 assert(paramIdx > kNoParameter && paramIdx < n);
343 GET_PARAM_FROM_VARARG(GetParam(paramIdx)->Type(), vp, *(vals.Get() + paramIdx));
348 for (
int i = 0; i < n; ++i, ++pV)
350 if (*pV == PARAM_UNINIT)
352 *pV = GetParam(i)->Value();
354 pPreset->mChunk.Put(pV);
361 IPreset* pPreset = GetNextUninitializedPreset(&mPresets);
364 pPreset->mInitialized =
true;
365 strcpy(pPreset->mName, name);
374 presetChunk.
Resize(sizeOfChunk);
375 wdl_base64decode(blob, presetChunk.
GetData(), sizeOfChunk);
380static void MakeDefaultUserPresetName(WDL_PtrList<IPreset>* pPresets,
char* str)
382 int nDefaultNames = 0;
383 int n = pPresets->GetSize();
384 for (
int i = 0; i < n; ++i)
386 IPreset* pPreset = pPresets->Get(i);
387 if (strstr(pPreset->mName, DEFAULT_USER_PRESET_NAME))
392 snprintf(str, MAX_PRESET_NAME_LEN,
"%s %d", DEFAULT_USER_PRESET_NAME, nDefaultNames + 1);
405 while (i < mPresets.GetSize())
407 IPreset* pPreset = mPresets.Get(i);
408 if (pPreset->mInitialized)
414 mPresets.Delete(i,
true);
422 bool restoredOK =
false;
423 if (idx >= 0 && idx < mPresets.GetSize())
425 IPreset* pPreset = mPresets.Get(idx);
427 if (!(pPreset->mInitialized))
429 pPreset->mInitialized =
true;
430 MakeDefaultUserPresetName(&mPresets, pPreset->mName);
440 mCurrentPresetIdx = idx;
450 if (CStringHasContents(name))
452 int n = mPresets.GetSize();
453 for (
int i = 0; i < n; ++i)
455 IPreset* pPreset = mPresets.Get(i);
456 if (!strcmp(pPreset->mName, name))
467 if (idx >= 0 && idx < mPresets.GetSize())
469 return mPresets.Get(idx)->mName;
476 if (mCurrentPresetIdx >= 0 && mCurrentPresetIdx < mPresets.GetSize())
478 IPreset* pPreset = mPresets.Get(mCurrentPresetIdx);
479 pPreset->mChunk.
Clear();
481 Trace(TRACELOC,
"%d %s", mCurrentPresetIdx, pPreset->mName);
485 if (CStringHasContents(name))
487 strcpy(pPreset->mName, name);
496 int n = mPresets.GetSize();
497 for (
int i = 0; i < n && savedOK; ++i)
499 IPreset* pPreset = mPresets.Get(i);
500 chunk.
PutStr(pPreset->mName);
502 Trace(TRACELOC,
"%d %s", i, pPreset->mName);
504 chunk.
Put(&pPreset->mInitialized);
505 if (pPreset->mInitialized)
507 savedOK &= (chunk.
PutChunk(&(pPreset->mChunk)) > 0);
517 int n = mPresets.GetSize(), pos = startPos;
518 for (
int i = 0; i < n && pos >= 0; ++i)
520 IPreset* pPreset = mPresets.Get(i);
521 pos = chunk.
GetStr(name, pos);
522 strcpy(pPreset->mName, name.Get());
524 Trace(TRACELOC,
"%d %s", i, pPreset->mName);
526 pos = chunk.
Get<
bool>(&(pPreset->mInitialized), pos);
527 if (pPreset->mInitialized)
532 pPreset->mChunk.
Clear();
543 bool sDumped =
false;
547 int i, n = NParams();
548 FILE* fp = fopenUTF8(filename,
"a");
555 for (i = 0; i < n; ++i)
557 const IParam* pParam = GetParam(i);
558 constexpr int maxLen = 32;
559 char paramVal[maxLen];
561 switch (pParam->
Type())
563 case IParam::kTypeBool:
564 snprintf(paramVal, maxLen,
"%s", (pParam->
Bool() ?
"true" :
"false"));
566 case IParam::kTypeInt:
567 snprintf(paramVal, maxLen,
"%d", pParam->
Int());
569 case IParam::kTypeEnum:
570 snprintf(paramVal, maxLen,
"%d", pParam->
Int());
572 case IParam::kTypeDouble:
574 snprintf(paramVal, maxLen,
"%.6f", pParam->
Value());
577 fprintf(fp,
", %s", paramVal);
586 bool sDumped =
false;
591 int i, n = NParams();
592 FILE* fp = fopenUTF8(filename,
"a");
598 fprintf(fp,
" MakePresetFromNamedParams(\"%s\", %d",
GetPresetName(idx), n);
599 for (i = 0; i < n; ++i)
601 const IParam* pParam = GetParam(i);
602 constexpr int maxLen = 32;
603 char paramVal[maxLen];
604 switch (pParam->
Type())
606 case IParam::kTypeBool:
607 snprintf(paramVal, maxLen,
"%s", (pParam->
Bool() ?
"true" :
"false"));
609 case IParam::kTypeInt:
610 snprintf(paramVal, maxLen,
"%d", pParam->
Int());
612 case IParam::kTypeEnum:
613 snprintf(paramVal, maxLen,
"%d", pParam->
Int());
615 case IParam::kTypeDouble:
617 snprintf(paramVal, maxLen,
"%.6f", pParam->
Value());
620 fprintf(fp,
",\n %s, %s", paramEnumNames[i], paramVal);
629 FILE* fp = fopenUTF8(filename,
"a");
635 fprintf(fp,
"MakePresetFromBlob(\"%s\", \"",
GetPresetName(idx));
637 char buf[MAX_BLOB_LENGTH];
639 IByteChunk* pPresetChunk = &mPresets.Get(mCurrentPresetIdx)->mChunk;
640 uint8_t* byteStart = pPresetChunk->
GetData();
642 wdl_base64encode(byteStart, buf, pPresetChunk->
Size());
644 fprintf(fp,
"%s\", %i);\n", buf, pPresetChunk->
Size());
654 if (CStringHasContents(file))
656 FILE* fp = fopenUTF8(file,
"wb");
660 int32_t chunkMagic = WDL_bswap32(
'CcnK');
661 int32_t byteSize = 0;
663 int32_t fxpVersion = WDL_bswap32(kFXPVersionNum);
666 int32_t numParams = WDL_bswap32(NParams());
668 memset(prgName, 0, 28);
671 pgm.
Put(&chunkMagic);
678 fxpMagic = WDL_bswap32(
'FPCh');
683 chunkSize = WDL_bswap32(state.
Size());
684 byteSize = WDL_bswap32(state.
Size() + 60);
688 pgm.
Put(&fxpVersion);
690 pgm.
Put(&pluginVersion);
698 fxpMagic = WDL_bswap32(
'FxCk');
702 pgm.
Put(&fxpVersion);
704 pgm.
Put(&pluginVersion);
708 for (
int i = 0; i< NParams(); i++)
711 v32.f = (float) GetParam(i)->GetNormalized();
712 unsigned int swapped = WDL_bswap32(v32.int32);
727 if (CStringHasContents(file))
729 FILE* fp = fopenUTF8(file,
"wb");
733 int32_t chunkMagic = WDL_bswap32(
'CcnK');
734 int32_t byteSize = 0;
736 int32_t fxbVersion = WDL_bswap32(kFXBVersionNum);
739 int32_t numPgms = WDL_bswap32(
NPresets());
742 memset(future, 0, 124);
744 bnk.
Put(&chunkMagic);
751 fxbMagic = WDL_bswap32(
'FBCh');
756 chunkSize = WDL_bswap32(state.
Size());
757 byteSize = WDL_bswap32(160 + state.
Size() );
761 bnk.
Put(&fxbVersion);
763 bnk.
Put(&pluginVersion);
765 bnk.
Put(¤tPgm);
773 fxbMagic = WDL_bswap32(
'FxBk');
777 bnk.
Put(&fxbVersion);
779 bnk.
Put(&pluginVersion);
781 bnk.
Put(¤tPgm);
784 int32_t fxpMagic = WDL_bswap32(
'FxCk');
785 int32_t fxpVersion = WDL_bswap32(kFXPVersionNum);
786 int32_t numParams = WDL_bswap32(NParams());
788 for (
int p = 0; p <
NPresets(); p++)
790 IPreset* pPreset = mPresets.Get(p);
793 memset(prgName, 0, 28);
794 strcpy(prgName, pPreset->mName);
796 bnk.
Put(&chunkMagic);
800 bnk.
Put(&fxpVersion);
802 bnk.
Put(&pluginVersion);
808 for (
int i = 0; i< NParams(); i++)
811 pos = pPreset->mChunk.
Get(&v, pos);
814 v32.f = (float) GetParam(i)->ToNormalized(v);
815 uint32_t swapped = WDL_bswap32(v32.int32);
832 if (CStringHasContents(file))
834 FILE* fp = fopenUTF8(file,
"rb");
841 fseek(fp , 0 , SEEK_END);
842 fileSize = ftell(fp);
845 pgm.
Resize((
int) fileSize);
846 fread(pgm.
GetData(), fileSize, 1, fp);
853 int32_t byteSize = 0;
857 int32_t pluginVersion;
861 pos = pgm.
Get(&chunkMagic, pos);
862 chunkMagic = WDL_bswap_if_le(chunkMagic);
863 pos = pgm.
Get(&byteSize, pos);
864 byteSize = WDL_bswap_if_le(byteSize);
865 pos = pgm.
Get(&fxpMagic, pos);
866 fxpMagic = WDL_bswap_if_le(fxpMagic);
867 pos = pgm.
Get(&fxpVersion, pos);
868 fxpVersion = WDL_bswap_if_le(fxpVersion);
869 pos = pgm.
Get(&pluginID, pos);
870 pluginID = WDL_bswap_if_le(pluginID);
871 pos = pgm.
Get(&pluginVersion, pos);
872 pluginVersion = WDL_bswap_if_le(pluginVersion);
873 pos = pgm.
Get(&numParams, pos);
874 numParams = WDL_bswap_if_le(numParams);
875 pos = pgm.
GetBytes(prgName, 28, pos);
877 if (chunkMagic !=
'CcnK')
return false;
878 if (fxpVersion != kFXPVersionNum)
return false;
886 pos = pgm.
Get(&chunkSize, pos);
887 chunkSize = WDL_bswap_if_le(chunkSize);
897 else if (fxpMagic ==
'FxCk')
900 for (
int i = 0; i< NParams(); i++)
903 pos = pgm.
Get(&v32.int32, pos);
904 v32.int32 = WDL_bswap_if_le(v32.int32);
905 GetParam(i)->SetNormalized((
double) v32.f);
923 if (CStringHasContents(file))
925 FILE* fp = fopenUTF8(file,
"rb");
932 fseek(fp , 0 , SEEK_END);
933 fileSize = ftell(fp);
936 bnk.
Resize((
int) fileSize);
937 fread(bnk.
GetData(), fileSize, 1, fp);
944 int32_t byteSize = 0;
948 int32_t pluginVersion;
952 memset(future, 0, 124);
954 pos = bnk.
Get(&chunkMagic, pos);
955 chunkMagic = WDL_bswap_if_le(chunkMagic);
956 pos = bnk.
Get(&byteSize, pos);
957 byteSize = WDL_bswap_if_le(byteSize);
958 pos = bnk.
Get(&fxbMagic, pos);
959 fxbMagic = WDL_bswap_if_le(fxbMagic);
960 pos = bnk.
Get(&fxbVersion, pos);
961 fxbVersion = WDL_bswap_if_le(fxbVersion);
962 pos = bnk.
Get(&pluginID, pos);
963 pluginID = WDL_bswap_if_le(pluginID);
964 pos = bnk.
Get(&pluginVersion, pos);
965 pluginVersion = WDL_bswap_if_le(pluginVersion);
966 pos = bnk.
Get(&numPgms, pos);
967 numPgms = WDL_bswap_if_le(numPgms);
968 pos = bnk.
Get(¤tPgm, pos);
969 currentPgm = WDL_bswap_if_le(currentPgm);
970 pos = bnk.
GetBytes(future, 124, pos);
972 if (chunkMagic !=
'CcnK')
return false;
981 pos = bnk.
Get(&chunkSize, pos);
982 chunkSize = WDL_bswap_if_le(chunkSize);
990 else if (fxbMagic ==
'FxBk')
997 int32_t pluginVersion;
1001 for(
int i = 0; i<numPgms; i++)
1003 pos = bnk.
Get(&chunkMagic, pos);
1004 chunkMagic = WDL_bswap_if_le(chunkMagic);
1006 pos = bnk.
Get(&byteSize, pos);
1007 byteSize = WDL_bswap_if_le(byteSize);
1009 pos = bnk.
Get(&fxpMagic, pos);
1010 fxpMagic = WDL_bswap_if_le(fxpMagic);
1012 pos = bnk.
Get(&fxpVersion, pos);
1013 fxpVersion = WDL_bswap_if_le(fxpVersion);
1015 pos = bnk.
Get(&pluginID, pos);
1016 pluginID = WDL_bswap_if_le(pluginID);
1018 pos = bnk.
Get(&pluginVersion, pos);
1019 pluginVersion = WDL_bswap_if_le(pluginVersion);
1021 pos = bnk.
Get(&numParams, pos);
1022 numParams = WDL_bswap_if_le(numParams);
1024 if (chunkMagic !=
'CcnK')
return false;
1025 if (fxpMagic !=
'FxCk')
return false;
1026 if (fxpVersion != kFXPVersionNum)
return false;
1027 if (numParams != NParams())
return false;
1029 pos = bnk.
GetBytes(prgName, 28, pos);
1034 for (
int j = 0; j< NParams(); j++)
1036 WDL_EndianFloat v32;
1037 pos = bnk.
Get(&v32.int32, pos);
1038 v32.int32 = WDL_bswap_if_le(v32.int32);
1039 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 containing 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.