GUI works, graphics not right yet

This commit is contained in:
Gordon JC Pearce 2025-01-08 02:11:03 +00:00
parent ae581d8c72
commit e6432e183e
2 changed files with 27 additions and 18 deletions

View File

@ -177,5 +177,5 @@ float AlphaOsc::getParameterValue(uint32_t index) const {
return 0; return 0;
} }
// if we fall all the way through... // if we fall all the way through...
return 0; return 2;
} }

View File

@ -15,45 +15,58 @@ DistrhoUIAlphaOsc::DistrhoUIAlphaOsc() : UI(Art::bgWidth, Art::bgHeight, true),
xSliderSqrMode = new ImageSlider(this, whiteSlider); xSliderSqrMode = new ImageSlider(this, whiteSlider);
xSliderSqrMode->setId(AlphaOsc::pSqrMode); xSliderSqrMode->setId(AlphaOsc::pSqrMode);
xSliderSqrMode->setStartPos(25, 84); xSliderSqrMode->setStartPos(25, 36);
xSliderSqrMode->setEndPos(25, 20); xSliderSqrMode->setEndPos(25, 84);
xSliderSqrMode->setRange(0, 4.0f); xSliderSqrMode->setRange(0, 3.0f);
xSliderSqrMode->setInverted(true);
xSliderSqrMode->setStep(1);
xSliderSqrMode->setCallback(this); xSliderSqrMode->setCallback(this);
xSliderSawMode = new ImageSlider(this, whiteSlider); xSliderSawMode = new ImageSlider(this, whiteSlider);
xSliderSawMode->setId(AlphaOsc::pSawMode); xSliderSawMode->setId(AlphaOsc::pSawMode);
xSliderSawMode->setStartPos(80, 117); xSliderSawMode->setStartPos(80, 36);
xSliderSawMode->setEndPos(80, 36); xSliderSawMode->setEndPos(80, 117);
xSliderSawMode->setRange(0, 5.0f); xSliderSawMode->setRange(0, 5.0f);
xSliderSawMode->setInverted(true);
xSliderSawMode->setStep(1);
xSliderSawMode->setCallback(this); xSliderSawMode->setCallback(this);
xSliderSubMode = new ImageSlider(this, whiteSlider); xSliderSubMode = new ImageSlider(this, whiteSlider);
xSliderSubMode->setId(AlphaOsc::pSubMode); xSliderSubMode->setId(AlphaOsc::pSubMode);
xSliderSubMode->setStartPos(135, 117); xSliderSubMode->setStartPos(135, 36);
xSliderSubMode->setEndPos(135, 36); xSliderSubMode->setEndPos(135, 117);
xSliderSubMode->setRange(0, 5.0f); xSliderSubMode->setRange(0, 5.0f);
xSliderSubMode->setInverted(true);
xSliderSubMode->setStep(1);
xSliderSubMode->setCallback(this); xSliderSubMode->setCallback(this);
xSliderSubLevel = new ImageSlider(this, whiteSlider); xSliderSubLevel = new ImageSlider(this, whiteSlider);
xSliderSubLevel->setId(AlphaOsc::pSubLevel); xSliderSubLevel->setId(AlphaOsc::pSubLevel);
xSliderSubLevel->setStartPos(195, 117); xSliderSubLevel->setStartPos(195, 36);
xSliderSubLevel->setEndPos(195, 36); xSliderSubLevel->setEndPos(195, 117);
xSliderSubLevel->setRange(0, 1.0f); xSliderSubLevel->setRange(0, 1.0f);
xSliderSubLevel->setInverted(true);
xSliderSubLevel->setCallback(this); xSliderSubLevel->setCallback(this);
xSliderPWMDepth = new ImageSlider(this, whiteSlider); xSliderPWMDepth = new ImageSlider(this, whiteSlider);
xSliderPWMDepth->setId(AlphaOsc::pPWMDepth); xSliderPWMDepth->setId(AlphaOsc::pPWMDepth);
xSliderPWMDepth->setStartPos(265, 117); xSliderPWMDepth->setStartPos(265, 36);
xSliderPWMDepth->setEndPos(265, 36); xSliderPWMDepth->setEndPos(265, 117);
xSliderPWMDepth->setRange(0, 1.0f); xSliderPWMDepth->setRange(0, 1.0f);
xSliderPWMDepth->setInverted(true);
xSliderPWMDepth->setCallback(this); xSliderPWMDepth->setCallback(this);
xSliderPWMRate = new ImageSlider(this, whiteSlider); xSliderPWMRate = new ImageSlider(this, whiteSlider);
xSliderPWMRate->setId(AlphaOsc::pPWMRate); xSliderPWMRate->setId(AlphaOsc::pPWMRate);
xSliderPWMRate->setStartPos(305, 117); xSliderPWMRate->setStartPos(305, 36);
xSliderPWMRate->setEndPos(305, 36); xSliderPWMRate->setEndPos(305, 117);
xSliderPWMRate->setRange(0, 1.0f); xSliderPWMRate->setRange(0, 1.0f);
xSliderPWMRate->setInverted(true);
xSliderPWMRate->setCallback(this); xSliderPWMRate->setCallback(this);
// default settings
xSliderSubMode->setValue(2.0f);
} }
void DistrhoUIAlphaOsc::parameterChanged(uint32_t index, float value) { 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) { void DistrhoUIAlphaOsc::imageSliderDragStarted(ImageSlider* slider) {
printf("dragstarted on %d\n", slider->getId());
editParameter(slider->getId(), true); editParameter(slider->getId(), true);
} }
void DistrhoUIAlphaOsc::imageSliderDragFinished(ImageSlider* slider) { void DistrhoUIAlphaOsc::imageSliderDragFinished(ImageSlider* slider) {
printf("dragfinished on %d\n", slider->getId());
editParameter(slider->getId(), false); editParameter(slider->getId(), false);
} }
void DistrhoUIAlphaOsc::imageSliderValueChanged(ImageSlider* slider, float value) { void DistrhoUIAlphaOsc::imageSliderValueChanged(ImageSlider* slider, float value) {
printf("%f\n", value);
printf("valuechanged on %d\n", slider->getId());
setParameterValue(slider->getId(), value); setParameterValue(slider->getId(), value);
} }