diff --git a/source/libs/distrho/DistrhoUIMain.cpp b/source/libs/distrho/DistrhoUIMain.cpp index 7193abbed..945a9b21e 100644 --- a/source/libs/distrho/DistrhoUIMain.cpp +++ b/source/libs/distrho/DistrhoUIMain.cpp @@ -26,8 +26,10 @@ // nothing #endif -#ifdef DISTRHO_UI_QT -# include "src/DistrhoUIQt.cpp" -#else +#if defined(DISTRHO_UI_EXTERNAL) +# include "src/DistrhoUIExternal.cpp" +#elif defined(DISTRHO_UI_OPENGL) # include "src/DistrhoUIOpenGL.cpp" +#else +# include "src/DistrhoUIQt.cpp" #endif diff --git a/source/libs/distrho/DistrhoUIOpenGL.hpp b/source/libs/distrho/DistrhoUIOpenGL.hpp index e0f95df65..de6cf6175 100644 --- a/source/libs/distrho/DistrhoUIOpenGL.hpp +++ b/source/libs/distrho/DistrhoUIOpenGL.hpp @@ -33,33 +33,33 @@ class OpenGLUI : public UI, { public: OpenGLUI(); - virtual ~OpenGLUI(); + virtual ~OpenGLUI() override; protected: // --------------------------------------------- // Information - virtual unsigned int d_width() const = 0; - virtual unsigned int d_height() const = 0; + virtual unsigned int d_width() const override = 0; + virtual unsigned int d_height() const override = 0; // --------------------------------------------- // DSP Callbacks - virtual void d_parameterChanged(uint32_t index, float value) = 0; + virtual void d_parameterChanged(uint32_t index, float value) override = 0; #if DISTRHO_PLUGIN_WANT_PROGRAMS - virtual void d_programChanged(uint32_t index) = 0; + virtual void d_programChanged(uint32_t index) override = 0; #endif #if DISTRHO_PLUGIN_WANT_STATE - virtual void d_stateChanged(const char* key, const char* value) = 0; + virtual void d_stateChanged(const char* key, const char* value) override = 0; #endif #if DISTRHO_PLUGIN_IS_SYNTH - virtual void d_noteReceived(bool onOff, uint8_t channel, uint8_t note, uint8_t velocity) = 0; + virtual void d_noteReceived(bool onOff, uint8_t channel, uint8_t note, uint8_t velocity) override = 0; #endif // --------------------------------------------- // UI Callbacks - virtual void d_uiIdle() {} + virtual void d_uiIdle() override {} private: friend class UIInternal; diff --git a/source/libs/distrho/DistrhoUIQt.hpp b/source/libs/distrho/DistrhoUIQt.hpp index 58ab8932c..685da7327 100644 --- a/source/libs/distrho/DistrhoUIQt.hpp +++ b/source/libs/distrho/DistrhoUIQt.hpp @@ -37,7 +37,12 @@ class QtUI : public UI, { public: QtUI(); - virtual ~QtUI(); + virtual ~QtUI() override; + + // --------------------------------------------- + // UI Helpers + + void setSize(unsigned int width, unsigned int height); protected: // --------------------------------------------- @@ -50,32 +55,27 @@ protected: // --------------------------------------------- // DSP Callbacks - virtual void d_parameterChanged(uint32_t index, float value) = 0; + virtual void d_parameterChanged(uint32_t index, float value) override = 0; #if DISTRHO_PLUGIN_WANT_PROGRAMS - virtual void d_programChanged(uint32_t index) = 0; + virtual void d_programChanged(uint32_t index) override = 0; #endif #if DISTRHO_PLUGIN_WANT_STATE - virtual void d_stateChanged(const char* key, const char* value) = 0; + virtual void d_stateChanged(const char* key, const char* value) override = 0; #endif #if DISTRHO_PLUGIN_IS_SYNTH - virtual void d_noteReceived(bool onOff, uint8_t channel, uint8_t note, uint8_t velocity) = 0; + virtual void d_noteReceived(bool onOff, uint8_t channel, uint8_t note, uint8_t velocity) override = 0; #endif // --------------------------------------------- // UI Callbacks - virtual void d_uiIdle() {} - - // --------------------------------------------- - // UI Helpers - - void setSize(unsigned int width, unsigned int height); + virtual void d_uiIdle() override {} private: friend class UIInternal; - unsigned int d_width() const { return width(); } - unsigned int d_height() const { return height(); } + unsigned int d_width() const override { return width(); } + unsigned int d_height() const override { return height(); } }; // ------------------------------------------------- diff --git a/source/libs/distrho/src/DistrhoUIOpenGL.cpp b/source/libs/distrho/src/DistrhoUIOpenGL.cpp index cb6506711..e1f04d2c4 100644 --- a/source/libs/distrho/src/DistrhoUIOpenGL.cpp +++ b/source/libs/distrho/src/DistrhoUIOpenGL.cpp @@ -23,7 +23,7 @@ END_NAMESPACE_DGL START_NAMESPACE_DISTRHO // ------------------------------------------------- -// OpenGLUI +// OpenGL UI OpenGLUI::OpenGLUI() : UI(), diff --git a/source/libs/distrho/src/DistrhoUIQt.cpp b/source/libs/distrho/src/DistrhoUIQt.cpp index 1402ec469..d6a6ff0f6 100644 --- a/source/libs/distrho/src/DistrhoUIQt.cpp +++ b/source/libs/distrho/src/DistrhoUIQt.cpp @@ -21,7 +21,7 @@ START_NAMESPACE_DISTRHO // ------------------------------------------------- -// Qt4UI +// Qt UI QtUI::QtUI() : UI(), @@ -33,6 +33,8 @@ QtUI::~QtUI() { } +// ------------------------------------------------- + void QtUI::setSize(unsigned int width, unsigned int height) { if (d_resizable())