diff --git a/dpf b/dpf index e045225..d4c2ce6 160000 --- a/dpf +++ b/dpf @@ -1 +1 @@ -Subproject commit e045225a6c08d437d0bcf8400da9b0783291b4a9 +Subproject commit d4c2ce6e3da43ae328876146b60d2d2cca5caa44 diff --git a/plugins/glBars/DistrhoPluginInfo.h b/plugins/glBars/DistrhoPluginInfo.h index 2bd321e..7cd4aeb 100644 --- a/plugins/glBars/DistrhoPluginInfo.h +++ b/plugins/glBars/DistrhoPluginInfo.h @@ -3,7 +3,7 @@ * Copyright (C) 1998-2000 Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front Technologies * Copyright (C) 2000 Christian Zander * Copyright (C) 2015 Nedko Arnaudov - * Copyright (C) 2016-2022 Filipe Coelho + * Copyright (C) 2016-2026 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -35,6 +35,9 @@ #define DISTRHO_PLUGIN_VST3_CATEGORIES "Fx|Analyzer" #define DISTRHO_UI_USER_RESIZABLE 1 +#define DISTRHO_UI_DEFAULT_WIDTH 512 +#define DISTRHO_UI_DEFAULT_HEIGHT 512 + enum Parameters { kParameterScale = 0, kParameterSpeed, diff --git a/plugins/glBars/DistrhoUIGLBars.cpp b/plugins/glBars/DistrhoUIGLBars.cpp index ef1deea..ebc592d 100644 --- a/plugins/glBars/DistrhoUIGLBars.cpp +++ b/plugins/glBars/DistrhoUIGLBars.cpp @@ -3,7 +3,7 @@ * Copyright (C) 1998-2000 Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front Technologies * Copyright (C) 2000 Christian Zander * Copyright (C) 2015 Nedko Arnaudov - * Copyright (C) 2016-2022 Filipe Coelho + * Copyright (C) 2016-2026 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -23,19 +23,17 @@ START_NAMESPACE_DISTRHO -// ----------------------------------------------------------------------- +// -------------------------------------------------------------------------------------------------------------------- DistrhoUIGLBars::DistrhoUIGLBars() - : UI(512, 512), + : UI(), fInitialized(false), - fResizeHandle(this) + fResizeHandle(this), + fPluginPtr(static_cast(getPluginInstancePointer())) { const double scaleFactor = getScaleFactor(); - if (d_isNotZero(scaleFactor)) - setSize(512*scaleFactor, 512*scaleFactor); - - setGeometryConstraints(256*scaleFactor, 256*scaleFactor, true); + setGeometryConstraints(256 * scaleFactor, 256 * scaleFactor, true); // no need to show resize handle if window is user-resizable if (isResizable()) @@ -44,17 +42,14 @@ DistrhoUIGLBars::DistrhoUIGLBars() DistrhoUIGLBars::~DistrhoUIGLBars() { - if (! fInitialized) - return; - - if (DistrhoPluginGLBars* const dspPtr = (DistrhoPluginGLBars*)getPluginInstancePointer()) + if (fInitialized && fPluginPtr != nullptr) { - const MutexLocker csm(dspPtr->fMutex); - dspPtr->fState = nullptr; + const MutexLocker csm(fPluginPtr->fMutex); + fPluginPtr->fState = nullptr; } } -// ----------------------------------------------------------------------- +// -------------------------------------------------------------------------------------------------------------------- // DSP Callbacks void DistrhoUIGLBars::parameterChanged(uint32_t index, float value) @@ -83,26 +78,26 @@ void DistrhoUIGLBars::parameterChanged(uint32_t index, float value) } } -// ----------------------------------------------------------------------- +// -------------------------------------------------------------------------------------------------------------------- // UI Callbacks void DistrhoUIGLBars::uiIdle() { repaint(); - if (DistrhoPluginGLBars* const dspPtr = (DistrhoPluginGLBars*)getPluginInstancePointer()) + if (fPluginPtr != nullptr) { - if (dspPtr->fState != nullptr) + if (fPluginPtr->fState != nullptr) return; fInitialized = true; - const MutexLocker csm(dspPtr->fMutex); - dspPtr->fState = &fState; + const MutexLocker csm(fPluginPtr->fMutex); + fPluginPtr->fState = &fState; } } -// ----------------------------------------------------------------------- +// -------------------------------------------------------------------------------------------------------------------- // Widget Callbacks void DistrhoUIGLBars::onDisplay() @@ -110,13 +105,13 @@ void DistrhoUIGLBars::onDisplay() fState.Render(); } -// ----------------------------------------------------------------------- +// -------------------------------------------------------------------------------------------------------------------- UI* createUI() { return new DistrhoUIGLBars(); } -// ----------------------------------------------------------------------- +// -------------------------------------------------------------------------------------------------------------------- END_NAMESPACE_DISTRHO diff --git a/plugins/glBars/DistrhoUIGLBars.hpp b/plugins/glBars/DistrhoUIGLBars.hpp index e1cf991..4fc24a0 100644 --- a/plugins/glBars/DistrhoUIGLBars.hpp +++ b/plugins/glBars/DistrhoUIGLBars.hpp @@ -3,7 +3,7 @@ * Copyright (C) 1998-2000 Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front Technologies * Copyright (C) 2000 Christian Zander * Copyright (C) 2015 Nedko Arnaudov - * Copyright (C) 2016-2022 Filipe Coelho + * Copyright (C) 2016-2026 Filipe Coelho * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -28,6 +28,8 @@ START_NAMESPACE_DISTRHO +class DistrhoPluginGLBars; + // ----------------------------------------------------------------------- class DistrhoUIGLBars : public UI @@ -56,6 +58,7 @@ private: bool fInitialized; glBarsState fState; ResizeHandle fResizeHandle; + DistrhoPluginGLBars* const fPluginPtr; DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(DistrhoUIGLBars) }; diff --git a/plugins/glBars/ResizeHandle.hpp b/plugins/glBars/ResizeHandle.hpp index 3e94963..c408e3d 100644 --- a/plugins/glBars/ResizeHandle.hpp +++ b/plugins/glBars/ResizeHandle.hpp @@ -167,7 +167,7 @@ private: return; hasCursor = shouldHaveCursor; - setCursor(shouldHaveCursor ? kMouseCursorDiagonal : kMouseCursorArrow); + setCursor(shouldHaveCursor ? kMouseCursorUpLeftDownRight : kMouseCursorArrow); } void resetArea()