31 void openTabBox(
const char* label)
override { }
32 void openHorizontalBox(
const char* label)
override { }
33 void openVerticalBox(
const char* label)
override { }
34 void closeBox()
override { }
35 void declare(FAUSTFLOAT* zone,
const char* key,
const char* val)
override
37 MetaDataUI::declare(zone, key, val);
40 addSoundfile(
const char* label,
const char* filename, Soundfile** sf_zone)
override
44 void addButton(
const char* label, FAUSTFLOAT* zone)
override
48 using namespace std::literals;
49 if(label ==
"Panic"sv || label ==
"gate"sv)
53 auto inl =
new Process::Button{label, getStrongId(fx.inlets()), &fx};
54 fx.inlets().push_back(inl);
57 void addCheckButton(
const char* label, FAUSTFLOAT* zone)
override
59 auto inl =
new Process::Toggle{bool(*zone), label, getStrongId(fx.inlets()), &fx};
60 fx.inlets().push_back(inl);
63 void addVerticalSlider(
64 const char* label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min,
65 FAUSTFLOAT max, FAUSTFLOAT step)
override
67 using namespace std::literals;
70 if(label ==
"gain"sv || label ==
"freq"sv || label ==
"sustain"sv)
79 auto inl =
new Process::FloatKnob{
80 (float)min, (
float)max, (float)init, label, getStrongId(fx.inlets()), &fx};
81 fx.inlets().push_back(inl);
85 auto inl =
new Process::FloatSlider{
86 (float)min, (
float)max, (float)init, label, getStrongId(fx.inlets()), &fx};
87 fx.inlets().push_back(inl);
91 void addHorizontalSlider(
92 const char* label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min,
93 FAUSTFLOAT max, FAUSTFLOAT step)
override
95 addVerticalSlider(label, zone, init, min, max, step);
99 const char* label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min,
100 FAUSTFLOAT max, FAUSTFLOAT step)
override
103 addVerticalSlider(label, zone, init, min, max, step);
106 void addHorizontalBargraph(
107 const char* label, FAUSTFLOAT* zone, FAUSTFLOAT min, FAUSTFLOAT max)
override
109 auto inl =
new Process::Bargraph{
110 (float)min, (
float)max, (float)min, label, getStrongId(fx.outlets()), &fx};
111 fx.outlets().push_back(inl);
114 void addVerticalBargraph(
115 const char* label, FAUSTFLOAT* zone, FAUSTFLOAT min, FAUSTFLOAT max)
override
117 addHorizontalBargraph(label, zone, min, max);
135 , toRemoveO{toRemoveO}
139 void openTabBox(
const char* label)
override { }
140 void openHorizontalBox(
const char* label)
override { }
141 void openVerticalBox(
const char* label)
override { }
142 void closeBox()
override { }
143 void declare(FAUSTFLOAT* zone,
const char* key,
const char* val)
override
145 MetaDataUI::declare(zone, key, val);
148 addSoundfile(
const char* label,
const char* filename, Soundfile** sf_zone)
override
154 toRemove.push_back(oldinl);
160 toRemoveO.push_back(oldoutl);
164 void addButton(
const char* label, FAUSTFLOAT* zone)
override
168 using namespace std::literals;
169 if(label ==
"Panic"sv || label ==
"gate"sv)
173 if(i < fx.inlets().size())
175 if(
auto inlet =
dynamic_cast<Process::Button*
>(fx.inlets()[i]))
177 inlet->setName(label);
181 auto id = fx.inlets()[i]->id();
182 replace(fx.inlets()[i],
new Process::Button{label, id, &fx});
187 auto inl =
new Process::Button{label, getStrongId(fx.inlets()), &fx};
188 fx.inlets().push_back(inl);
189 fx.controlAdded(inl->id());
194 void addCheckButton(
const char* label, FAUSTFLOAT* zone)
override
196 if(i < fx.inlets().size())
198 if(
auto inlet =
dynamic_cast<Process::Toggle*
>(fx.inlets()[i]))
200 inlet->setName(label);
201 if constexpr(SetInit)
202 inlet->setValue(
bool(*zone));
206 auto id = fx.inlets()[i]->id();
207 replace(fx.inlets()[i],
new Process::Toggle{bool(*zone), label, id, &fx});
212 auto inl =
new Process::Toggle{bool(*zone), label, getStrongId(fx.inlets()), &fx};
213 fx.inlets().push_back(inl);
214 fx.controlAdded(inl->id());
219 void addVerticalSlider(
220 const char* label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min,
221 FAUSTFLOAT max, FAUSTFLOAT step)
override
223 using namespace std::literals;
226 if(label ==
"gain"sv || label ==
"freq"sv || label ==
"sustain"sv)
230 if(label ==
"0x00"sv)
233 if(i < fx.inlets().size())
235 if(Process::FloatSlider
236 * slider{
dynamic_cast<Process::FloatSlider*
>(fx.inlets()[i])})
240 auto id = fx.inlets()[i]->id();
241 auto inl =
new Process::FloatKnob{
242 (float)min, (
float)max, (float)init, label, getStrongId(fx.inlets()), &fx};
243 replace(fx.inlets()[i], inl);
247 slider->setName(label);
248 slider->setDomain(ossia::make_domain(min, max));
249 if constexpr(SetInit)
250 slider->setValue(init);
254 Process::FloatKnob * knob{
dynamic_cast<Process::FloatKnob*
>(fx.inlets()[i])})
258 knob->setName(label);
259 knob->setDomain(ossia::make_domain(min, max));
260 if constexpr(SetInit)
261 knob->setValue(init);
265 auto id = fx.inlets()[i]->id();
266 auto inl =
new Process::FloatSlider{
267 (float)min, (
float)max, (float)init, label, getStrongId(fx.inlets()), &fx};
268 replace(fx.inlets()[i], inl);
273 auto id = fx.inlets()[i]->id();
276 auto inl =
new Process::FloatKnob{
277 (float)min, (
float)max, (float)init, label, getStrongId(fx.inlets()), &fx};
278 replace(fx.inlets()[i], inl);
282 auto inl =
new Process::FloatSlider{
283 (float)min, (
float)max, (float)init, label, getStrongId(fx.inlets()), &fx};
284 replace(fx.inlets()[i], inl);
292 auto inl =
new Process::FloatKnob{
293 (float)min, (
float)max, (float)init, label, getStrongId(fx.inlets()), &fx};
294 fx.inlets().push_back(inl);
295 fx.controlAdded(inl->id());
299 auto inl =
new Process::FloatSlider{
300 (float)min, (
float)max, (float)init, label, getStrongId(fx.inlets()), &fx};
301 fx.inlets().push_back(inl);
302 fx.controlAdded(inl->id());
309 void addHorizontalSlider(
310 const char* label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min,
311 FAUSTFLOAT max, FAUSTFLOAT step)
override
313 addVerticalSlider(label, zone, init, min, max, step);
317 const char* label, FAUSTFLOAT* zone, FAUSTFLOAT init, FAUSTFLOAT min,
318 FAUSTFLOAT max, FAUSTFLOAT step)
override
320 addVerticalSlider(label, zone, init, min, max, step);
323 void addHorizontalBargraph(
324 const char* label, FAUSTFLOAT* zone, FAUSTFLOAT min, FAUSTFLOAT max)
override
326 if(o < fx.outlets().size())
328 if(
auto outlet =
dynamic_cast<Process::Bargraph*
>(fx.outlets()[o]))
330 outlet->setName(label);
331 outlet->setDomain(ossia::make_domain(min, max));
335 auto id = fx.outlets()[o]->id();
337 =
new Process::Bargraph{(float)min, (
float)max, (float)min, label,
id, &fx};
338 replace(fx.outlets()[o], inl);
343 auto inl =
new Process::Bargraph{
344 (float)min, (
float)max, (float)min, label, getStrongId(fx.outlets()), &fx};
345 fx.outlets().push_back(inl);
346 fx.controlAdded(inl->id());
351 void addVerticalBargraph(
352 const char* label, FAUSTFLOAT* zone, FAUSTFLOAT min, FAUSTFLOAT max)
override
354 addHorizontalBargraph(label, zone, min, max);