54 const char* label=
nullptr;
55 FAUSTFLOAT* zone=
nullptr;
63 virtual FAUSTFLOAT getValue(
const char*
label) {
64 Entry *e = findEntry(
label);
66 LOGE(
"Label '%s' not found",
label);
68 return e!=
nullptr ? *(e->zone) :(FAUSTFLOAT) 0.0;
70 virtual bool setValue(
const char*
label, FAUSTFLOAT value){
72 Entry* e = findEntry(
label);
75 if (value>=e->min && value<=e->max){
79 LOGE(
"Value '%s' outsde limits %f (%f-%f)", e->label, value, e->min, e->max);
86 LOGE(
"Label '%s' not found",
label);
94 virtual void openTabBox(
const char*
label) {}
95 virtual void openHorizontalBox(
const char*
label) {}
96 virtual void openVerticalBox(
const char*
label) {}
97 virtual void closeBox() {}
100 virtual void addButton(
const char*
label, FAUSTFLOAT* zone) {
101 addEntry(
label, zone);
103 virtual void addCheckButton(
const char*
label, FAUSTFLOAT* zone) {
104 addEntry(
label, zone);
106 virtual void addVerticalSlider(
const char*
label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT step) {
107 addEntry(
label, zone,
true, min, max);
110 virtual void addHorizontalSlider(
const char*
label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT step) {
111 addEntry(
label, zone,
true, min, max);
114 virtual void addNumEntry(
const char*
label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min, FAUSTFLOAT max, FAUSTFLOAT step) {
115 addEntry(
label, zone,
true, min, max);
120 virtual void addHorizontalBargraph(
const char*
label, FAUSTFLOAT* zone, FAUSTFLOAT min, FAUSTFLOAT max) {}
121 virtual void addVerticalBargraph(
const char*
label, FAUSTFLOAT* zone, FAUSTFLOAT min, FAUSTFLOAT max) {}
124 virtual void addSoundfile(
const char*
label,
const char* filename, Soundfile** sf_zone) {}
127 virtual void declare(FAUSTFLOAT* zone,
const char* key,
const char* val) {}
131 return findEntry(
label)!=
nullptr;
136 return entries.size();
142 return entries[idx].label;
150 Entry *findEntry(
const char* name){
151 StrView nameStr(name);
152 for (
int j=0; j<entries.size();j++){
153 if (nameStr.equals(entries[j].label)){
160 void addEntry(
const char*
label,FAUSTFLOAT* zone,
bool withLimits=
false, FAUSTFLOAT min=0, FAUSTFLOAT max=0){
164 e.withLimits = withLimits;
168 LOGI(
"Label: %s value: %f range: %f - %f",
label, *zone, min, max);
170 LOGI(
"Label: %s value: %f",
label, *zone);
172 entries.push_back(e);
Minimum implementation of UI parameters. We only support the setting and getting of values.
Definition AudioFaustDSP.h:52
const char * label(int idx)
Returns the label at the indicated position. nullptr is returned if the index is too big.
Definition AudioFaustDSP.h:140