Skip to content

Commit

Permalink
Auto-scale UIs
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <falktx@falktx.com>
  • Loading branch information
falkTX committed Aug 14, 2021
1 parent 78a0d76 commit e59b4cb
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 17 deletions.
2 changes: 1 addition & 1 deletion dpf
Submodule dpf updated 43 files
+1 −1 .github/workflows/cmake.yml
+234 −0 .github/workflows/example-plugins.yml
+70 −0 .github/workflows/makefile.yml
+0 −44 .travis.yml
+0 −18 .travis/before_install.sh
+0 −29 .travis/install.sh
+0 −23 .travis/script-linux.sh
+0 −17 .travis/script-macos.sh
+0 −20 .travis/script-win32.sh
+0 −20 .travis/script-win64.sh
+47 −4 Makefile.base.mk
+5 −3 Makefile.plugins.mk
+7 −2 cmake/DPF-plugin.cmake
+4 −1 dgl/Makefile
+8 −0 dgl/TopLevelWidget.hpp
+4 −0 dgl/Widget.hpp
+5 −0 dgl/src/ApplicationPrivateData.cpp
+25 −12 dgl/src/Cairo.cpp
+15 −4 dgl/src/ImageBaseWidgets.cpp
+7 −4 dgl/src/OpenGL.cpp
+34 −2 dgl/src/TopLevelWidget.cpp
+18 −11 dgl/src/Window.cpp
+6 −5 dgl/src/WindowPrivateData.cpp
+60 −4 dgl/src/pugl.cpp
+15 −2 dgl/src/pugl.hpp
+1 −1 distrho/DistrhoUtils.hpp
+4 −0 distrho/extra/LibraryUtils.hpp
+4 −4 distrho/extra/String.hpp
+6 −5 distrho/src/DistrhoDefines.h
+1 −1 distrho/src/DistrhoPluginLV2.cpp
+1 −1 distrho/src/DistrhoPluginLV2export.cpp
+50 −5 distrho/src/DistrhoPluginVST2.cpp
+15 −3 distrho/src/DistrhoUIInternal.hpp
+5 −5 distrho/src/DistrhoUIPrivateData.hpp
+8 −3 distrho/src/jackbridge/JackBridge.cpp
+40 −5 distrho/src/jackbridge/RtAudioBridge.hpp
+0 −1 examples/CairoUI/CMakeLists.txt
+45 −17 examples/CairoUI/CairoExampleUI.cpp
+0 −86 examples/CairoUI/DemoWidgetClickable.cpp
+63 −5 examples/CairoUI/DemoWidgetClickable.hpp
+0 −1 examples/CairoUI/Makefile
+4 −4 examples/FileHandling/NanoButton.cpp
+13 −2 examples/Info/InfoExampleUI.cpp
9 changes: 7 additions & 2 deletions plugins/PowerJuice/PowerJuiceUI.cpp
Expand Up @@ -101,6 +101,9 @@ PowerJuiceUI::PowerJuiceUI()

// set default values
programLoaded(0);

// automatically-scale
setGeometryConstraints(PowerJuiceArtwork::backgroundWidth, PowerJuiceArtwork::backgroundHeight, true, true);
}

// -----------------------------------------------------------------------
Expand Down Expand Up @@ -153,7 +156,7 @@ void PowerJuiceUI::imageButtonClicked(ImageButton* button, int)
if (button != fButtonAbout)
return;

fAboutWindow.exec();
fAboutWindow.runAsModal();
}

void PowerJuiceUI::imageKnobDragStarted(ImageKnob* knob)
Expand Down Expand Up @@ -213,7 +216,9 @@ void PowerJuiceUI::uiIdle()

void PowerJuiceUI::onDisplay()
{
fImgBackground.draw();
const GraphicsContext& context(getGraphicsContext());

fImgBackground.draw(context);

if (dsp == nullptr)
return;
Expand Down
9 changes: 7 additions & 2 deletions plugins/PowerJuiceX2/PowerJuiceX2UI.cpp
Expand Up @@ -101,6 +101,9 @@ PowerJuiceX2UI::PowerJuiceX2UI()

// set default values
programLoaded(0);

// automatically-scale
setGeometryConstraints(PowerJuiceX2Artwork::backgroundWidth, PowerJuiceX2Artwork::backgroundHeight, true, true);
}

// -----------------------------------------------------------------------
Expand Down Expand Up @@ -153,7 +156,7 @@ void PowerJuiceX2UI::imageButtonClicked(ImageButton* button, int)
if (button != fButtonAbout)
return;

fAboutWindow.exec();
fAboutWindow.runAsModal();
}

void PowerJuiceX2UI::imageKnobDragStarted(ImageKnob* knob)
Expand Down Expand Up @@ -213,7 +216,9 @@ void PowerJuiceX2UI::uiIdle()

void PowerJuiceX2UI::onDisplay()
{
fImgBackground.draw();
const GraphicsContext& context(getGraphicsContext());

fImgBackground.draw(context);

if (dsp == nullptr)
return;
Expand Down
11 changes: 8 additions & 3 deletions plugins/StutterJuice/StutterJuiceUI.cpp
Expand Up @@ -81,6 +81,9 @@ StutterJuiceUI::StutterJuiceUI()

// set default values
programLoaded(0);

// automatically-scale
setGeometryConstraints(StutterJuiceArtwork::backgroundWidth, StutterJuiceArtwork::backgroundHeight, true, true);
}

// -----------------------------------------------------------------------
Expand Down Expand Up @@ -112,7 +115,7 @@ void StutterJuiceUI::imageButtonClicked(ImageButton* button, int)
if (button != fButtonAbout)
return;

fAboutWindow.exec();
fAboutWindow.runAsModal();
}

void StutterJuiceUI::imageSliderDragStarted(ImageSlider* slider)
Expand All @@ -132,10 +135,12 @@ void StutterJuiceUI::imageSliderValueChanged(ImageSlider* slider, float value)

void StutterJuiceUI::onDisplay()
{
fImgBackground.draw();
const GraphicsContext& context(getGraphicsContext());

fImgBackground.draw(context);

drawLFOs();
fImgOverlay.draw();
fImgOverlay.draw(context);
}

// -----------------------------------------------------------------------
Expand Down
3 changes: 3 additions & 0 deletions plugins/TriggerJuice/TriggerJuiceUI.cpp
Expand Up @@ -98,6 +98,9 @@ TriggerJuiceUI::TriggerJuiceUI()

// set default values
programLoaded(0);

// automatically-scale
setGeometryConstraints(TriggerJuiceArtwork::backgroundWidth, TriggerJuiceArtwork::backgroundHeight, true, true);
}

// -----------------------------------------------------------------------
Expand Down
13 changes: 8 additions & 5 deletions plugins/VectorJuice/VectorJuiceUI.cpp
Expand Up @@ -25,11 +25,9 @@ START_NAMESPACE_DISTRHO
// -----------------------------------------------------------------------

VectorJuiceUI::VectorJuiceUI()
: UI(),
: UI(VectorJuiceArtwork::backgroundWidth, VectorJuiceArtwork::backgroundHeight),
fAboutWindow(this)
{
setSize(VectorJuiceArtwork::backgroundWidth, VectorJuiceArtwork::backgroundHeight);

// xy params
paramX = paramY = 0.5f;

Expand Down Expand Up @@ -186,6 +184,9 @@ VectorJuiceUI::VectorJuiceUI()

// set default values
programLoaded(0);

// automatically-scale
setGeometryConstraints(VectorJuiceArtwork::backgroundWidth, VectorJuiceArtwork::backgroundHeight, true, true);
}

// -----------------------------------------------------------------------
Expand Down Expand Up @@ -303,7 +304,7 @@ void VectorJuiceUI::imageButtonClicked(ImageButton* button, int)
if (button != fButtonAbout)
return;

fAboutWindow.exec();
fAboutWindow.runAsModal();
}

void VectorJuiceUI::imageKnobDragStarted(ImageKnob* knob)
Expand Down Expand Up @@ -338,7 +339,9 @@ void VectorJuiceUI::imageSliderValueChanged(ImageSlider* slider, float value)

void VectorJuiceUI::onDisplay()
{
fImgBackground.draw();
const GraphicsContext& context(getGraphicsContext());

fImgBackground.draw(context);

// get x, y mapped to XY area
int x = fCanvasArea.getX() + paramX*fCanvasArea.getWidth() - fImgRoundlet.getWidth()/2;
Expand Down
9 changes: 5 additions & 4 deletions plugins/WobbleJuice/WobbleJuiceUI.cpp
Expand Up @@ -23,11 +23,9 @@ START_NAMESPACE_DISTRHO
// -----------------------------------------------------------------------

WobbleJuiceUI::WobbleJuiceUI()
: UI(),
: UI(WobbleJuiceArtwork::backgroundWidth, WobbleJuiceArtwork::backgroundHeight),
fAboutWindow(this)
{
setSize(WobbleJuiceArtwork::backgroundWidth, WobbleJuiceArtwork::backgroundHeight);

// background
fImgBackground = Image(WobbleJuiceArtwork::backgroundData, WobbleJuiceArtwork::backgroundWidth, WobbleJuiceArtwork::backgroundHeight, kImageFormatBGR);

Expand Down Expand Up @@ -102,6 +100,9 @@ WobbleJuiceUI::WobbleJuiceUI()

// set default values
programLoaded(0);

// automatically-scale
setGeometryConstraints(WobbleJuiceArtwork::backgroundWidth, WobbleJuiceArtwork::backgroundHeight, true, true);
}

// -----------------------------------------------------------------------
Expand Down Expand Up @@ -154,7 +155,7 @@ void WobbleJuiceUI::imageButtonClicked(ImageButton* button, int)
if (button != fButtonAbout)
return;

fAboutWindow.exec();
fAboutWindow.runAsModal();
}

void WobbleJuiceUI::imageKnobDragStarted(ImageKnob* knob)
Expand Down

0 comments on commit e59b4cb

Please sign in to comment.