Rename placeholder param-info classes
This commit is contained in:
parent
64c739b4fc
commit
bfb88d6fe1
@ -519,13 +519,13 @@ struct Plugin : public clap_plugin {
|
||||
return v;
|
||||
}
|
||||
template<class RP>
|
||||
PInfoPlaceholder range(const char *key, RP ¶m) {
|
||||
RangeParamIgnore range(const char *key, RP ¶m) {
|
||||
double v = param;
|
||||
(*this)(key, v);
|
||||
return {};
|
||||
}
|
||||
template<class SP>
|
||||
PInfoPlaceholder stepped(const char *key, SP ¶m) {
|
||||
SteppedParamIgnore stepped(const char *key, SP ¶m) {
|
||||
int v = param;
|
||||
(*this)(key, v);
|
||||
return {};
|
||||
@ -540,14 +540,14 @@ struct Plugin : public clap_plugin {
|
||||
return v;
|
||||
}
|
||||
template<class RP>
|
||||
PInfoPlaceholder range(const char *key, RP ¶m) {
|
||||
RangeParamIgnore range(const char *key, RP ¶m) {
|
||||
double v = param;
|
||||
(*this)(key, v);
|
||||
param = v;
|
||||
return {};
|
||||
}
|
||||
template<class SP>
|
||||
PInfoPlaceholder stepped(const char *key, SP ¶m) {
|
||||
SteppedParamIgnore stepped(const char *key, SP ¶m) {
|
||||
int v = param;
|
||||
(*this)(key, v);
|
||||
param = v;
|
||||
|
||||
@ -95,30 +95,44 @@ namespace stfx {
|
||||
}
|
||||
|
||||
// When we want to ignore parameter info (covers both range and stepped)
|
||||
struct PInfoPlaceholder {
|
||||
PInfoPlaceholder & info(const char*, const char*) {
|
||||
struct RangeParamIgnore {
|
||||
RangeParamIgnore & info(const char*, const char*) {
|
||||
return *this;
|
||||
}
|
||||
PInfoPlaceholder & info(std::string, std::string) {
|
||||
RangeParamIgnore & range(double low, double high) {
|
||||
return *this;
|
||||
}
|
||||
template<typename V1, typename V2>
|
||||
PInfoPlaceholder & range(V1, V2) {
|
||||
return *this;
|
||||
}
|
||||
template<typename V1, typename V2, typename V3>
|
||||
PInfoPlaceholder & range(V1, V2, V3) {
|
||||
RangeParamIgnore & range(double low, double mid, double high) {
|
||||
return *this;
|
||||
}
|
||||
/* Always takes a suffix. Units registered first are preferred when formatting values
|
||||
Optional arguments (any can be omitted if the order is correct):
|
||||
precision:
|
||||
int: decimalDigits
|
||||
display mapping (e.g. for value in Hz, display in kHz):
|
||||
double displayToValue(double)
|
||||
double valueToDisplay(double)
|
||||
valid range:
|
||||
double low
|
||||
double high
|
||||
*/
|
||||
template<class ...Args>
|
||||
PInfoPlaceholder & unit(Args...) {
|
||||
RangeParamIgnore & unit(const char *suffix, Args...) {
|
||||
return *this;
|
||||
}
|
||||
PInfoPlaceholder & exact(double, const char *) {
|
||||
RangeParamIgnore & exact(double, const char *) {
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
struct SteppedParamIgnore {
|
||||
SteppedParamIgnore & info(const char*, const char*) {
|
||||
return *this;
|
||||
}
|
||||
SteppedParamIgnore & range(int low, int high) {
|
||||
return *this;
|
||||
}
|
||||
template<typename ...Args>
|
||||
PInfoPlaceholder & label(Args ...) {
|
||||
SteppedParamIgnore & label(Args ...) {
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
@ -353,12 +367,12 @@ namespace stfx {
|
||||
std::vector<LibraryParam<int> *> stepParams;
|
||||
|
||||
// Add registered parameters to the list
|
||||
PInfoPlaceholder range(const char *, LibraryParam<double> ¶m, const char *codeExpr=nullptr) {
|
||||
RangeParamIgnore range(const char *, LibraryParam<double> ¶m, const char *codeExpr=nullptr) {
|
||||
(void)codeExpr;
|
||||
rangeParams.push_back(¶m);
|
||||
return {};
|
||||
}
|
||||
PInfoPlaceholder stepped(const char *, LibraryParam<int> ¶m, const char *codeExpr=nullptr) {
|
||||
SteppedParamIgnore stepped(const char *, LibraryParam<int> ¶m, const char *codeExpr=nullptr) {
|
||||
(void)codeExpr;
|
||||
stepParams.push_back(¶m);
|
||||
return {};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user