diff --git a/architecture/faust/dsp/poly-dsp.h b/architecture/faust/dsp/poly-dsp.h index b8028867b8..d720fbc0c9 100644 --- a/architecture/faust/dsp/poly-dsp.h +++ b/architecture/faust/dsp/poly-dsp.h @@ -398,7 +398,11 @@ struct dsp_voice_group { ui_interface->closeBox(); // If not grouped, also add individual voices UI +#ifdef DAISY + if (!fGroupControl || ui_interface->isSoundUI()) { +#else if (!fGroupControl || dynamic_cast(ui_interface)) { +#endif for (size_t i = 0; i < fVoiceTable.size(); i++) { char buffer[32]; snprintf(buffer, 32, ((fVoiceTable.size() < 8) ? "Voice%ld" : "V%ld"), long(i+1)); @@ -757,10 +761,17 @@ class mydsp_poly : public dsp_voice_group, public dsp_poly { void buildUserInterface(UI* ui_interface) { // MidiUI ui_interface contains the midi_handler connected to the MIDI driver + #ifdef DAISY + if (ui_interface->isMidiInterface()) { + fMidiHandler = reinterpret_cast(ui_interface); + fMidiHandler->addMidiIn(this); + } + #else if (dynamic_cast(ui_interface)) { fMidiHandler = dynamic_cast(ui_interface); fMidiHandler->addMidiIn(this); } + #endif dsp_voice_group::buildUserInterface(ui_interface); } diff --git a/architecture/faust/gui/DecoratorUI.h b/architecture/faust/gui/DecoratorUI.h index f17b08e3e9..5e7be7edf8 100644 --- a/architecture/faust/gui/DecoratorUI.h +++ b/architecture/faust/gui/DecoratorUI.h @@ -38,6 +38,10 @@ class FAUST_API GenericUI : public UI GenericUI() {} virtual ~GenericUI() {} + +#ifdef DAISY + virtual bool isSoundUI() const override { return true; +#endif // -- widget's layouts virtual void openTabBox(const char* label) {} diff --git a/architecture/faust/gui/MidiUI.h b/architecture/faust/gui/MidiUI.h index c177b45202..89e0cdf3ac 100644 --- a/architecture/faust/gui/MidiUI.h +++ b/architecture/faust/gui/MidiUI.h @@ -812,6 +812,10 @@ class MidiUI : public GUI, public midi, public midi_interface, public MetaDataUI // TODO: use shared_ptr based implementation if (fDelete) delete fMidiHandler; } + +#ifdef DAISY + virtual bool isMidiInterface() const override { return true; } +#endif bool run() { return fMidiHandler->startMidi(); } void stop() { fMidiHandler->stopMidi(); } diff --git a/architecture/faust/gui/UI.h b/architecture/faust/gui/UI.h index 8e2abaeab6..8514035ed2 100644 --- a/architecture/faust/gui/UI.h +++ b/architecture/faust/gui/UI.h @@ -81,6 +81,10 @@ struct FAUST_API UIReal { struct FAUST_API UI : public UIReal { UI() {} virtual ~UI() {} +#ifdef DAISY + virtual bool isSoundUI() const { return false; } + virtual bool isMidiInterface() const { return false; } +#endif }; #endif