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 snprintf(pPreset->mName, MAX_PRESET_NAME_LEN,
"%s", 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 = fopen(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 = fopen(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 = fopen(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 = fopen(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 = fopen(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 = fopen(file,
"rb");
841 fseek(fp , 0 , SEEK_END);
842 fileSize = ftell(fp);
851 pgm.
Resize((
int) fileSize);
852 const bool readOK = fread(pgm.
GetData(), fileSize, 1, fp) == 1;
862 int32_t byteSize = 0;
866 int32_t pluginVersion;
870 pos = pgm.
Get(&chunkMagic, pos);
871 chunkMagic = WDL_bswap_if_le(chunkMagic);
872 pos = pgm.
Get(&byteSize, pos);
873 byteSize = WDL_bswap_if_le(byteSize);
874 pos = pgm.
Get(&fxpMagic, pos);
875 fxpMagic = WDL_bswap_if_le(fxpMagic);
876 pos = pgm.
Get(&fxpVersion, pos);
877 fxpVersion = WDL_bswap_if_le(fxpVersion);
878 pos = pgm.
Get(&pluginID, pos);
879 pluginID = WDL_bswap_if_le(pluginID);
880 pos = pgm.
Get(&pluginVersion, pos);
881 pluginVersion = WDL_bswap_if_le(pluginVersion);
882 pos = pgm.
Get(&numParams, pos);
883 numParams = WDL_bswap_if_le(numParams);
884 pos = pgm.
GetBytes(prgName, 28, pos);
886 if (chunkMagic !=
'CcnK')
return false;
887 if (fxpVersion != kFXPVersionNum)
return false;
895 pos = pgm.
Get(&chunkSize, pos);
896 chunkSize = WDL_bswap_if_le(chunkSize);
906 else if (fxpMagic ==
'FxCk')
909 for (
int i = 0; i< NParams(); i++)
912 pos = pgm.
Get(&v32.int32, pos);
913 v32.int32 = WDL_bswap_if_le(v32.int32);
914 GetParam(i)->SetNormalized((
double) v32.f);
932 if (CStringHasContents(file))
934 FILE* fp = fopen(file,
"rb");
941 fseek(fp , 0 , SEEK_END);
942 fileSize = ftell(fp);
951 bnk.
Resize((
int) fileSize);
952 const bool readOK = fread(bnk.
GetData(), fileSize, 1, fp) == 1;
962 int32_t byteSize = 0;
966 int32_t pluginVersion;
970 memset(future, 0, 124);
972 pos = bnk.
Get(&chunkMagic, pos);
973 chunkMagic = WDL_bswap_if_le(chunkMagic);
974 pos = bnk.
Get(&byteSize, pos);
975 byteSize = WDL_bswap_if_le(byteSize);
976 pos = bnk.
Get(&fxbMagic, pos);
977 fxbMagic = WDL_bswap_if_le(fxbMagic);
978 pos = bnk.
Get(&fxbVersion, pos);
979 fxbVersion = WDL_bswap_if_le(fxbVersion);
980 pos = bnk.
Get(&pluginID, pos);
981 pluginID = WDL_bswap_if_le(pluginID);
982 pos = bnk.
Get(&pluginVersion, pos);
983 pluginVersion = WDL_bswap_if_le(pluginVersion);
984 pos = bnk.
Get(&numPgms, pos);
985 numPgms = WDL_bswap_if_le(numPgms);
986 pos = bnk.
Get(¤tPgm, pos);
987 currentPgm = WDL_bswap_if_le(currentPgm);
988 pos = bnk.
GetBytes(future, 124, pos);
990 if (chunkMagic !=
'CcnK')
return false;
999 pos = bnk.
Get(&chunkSize, pos);
1000 chunkSize = WDL_bswap_if_le(chunkSize);
1008 else if (fxbMagic ==
'FxBk')
1015 int32_t pluginVersion;
1019 for(
int i = 0; i<numPgms; i++)
1021 pos = bnk.
Get(&chunkMagic, pos);
1022 chunkMagic = WDL_bswap_if_le(chunkMagic);
1024 pos = bnk.
Get(&byteSize, pos);
1025 byteSize = WDL_bswap_if_le(byteSize);
1027 pos = bnk.
Get(&fxpMagic, pos);
1028 fxpMagic = WDL_bswap_if_le(fxpMagic);
1030 pos = bnk.
Get(&fxpVersion, pos);
1031 fxpVersion = WDL_bswap_if_le(fxpVersion);
1033 pos = bnk.
Get(&pluginID, pos);
1034 pluginID = WDL_bswap_if_le(pluginID);
1036 pos = bnk.
Get(&pluginVersion, pos);
1037 pluginVersion = WDL_bswap_if_le(pluginVersion);
1039 pos = bnk.
Get(&numParams, pos);
1040 numParams = WDL_bswap_if_le(numParams);
1042 if (chunkMagic !=
'CcnK')
return false;
1043 if (fxpMagic !=
'FxCk')
return false;
1044 if (fxpVersion != kFXPVersionNum)
return false;
1045 if (numParams != NParams())
return false;
1047 pos = bnk.
GetBytes(prgName, 28, pos);
1052 for (
int j = 0; j< NParams(); j++)
1054 WDL_EndianFloat v32;
1055 pos = bnk.
Get(&v32.int32, pos);
1056 v32.int32 = WDL_bswap_if_le(v32.int32);
1057 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.