From e6432e183e426293dc09752144c86a89a5b11321 Mon Sep 17 00:00:00 2001 From: Gordon JC Pearce Date: Wed, 8 Jan 2025 02:11:03 +0000 Subject: [PATCH] GUI works, graphics not right yet --- plugin/parameters.cpp | 2 +- plugin/ui.cpp | 43 ++++++++++++++++++++++++++----------------- 2 files changed, 27 insertions(+), 18 deletions(-) diff --git a/plugin/parameters.cpp b/plugin/parameters.cpp index accde52..59ab388 100644 --- a/plugin/parameters.cpp +++ b/plugin/parameters.cpp @@ -177,5 +177,5 @@ float AlphaOsc::getParameterValue(uint32_t index) const { return 0; } // if we fall all the way through... - return 0; + return 2; } \ No newline at end of file diff --git a/plugin/ui.cpp b/plugin/ui.cpp index 219d59a..cce8e8d 100644 --- a/plugin/ui.cpp +++ b/plugin/ui.cpp @@ -15,45 +15,58 @@ DistrhoUIAlphaOsc::DistrhoUIAlphaOsc() : UI(Art::bgWidth, Art::bgHeight, true), xSliderSqrMode = new ImageSlider(this, whiteSlider); xSliderSqrMode->setId(AlphaOsc::pSqrMode); - xSliderSqrMode->setStartPos(25, 84); - xSliderSqrMode->setEndPos(25, 20); - xSliderSqrMode->setRange(0, 4.0f); + xSliderSqrMode->setStartPos(25, 36); + xSliderSqrMode->setEndPos(25, 84); + xSliderSqrMode->setRange(0, 3.0f); + xSliderSqrMode->setInverted(true); + xSliderSqrMode->setStep(1); xSliderSqrMode->setCallback(this); xSliderSawMode = new ImageSlider(this, whiteSlider); xSliderSawMode->setId(AlphaOsc::pSawMode); - xSliderSawMode->setStartPos(80, 117); - xSliderSawMode->setEndPos(80, 36); + xSliderSawMode->setStartPos(80, 36); + xSliderSawMode->setEndPos(80, 117); xSliderSawMode->setRange(0, 5.0f); + xSliderSawMode->setInverted(true); + xSliderSawMode->setStep(1); xSliderSawMode->setCallback(this); xSliderSubMode = new ImageSlider(this, whiteSlider); xSliderSubMode->setId(AlphaOsc::pSubMode); - xSliderSubMode->setStartPos(135, 117); - xSliderSubMode->setEndPos(135, 36); + xSliderSubMode->setStartPos(135, 36); + xSliderSubMode->setEndPos(135, 117); xSliderSubMode->setRange(0, 5.0f); + xSliderSubMode->setInverted(true); + xSliderSubMode->setStep(1); xSliderSubMode->setCallback(this); xSliderSubLevel = new ImageSlider(this, whiteSlider); xSliderSubLevel->setId(AlphaOsc::pSubLevel); - xSliderSubLevel->setStartPos(195, 117); - xSliderSubLevel->setEndPos(195, 36); + xSliderSubLevel->setStartPos(195, 36); + xSliderSubLevel->setEndPos(195, 117); xSliderSubLevel->setRange(0, 1.0f); + xSliderSubLevel->setInverted(true); xSliderSubLevel->setCallback(this); xSliderPWMDepth = new ImageSlider(this, whiteSlider); xSliderPWMDepth->setId(AlphaOsc::pPWMDepth); - xSliderPWMDepth->setStartPos(265, 117); - xSliderPWMDepth->setEndPos(265, 36); + xSliderPWMDepth->setStartPos(265, 36); + xSliderPWMDepth->setEndPos(265, 117); xSliderPWMDepth->setRange(0, 1.0f); + xSliderPWMDepth->setInverted(true); xSliderPWMDepth->setCallback(this); xSliderPWMRate = new ImageSlider(this, whiteSlider); xSliderPWMRate->setId(AlphaOsc::pPWMRate); - xSliderPWMRate->setStartPos(305, 117); - xSliderPWMRate->setEndPos(305, 36); + xSliderPWMRate->setStartPos(305, 36); + xSliderPWMRate->setEndPos(305, 117); xSliderPWMRate->setRange(0, 1.0f); + xSliderPWMRate->setInverted(true); xSliderPWMRate->setCallback(this); + + // default settings + xSliderSubMode->setValue(2.0f); + } void DistrhoUIAlphaOsc::parameterChanged(uint32_t index, float value) { @@ -85,18 +98,14 @@ void DistrhoUIAlphaOsc::parameterChanged(uint32_t index, float value) { } void DistrhoUIAlphaOsc::imageSliderDragStarted(ImageSlider* slider) { - printf("dragstarted on %d\n", slider->getId()); editParameter(slider->getId(), true); } void DistrhoUIAlphaOsc::imageSliderDragFinished(ImageSlider* slider) { - printf("dragfinished on %d\n", slider->getId()); editParameter(slider->getId(), false); } void DistrhoUIAlphaOsc::imageSliderValueChanged(ImageSlider* slider, float value) { - printf("%f\n", value); - printf("valuechanged on %d\n", slider->getId()); setParameterValue(slider->getId(), value); }