Browse Source

Update dpf, set initial ui size

Signed-off-by: falkTX <falktx@falktx.com>
master
falkTX 1 month ago
parent
commit
964a467483
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
5 changed files with 28 additions and 27 deletions
  1. +1
    -1
      dpf
  2. +4
    -1
      plugins/glBars/DistrhoPluginInfo.h
  3. +18
    -23
      plugins/glBars/DistrhoUIGLBars.cpp
  4. +4
    -1
      plugins/glBars/DistrhoUIGLBars.hpp
  5. +1
    -1
      plugins/glBars/ResizeHandle.hpp

+ 1
- 1
dpf

@@ -1 +1 @@
Subproject commit e045225a6c08d437d0bcf8400da9b0783291b4a9
Subproject commit d4c2ce6e3da43ae328876146b60d2d2cca5caa44

+ 4
- 1
plugins/glBars/DistrhoPluginInfo.h View File

@@ -3,7 +3,7 @@
* Copyright (C) 1998-2000 Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front Technologies
* Copyright (C) 2000 Christian Zander <phoenix@minion.de>
* Copyright (C) 2015 Nedko Arnaudov
* Copyright (C) 2016-2022 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2016-2026 Filipe Coelho <falktx@falktx.com>
*
* 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,


+ 18
- 23
plugins/glBars/DistrhoUIGLBars.cpp View File

@@ -3,7 +3,7 @@
* Copyright (C) 1998-2000 Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front Technologies
* Copyright (C) 2000 Christian Zander <phoenix@minion.de>
* Copyright (C) 2015 Nedko Arnaudov
* Copyright (C) 2016-2022 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2016-2026 Filipe Coelho <falktx@falktx.com>
*
* 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<DistrhoPluginGLBars*>(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

+ 4
- 1
plugins/glBars/DistrhoUIGLBars.hpp View File

@@ -3,7 +3,7 @@
* Copyright (C) 1998-2000 Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front Technologies
* Copyright (C) 2000 Christian Zander <phoenix@minion.de>
* Copyright (C) 2015 Nedko Arnaudov
* Copyright (C) 2016-2022 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2016-2026 Filipe Coelho <falktx@falktx.com>
*
* 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)
};


+ 1
- 1
plugins/glBars/ResizeHandle.hpp View File

@@ -167,7 +167,7 @@ private:
return;

hasCursor = shouldHaveCursor;
setCursor(shouldHaveCursor ? kMouseCursorDiagonal : kMouseCursorArrow);
setCursor(shouldHaveCursor ? kMouseCursorUpLeftDownRight : kMouseCursorArrow);
}

void resetArea()


Loading…
Cancel
Save