| @@ -47,9 +47,6 @@ public: | |||
| ImageKnob& operator=(const ImageKnob& imageKnob); | |||
| ~ImageKnob() override; | |||
| int getId() const noexcept; | |||
| void setId(int id) noexcept; | |||
| float getValue() const noexcept; | |||
| void setDefault(float def) noexcept; | |||
| @@ -70,7 +67,6 @@ protected: | |||
| private: | |||
| Image fImage; | |||
| int fId; | |||
| float fMinimum; | |||
| float fMaximum; | |||
| float fStep; | |||
| @@ -36,14 +36,11 @@ public: | |||
| virtual void imageSliderValueChanged(ImageSlider* imageSlider, float value) = 0; | |||
| }; | |||
| explicit ImageSlider(Window& parent, const Image& image, int id = 0) noexcept; | |||
| explicit ImageSlider(Widget* widget, const Image& image, int id = 0) noexcept; | |||
| explicit ImageSlider(Window& parent, const Image& image) noexcept; | |||
| explicit ImageSlider(Widget* widget, const Image& image) noexcept; | |||
| explicit ImageSlider(const ImageSlider& imageSlider) noexcept; | |||
| ImageSlider& operator=(const ImageSlider& imageSlider) noexcept; | |||
| int getId() const noexcept; | |||
| void setId(int id) noexcept; | |||
| float getValue() const noexcept; | |||
| void setStartPos(const Point<int>& startPos) noexcept; | |||
| @@ -65,7 +62,6 @@ protected: | |||
| private: | |||
| Image fImage; | |||
| int fId; | |||
| float fMinimum; | |||
| float fMaximum; | |||
| float fStep; | |||
| @@ -39,9 +39,6 @@ public: | |||
| explicit ImageSwitch(const ImageSwitch& imageSwitch) noexcept; | |||
| ImageSwitch& operator=(const ImageSwitch& imageSwitch) noexcept; | |||
| int getId() const noexcept; | |||
| void setId(int id) noexcept; | |||
| bool isDown() const noexcept; | |||
| void setDown(bool down) noexcept; | |||
| @@ -55,7 +52,6 @@ private: | |||
| Image fImageNormal; | |||
| Image fImageDown; | |||
| bool fIsDown; | |||
| int fId; | |||
| Callback* fCallback; | |||
| @@ -641,7 +641,7 @@ public: | |||
| Creates font by loading it from the specified memory chunk. | |||
| Returns handle to the font. | |||
| */ | |||
| FontId createFontMem(const char* name, uchar* data, int ndata, bool freeData); | |||
| FontId createFontMem(const char* name, const uchar* data, int ndata, bool freeData); | |||
| /** | |||
| Finds a loaded font of specified name, and returns handle to it, or -1 if the font is not found. | |||
| @@ -256,6 +256,18 @@ public: | |||
| */ | |||
| void repaint() noexcept; | |||
| /** | |||
| Get the Id associated with this widget. | |||
| @see setId | |||
| */ | |||
| uint getId() const noexcept; | |||
| /** | |||
| Set an Id to be associated with this widget. | |||
| @see getId | |||
| */ | |||
| void setId(uint id) noexcept; | |||
| protected: | |||
| /** | |||
| A function called to draw the view contents with OpenGL. | |||
| @@ -318,6 +330,7 @@ private: | |||
| bool fNeedsFullViewport; | |||
| bool fNeedsScaling; | |||
| bool fVisible; | |||
| uint fId; | |||
| Point<int> fAbsolutePos; | |||
| Size<uint> fSize; | |||
| @@ -56,7 +56,7 @@ public: | |||
| void setTitle(const char* title); | |||
| void setTransientWinId(intptr_t winId); | |||
| void setTransientWinId(uintptr_t winId); | |||
| App& getApp() const noexcept; | |||
| intptr_t getWindowId() const noexcept; | |||
| @@ -22,7 +22,7 @@ START_NAMESPACE_DGL | |||
| // ----------------------------------------------------------------------- | |||
| ImageKnob::ImageKnob(Window& parent, const Image& image, Orientation orientation, int id) noexcept | |||
| ImageKnob::ImageKnob(Window& parent, const Image& image, Orientation orientation) noexcept | |||
| : Widget(parent), | |||
| fImage(image), | |||
| fId(id), | |||
| @@ -52,10 +52,9 @@ ImageKnob::ImageKnob(Window& parent, const Image& image, Orientation orientation | |||
| setSize(fImgLayerSize, fImgLayerSize); | |||
| } | |||
| ImageKnob::ImageKnob(Widget* widget, const Image& image, Orientation orientation, int id) noexcept | |||
| ImageKnob::ImageKnob(Widget* widget, const Image& image, Orientation orientation) noexcept | |||
| : Widget(widget->getParentWindow()), | |||
| fImage(image), | |||
| fId(id), | |||
| fMinimum(0.0f), | |||
| fMaximum(1.0f), | |||
| fStep(0.0f), | |||
| @@ -85,7 +84,6 @@ ImageKnob::ImageKnob(Widget* widget, const Image& image, Orientation orientation | |||
| ImageKnob::ImageKnob(const ImageKnob& imageKnob) | |||
| : Widget(imageKnob.getParentWindow()), | |||
| fImage(imageKnob.fImage), | |||
| fId(imageKnob.fId), | |||
| fMinimum(imageKnob.fMinimum), | |||
| fMaximum(imageKnob.fMaximum), | |||
| fStep(imageKnob.fStep), | |||
| @@ -115,7 +113,6 @@ ImageKnob::ImageKnob(const ImageKnob& imageKnob) | |||
| ImageKnob& ImageKnob::operator=(const ImageKnob& imageKnob) | |||
| { | |||
| fImage = imageKnob.fImage; | |||
| fId = imageKnob.fId; | |||
| fMinimum = imageKnob.fMinimum; | |||
| fMaximum = imageKnob.fMaximum; | |||
| fStep = imageKnob.fStep; | |||
| @@ -157,16 +154,6 @@ ImageKnob::~ImageKnob() | |||
| } | |||
| } | |||
| int ImageKnob::getId() const noexcept | |||
| { | |||
| return fId; | |||
| } | |||
| void ImageKnob::setId(int id) noexcept | |||
| { | |||
| fId = id; | |||
| } | |||
| float ImageKnob::getValue() const noexcept | |||
| { | |||
| return fValue; | |||
| @@ -22,10 +22,9 @@ START_NAMESPACE_DGL | |||
| // ----------------------------------------------------------------------- | |||
| ImageSlider::ImageSlider(Window& parent, const Image& image, int id) noexcept | |||
| ImageSlider::ImageSlider(Window& parent, const Image& image) noexcept | |||
| : Widget(parent), | |||
| fImage(image), | |||
| fId(id), | |||
| fMinimum(0.0f), | |||
| fMaximum(1.0f), | |||
| fStep(0.0f), | |||
| @@ -44,10 +43,9 @@ ImageSlider::ImageSlider(Window& parent, const Image& image, int id) noexcept | |||
| Widget::setNeedsFullViewport(true); | |||
| } | |||
| ImageSlider::ImageSlider(Widget* widget, const Image& image, int id) noexcept | |||
| ImageSlider::ImageSlider(Widget* widget, const Image& image) noexcept | |||
| : Widget(widget->getParentWindow()), | |||
| fImage(image), | |||
| fId(id), | |||
| fMinimum(0.0f), | |||
| fMaximum(1.0f), | |||
| fStep(0.0f), | |||
| @@ -69,7 +67,6 @@ ImageSlider::ImageSlider(Widget* widget, const Image& image, int id) noexcept | |||
| ImageSlider::ImageSlider(const ImageSlider& imageSlider) noexcept | |||
| : Widget(imageSlider.getParentWindow()), | |||
| fImage(imageSlider.fImage), | |||
| fId(imageSlider.fId), | |||
| fMinimum(imageSlider.fMinimum), | |||
| fMaximum(imageSlider.fMaximum), | |||
| fStep(imageSlider.fStep), | |||
| @@ -91,7 +88,6 @@ ImageSlider::ImageSlider(const ImageSlider& imageSlider) noexcept | |||
| ImageSlider& ImageSlider::operator=(const ImageSlider& imageSlider) noexcept | |||
| { | |||
| fImage = imageSlider.fImage; | |||
| fId = imageSlider.fId; | |||
| fMinimum = imageSlider.fMinimum; | |||
| fMaximum = imageSlider.fMaximum; | |||
| fStep = imageSlider.fStep; | |||
| @@ -109,16 +105,6 @@ ImageSlider& ImageSlider::operator=(const ImageSlider& imageSlider) noexcept | |||
| return *this; | |||
| } | |||
| int ImageSlider::getId() const noexcept | |||
| { | |||
| return fId; | |||
| } | |||
| void ImageSlider::setId(int id) noexcept | |||
| { | |||
| fId = id; | |||
| } | |||
| float ImageSlider::getValue() const noexcept | |||
| { | |||
| return fValue; | |||
| @@ -20,12 +20,11 @@ START_NAMESPACE_DGL | |||
| // ----------------------------------------------------------------------- | |||
| ImageSwitch::ImageSwitch(Window& parent, const Image& imageNormal, const Image& imageDown, int id) noexcept | |||
| ImageSwitch::ImageSwitch(Window& parent, const Image& imageNormal, const Image& imageDown) noexcept | |||
| : Widget(parent), | |||
| fImageNormal(imageNormal), | |||
| fImageDown(imageDown), | |||
| fIsDown(false), | |||
| fId(id), | |||
| fCallback(nullptr), | |||
| leakDetector_ImageSwitch() | |||
| { | |||
| @@ -34,12 +33,11 @@ ImageSwitch::ImageSwitch(Window& parent, const Image& imageNormal, const Image& | |||
| setSize(fImageNormal.getSize()); | |||
| } | |||
| ImageSwitch::ImageSwitch(Widget* widget, const Image& imageNormal, const Image& imageDown, int id) noexcept | |||
| ImageSwitch::ImageSwitch(Widget* widget, const Image& imageNormal, const Image& imageDown) noexcept | |||
| : Widget(widget->getParentWindow()), | |||
| fImageNormal(imageNormal), | |||
| fImageDown(imageDown), | |||
| fIsDown(false), | |||
| fId(id), | |||
| fCallback(nullptr), | |||
| leakDetector_ImageSwitch() | |||
| { | |||
| @@ -53,7 +51,6 @@ ImageSwitch::ImageSwitch(const ImageSwitch& imageSwitch) noexcept | |||
| fImageNormal(imageSwitch.fImageNormal), | |||
| fImageDown(imageSwitch.fImageDown), | |||
| fIsDown(imageSwitch.fIsDown), | |||
| fId(imageSwitch.fId), | |||
| fCallback(imageSwitch.fCallback), | |||
| leakDetector_ImageSwitch() | |||
| { | |||
| @@ -67,7 +64,6 @@ ImageSwitch& ImageSwitch::operator=(const ImageSwitch& imageSwitch) noexcept | |||
| fImageNormal = imageSwitch.fImageNormal; | |||
| fImageDown = imageSwitch.fImageDown; | |||
| fIsDown = imageSwitch.fIsDown; | |||
| fId = imageSwitch.fId; | |||
| fCallback = imageSwitch.fCallback; | |||
| DISTRHO_SAFE_ASSERT(fImageNormal.getSize() == fImageDown.getSize()); | |||
| @@ -77,16 +73,6 @@ ImageSwitch& ImageSwitch::operator=(const ImageSwitch& imageSwitch) noexcept | |||
| return *this; | |||
| } | |||
| int ImageSwitch::getId() const noexcept | |||
| { | |||
| return fId; | |||
| } | |||
| void ImageSwitch::setId(int id) noexcept | |||
| { | |||
| fId = id;; | |||
| } | |||
| bool ImageSwitch::isDown() const noexcept | |||
| { | |||
| return fIsDown; | |||
| @@ -27,6 +27,7 @@ Widget::Widget(Window& parent) | |||
| fNeedsFullViewport(false), | |||
| fNeedsScaling(false), | |||
| fVisible(true), | |||
| fId(0), | |||
| fAbsolutePos(0, 0), | |||
| fSize(0, 0), | |||
| leakDetector_Widget() | |||
| @@ -200,6 +201,16 @@ void Widget::repaint() noexcept | |||
| fParent.repaint(); | |||
| } | |||
| uint Widget::getId() const noexcept | |||
| { | |||
| return fId; | |||
| } | |||
| void Widget::setId(uint id) noexcept | |||
| { | |||
| fId = id; | |||
| } | |||
| bool Widget::onKeyboard(const KeyboardEvent&) | |||
| { | |||
| return false; | |||
| @@ -554,7 +554,7 @@ struct Window::PrivateData { | |||
| #endif | |||
| } | |||
| void setTransientWinId(const intptr_t winId) | |||
| void setTransientWinId(const uintptr_t winId) | |||
| { | |||
| #if defined(DISTRHO_OS_LINUX) | |||
| XSetTransientForHint(xDisplay, xWindow, static_cast< ::Window>(winId)); | |||
| @@ -1010,7 +1010,7 @@ void Window::setTitle(const char* title) | |||
| pData->setTitle(title); | |||
| } | |||
| void Window::setTransientWinId(intptr_t winId) | |||
| void Window::setTransientWinId(uintptr_t winId) | |||
| { | |||
| pData->setTransientWinId(winId); | |||
| } | |||
| @@ -1074,8 +1074,8 @@ void Window::onReshape(uint width, uint height) | |||
| glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); | |||
| glMatrixMode(GL_PROJECTION); | |||
| glLoadIdentity(); | |||
| glOrtho(0, width, height, 0, 0.0f, 1.0f); | |||
| glViewport(0, 0, width, height); | |||
| glOrtho(0.0, static_cast<GLdouble>(width), static_cast<GLdouble>(height), 0.0, 0.0, 1.0); | |||
| glViewport(0, 0, static_cast<GLsizei>(width), static_cast<GLsizei>(height)); | |||
| glMatrixMode(GL_MODELVIEW); | |||
| glLoadIdentity(); | |||
| } | |||
| @@ -24,6 +24,9 @@ | |||
| #include <cstdlib> | |||
| #include <cstring> | |||
| #include <cmath> | |||
| #include <limits> | |||
| #ifdef DISTRHO_PROPER_CPP11_SUPPORT | |||
| # include <cstdint> | |||
| #else | |||
| @@ -46,18 +49,28 @@ inline float round(float __x) | |||
| // ----------------------------------------------------------------------- | |||
| // misc functions | |||
| /* | |||
| * Return a 64-bit number from 4 8-bit numbers. | |||
| */ | |||
| static inline | |||
| int64_t d_cconst(const int a, const int b, const int c, const int d) noexcept | |||
| int64_t d_cconst(const uint8_t a, const uint8_t b, const uint8_t c, const uint8_t d) noexcept | |||
| { | |||
| return (a << 24) | (b << 16) | (c << 8) | (d << 0); | |||
| } | |||
| /* | |||
| * Dummy function. | |||
| */ | |||
| static inline | |||
| void d_pass() noexcept {} | |||
| // ----------------------------------------------------------------------- | |||
| // string print functions | |||
| /* | |||
| * Print a string to stdout with newline (gray color). | |||
| * Does nothing if DEBUG is not defined. | |||
| */ | |||
| #ifndef DEBUG | |||
| # define d_debug(...) | |||
| #else | |||
| @@ -75,6 +88,9 @@ void d_debug(const char* const fmt, ...) noexcept | |||
| } | |||
| #endif | |||
| /* | |||
| * Print a string to stdout with newline. | |||
| */ | |||
| static inline | |||
| void d_stdout(const char* const fmt, ...) noexcept | |||
| { | |||
| @@ -87,6 +103,9 @@ void d_stdout(const char* const fmt, ...) noexcept | |||
| } catch (...) {} | |||
| } | |||
| /* | |||
| * Print a string to stderr with newline. | |||
| */ | |||
| static inline | |||
| void d_stderr(const char* const fmt, ...) noexcept | |||
| { | |||
| @@ -99,6 +118,9 @@ void d_stderr(const char* const fmt, ...) noexcept | |||
| } catch (...) {} | |||
| } | |||
| /* | |||
| * Print a string to stderr with newline (red color). | |||
| */ | |||
| static inline | |||
| void d_stderr2(const char* const fmt, ...) noexcept | |||
| { | |||
| @@ -112,18 +134,58 @@ void d_stderr2(const char* const fmt, ...) noexcept | |||
| } catch (...) {} | |||
| } | |||
| /* | |||
| * Print a safe assertion error message. | |||
| */ | |||
| static inline | |||
| void d_safe_assert(const char* const assertion, const char* const file, const int line) noexcept | |||
| { | |||
| d_stderr2("assertion failure: \"%s\" in file %s, line %i", assertion, file, line); | |||
| } | |||
| /* | |||
| * Print a safe exception error message. | |||
| */ | |||
| static inline | |||
| void d_safe_exception(const char* const exception, const char* const file, const int line) noexcept | |||
| { | |||
| d_stderr2("exception caught: \"%s\" in file %s, line %i", exception, file, line); | |||
| } | |||
| // ----------------------------------------------------------------------- | |||
| // math functions | |||
| /* | |||
| * Safely compare two floating point numbers. | |||
| * Returns true if they match. | |||
| */ | |||
| template<typename T> | |||
| static inline | |||
| bool d_isEqual(const T& v1, const T& v2) | |||
| { | |||
| return std::abs(v1-v2) < std::numeric_limits<T>::epsilon(); | |||
| } | |||
| /* | |||
| * Safely check if a floating point number is zero. | |||
| */ | |||
| template<typename T> | |||
| static inline | |||
| bool d_isZero(const T& value) | |||
| { | |||
| return std::abs(value) < std::numeric_limits<T>::epsilon(); | |||
| } | |||
| /* | |||
| * Safely check if a floating point number is not zero. | |||
| */ | |||
| template<typename T> | |||
| static inline | |||
| bool d_isNotZero(const T& value) | |||
| { | |||
| return std::abs(value) >= std::numeric_limits<T>::epsilon(); | |||
| } | |||
| // ----------------------------------------------------------------------- | |||
| #endif // DISTRHO_UTILS_HPP_INCLUDED | |||
| @@ -83,7 +83,7 @@ struct Plugin::PrivateData { | |||
| sampleRate(d_lastSampleRate) | |||
| { | |||
| DISTRHO_SAFE_ASSERT(bufferSize != 0); | |||
| DISTRHO_SAFE_ASSERT(sampleRate != 0.0); | |||
| DISTRHO_SAFE_ASSERT(d_isNotZero(sampleRate)); | |||
| } | |||
| ~PrivateData() noexcept | |||
| @@ -433,7 +433,7 @@ public: | |||
| DISTRHO_SAFE_ASSERT_RETURN(fPlugin != nullptr,); | |||
| DISTRHO_SAFE_ASSERT(sampleRate > 0.0); | |||
| if (fData->sampleRate == sampleRate) | |||
| if (d_isEqual(fData->sampleRate, sampleRate)) | |||
| return; | |||
| fData->sampleRate = sampleRate; | |||
| @@ -96,8 +96,8 @@ void UI::d_uiReshape(uint width, uint height) | |||
| glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); | |||
| glMatrixMode(GL_PROJECTION); | |||
| glLoadIdentity(); | |||
| glOrtho(0, width, height, 0, 0.0f, 1.0f); | |||
| glViewport(0, 0, width, height); | |||
| glOrtho(0.0, static_cast<GLdouble>(width), static_cast<GLdouble>(height), 0.0, 0.0, 1.0); | |||
| glViewport(0, 0, static_cast<GLsizei>(width), static_cast<GLsizei>(height)); | |||
| glMatrixMode(GL_MODELVIEW); | |||
| glLoadIdentity(); | |||
| } | |||
| @@ -75,7 +75,7 @@ struct UI::PrivateData { | |||
| setSizeCallbackFunc(nullptr), | |||
| ptr(nullptr) | |||
| { | |||
| DISTRHO_SAFE_ASSERT(sampleRate != 0.0); | |||
| DISTRHO_SAFE_ASSERT(d_isNotZero(sampleRate)); | |||
| #if defined(DISTRHO_PLUGIN_TARGET_DSSI) || defined(DISTRHO_PLUGIN_TARGET_LV2) | |||
| parameterOffset += DISTRHO_PLUGIN_NUM_INPUTS + DISTRHO_PLUGIN_NUM_OUTPUTS; | |||
| @@ -331,7 +331,7 @@ public: | |||
| glWindow.setTitle(uiTitle); | |||
| } | |||
| void setWindowTransientWinId(const intptr_t winId) | |||
| void setWindowTransientWinId(const uintptr_t winId) | |||
| { | |||
| glWindow.setTransientWinId(winId); | |||
| } | |||
| @@ -351,7 +351,7 @@ public: | |||
| DISTRHO_SAFE_ASSERT_RETURN(fUI != nullptr,); | |||
| DISTRHO_SAFE_ASSERT(sampleRate > 0.0); | |||
| if (fData->sampleRate == sampleRate) | |||
| if (d_isEqual(fData->sampleRate, sampleRate)) | |||
| return; | |||
| fData->sampleRate = sampleRate; | |||
| @@ -192,13 +192,15 @@ $(OBJDIR)/distrho-3bandsplitter.cpp.o: distrho-3bandsplitter.cpp | |||
| $(OBJDIR)/distrho-mverb.cpp.o: distrho-mverb.cpp | |||
| -@mkdir -p $(OBJDIR) | |||
| # FIXME - fix mverb strict warnings | |||
| @echo "Compiling $<" | |||
| @$(CXX) $< $(BUILD_CXX_FLAGS) -DDISTRHO_NAMESPACE=DISTRHO_MVerb -Idistrho-mverb -I$(CWD)/modules/dgl -Wno-effc++ -c -o $@ | |||
| @$(CXX) $< $(BUILD_CXX_FLAGS) -DDISTRHO_NAMESPACE=DISTRHO_MVerb -Idistrho-mverb -I$(CWD)/modules/dgl -Wno-conversion -Wno-effc++ -Wno-shadow -c -o $@ | |||
| $(OBJDIR)/distrho-nekobi.cpp.o: distrho-nekobi.cpp | |||
| -@mkdir -p $(OBJDIR) | |||
| # FIXME - fix nekobi strict warnings | |||
| @echo "Compiling $<" | |||
| @$(CXX) $< $(BUILD_CXX_FLAGS) -DDISTRHO_NAMESPACE=DISTRHO_Nekobi -Idistrho-nekobi -I$(CWD)/modules/dgl -Wno-effc++ -c -o $@ | |||
| @$(CXX) $< $(BUILD_CXX_FLAGS) -DDISTRHO_NAMESPACE=DISTRHO_Nekobi -Idistrho-nekobi -I$(CWD)/modules/dgl -w -c -o $@ | |||
| $(OBJDIR)/distrho-pingpongpan.cpp.o: distrho-pingpongpan.cpp | |||
| -@mkdir -p $(OBJDIR) | |||
| @@ -128,12 +128,12 @@ void DistrhoPluginMVerb::d_initProgramName(uint32_t index, d_string& programName | |||
| float DistrhoPluginMVerb::d_getParameterValue(uint32_t index) const | |||
| { | |||
| return fVerb.getParameter(index) * 100.0f; | |||
| return fVerb.getParameter(static_cast<int>(index)) * 100.0f; | |||
| } | |||
| void DistrhoPluginMVerb::d_setParameterValue(uint32_t index, float value) | |||
| { | |||
| fVerb.setParameter(index, value / 100.0f); | |||
| fVerb.setParameter(static_cast<int>(index), value / 100.0f); | |||
| } | |||
| void DistrhoPluginMVerb::d_setProgram(uint32_t index) | |||
| @@ -212,7 +212,7 @@ void DistrhoPluginMVerb::d_activate() | |||
| void DistrhoPluginMVerb::d_run(const float** inputs, float** outputs, uint32_t frames) | |||
| { | |||
| fVerb.process(inputs, outputs, frames); | |||
| fVerb.process(inputs, outputs, static_cast<int>(frames)); | |||
| } | |||
| // ----------------------------------------------------------------------- | |||
| @@ -37,7 +37,7 @@ DistrhoUIMVerb::DistrhoUIMVerb() | |||
| fImgBackground = Image(DistrhoArtworkMVerb::backgroundData, DistrhoArtworkMVerb::backgroundWidth, DistrhoArtworkMVerb::backgroundHeight, GL_BGR); | |||
| // text | |||
| fNanoText.createFontMem("kh", (uchar*)khkangrey_ttf, khkangrey_ttfSize, false); | |||
| fNanoText.createFontMem("kh", (const uchar*)khkangrey_ttf, khkangrey_ttfSize, false); | |||
| // knobs | |||
| Image knobImage(DistrhoArtworkMVerb::knobData, DistrhoArtworkMVerb::knobWidth, DistrhoArtworkMVerb::knobHeight); | |||
| @@ -233,7 +233,7 @@ void DistrhoUIMVerb::onDisplay() | |||
| char strBuf[32+1]; | |||
| strBuf[32] = '\0'; | |||
| for (int i=0; i<MVerb<float>::NUM_PARAMS; ++i) | |||
| for (std::size_t i=0; i<MVerb<float>::NUM_PARAMS; ++i) | |||
| { | |||
| std::snprintf(strBuf, 32, "%i%%", int(fKnobs[i]->getValue())); | |||
| fNanoText.textBox(58 + fKnobs[i]->getAbsoluteX()-56, 73, 30.0f, strBuf, nullptr); | |||
| @@ -41,7 +41,8 @@ DistrhoUINekobi::DistrhoUINekobi() | |||
| // slider | |||
| Image sliderImage(DistrhoArtworkNekobi::sliderData, DistrhoArtworkNekobi::sliderWidth, DistrhoArtworkNekobi::sliderHeight); | |||
| fSliderWaveform = new ImageSlider(this, sliderImage, DistrhoPluginNekobi::paramWaveform); | |||
| fSliderWaveform = new ImageSlider(this, sliderImage); | |||
| fSliderWaveform->setId(DistrhoPluginNekobi::paramWaveform); | |||
| fSliderWaveform->setStartPos(133, 40); | |||
| fSliderWaveform->setEndPos(133, 60); | |||
| fSliderWaveform->setRange(0.0f, 1.0f); | |||
| @@ -53,7 +54,8 @@ DistrhoUINekobi::DistrhoUINekobi() | |||
| Image knobImage(DistrhoArtworkNekobi::knobData, DistrhoArtworkNekobi::knobWidth, DistrhoArtworkNekobi::knobHeight); | |||
| // knob Tuning | |||
| fKnobTuning = new ImageKnob(this, knobImage, ImageKnob::Vertical, DistrhoPluginNekobi::paramTuning); | |||
| fKnobTuning = new ImageKnob(this, knobImage, ImageKnob::Vertical); | |||
| fKnobTuning->setId(DistrhoPluginNekobi::paramTuning); | |||
| fKnobTuning->setAbsolutePos(41, 43); | |||
| fKnobTuning->setRange(-12.0f, 12.0f); | |||
| fKnobTuning->setDefault(0.0f); | |||
| @@ -62,7 +64,8 @@ DistrhoUINekobi::DistrhoUINekobi() | |||
| fKnobTuning->setCallback(this); | |||
| // knob Cutoff | |||
| fKnobCutoff = new ImageKnob(this, knobImage, ImageKnob::Vertical, DistrhoPluginNekobi::paramCutoff); | |||
| fKnobCutoff = new ImageKnob(this, knobImage, ImageKnob::Vertical); | |||
| fKnobCutoff->setId(DistrhoPluginNekobi::paramCutoff); | |||
| fKnobCutoff->setAbsolutePos(185, 43); | |||
| fKnobCutoff->setRange(0.0f, 100.0f); | |||
| fKnobCutoff->setDefault(25.0f); | |||
| @@ -71,7 +74,8 @@ DistrhoUINekobi::DistrhoUINekobi() | |||
| fKnobCutoff->setCallback(this); | |||
| // knob Resonance | |||
| fKnobResonance = new ImageKnob(this, knobImage, ImageKnob::Vertical, DistrhoPluginNekobi::paramResonance); | |||
| fKnobResonance = new ImageKnob(this, knobImage, ImageKnob::Vertical); | |||
| fKnobResonance->setId(DistrhoPluginNekobi::paramResonance); | |||
| fKnobResonance->setAbsolutePos(257, 43); | |||
| fKnobResonance->setRange(0.0f, 95.0f); | |||
| fKnobResonance->setDefault(25.0f); | |||
| @@ -80,7 +84,8 @@ DistrhoUINekobi::DistrhoUINekobi() | |||
| fKnobResonance->setCallback(this); | |||
| // knob Env Mod | |||
| fKnobEnvMod = new ImageKnob(this, knobImage, ImageKnob::Vertical, DistrhoPluginNekobi::paramEnvMod); | |||
| fKnobEnvMod = new ImageKnob(this, knobImage, ImageKnob::Vertical); | |||
| fKnobEnvMod->setId(DistrhoPluginNekobi::paramEnvMod); | |||
| fKnobEnvMod->setAbsolutePos(329, 43); | |||
| fKnobEnvMod->setRange(0.0f, 100.0f); | |||
| fKnobEnvMod->setDefault(50.0f); | |||
| @@ -89,7 +94,8 @@ DistrhoUINekobi::DistrhoUINekobi() | |||
| fKnobEnvMod->setCallback(this); | |||
| // knob Decay | |||
| fKnobDecay = new ImageKnob(this, knobImage, ImageKnob::Vertical, DistrhoPluginNekobi::paramDecay); | |||
| fKnobDecay = new ImageKnob(this, knobImage, ImageKnob::Vertical); | |||
| fKnobDecay->setId(DistrhoPluginNekobi::paramDecay); | |||
| fKnobDecay->setAbsolutePos(400, 43); | |||
| fKnobDecay->setRange(0.0f, 100.0f); | |||
| fKnobDecay->setDefault(75.0f); | |||
| @@ -98,7 +104,8 @@ DistrhoUINekobi::DistrhoUINekobi() | |||
| fKnobDecay->setCallback(this); | |||
| // knob Accent | |||
| fKnobAccent = new ImageKnob(this, knobImage, ImageKnob::Vertical, DistrhoPluginNekobi::paramAccent); | |||
| fKnobAccent = new ImageKnob(this, knobImage, ImageKnob::Vertical); | |||
| fKnobAccent->setId(DistrhoPluginNekobi::paramAccent); | |||
| fKnobAccent->setAbsolutePos(473, 43); | |||
| fKnobAccent->setRange(0.0f, 100.0f); | |||
| fKnobAccent->setDefault(25.0f); | |||
| @@ -107,7 +114,8 @@ DistrhoUINekobi::DistrhoUINekobi() | |||
| fKnobAccent->setCallback(this); | |||
| // knob Volume | |||
| fKnobVolume = new ImageKnob(this, knobImage, ImageKnob::Vertical, DistrhoPluginNekobi::paramVolume); | |||
| fKnobVolume = new ImageKnob(this, knobImage, ImageKnob::Vertical); | |||
| fKnobVolume->setId(DistrhoPluginNekobi::paramVolume); | |||
| fKnobVolume->setAbsolutePos(545, 43); | |||
| fKnobVolume->setRange(0.0f, 100.0f); | |||
| fKnobVolume->setDefault(75.0f); | |||
| @@ -197,17 +197,13 @@ void carla_zeroFloat(float* const data, const std::size_t numSamples) noexcept | |||
| // Missing functions in OSX. | |||
| namespace std { | |||
| inline float | |||
| fmin(float __x, float __y) | |||
| inline float fmin(float __x, float __y) | |||
| { return __builtin_fminf(__x, __y); } | |||
| inline float | |||
| fmax(float __x, float __y) | |||
| inline float fmax(float __x, float __y) | |||
| { return __builtin_fmaxf(__x, __y); } | |||
| inline float | |||
| rint(float __x) | |||
| inline float rint(float __x) | |||
| { return __builtin_rintf(__x); } | |||
| inline float | |||
| round(float __x) | |||
| inline float round(float __x) | |||
| { return __builtin_roundf(__x); } | |||
| } | |||
| #endif | |||