peacock/plugin/ui.hpp

77 lines
2.4 KiB
C++

/*
Peacock-8 VA polysynth
Copyright 2025 Gordon JC Pearce <gordonjcp@gjcp.net>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef _UI_HPP
#define _UI_HPP
#include "DistrhoUI.hpp"
#include "ImageWidgets.hpp"
#include "artwork.hpp"
START_NAMESPACE_DISTRHO
class DistrhoUIPeacock : public UI,
public ImageSlider::Callback,
public ImageButton::Callback {
public:
DistrhoUIPeacock();
~DistrhoUIPeacock() override;
protected:
void parameterChanged(uint32_t index, float value) override;
//void programLoaded(uint32_t index) override;
void onDisplay() override;
void imageSliderDragStarted(ImageSlider* slider) override;
void imageSliderDragFinished(ImageSlider* slider) override;
void imageSliderValueChanged(ImageSlider* slider, float value) override;
void imageButtonClicked(ImageButton *imageButton, int button) override;
private:
Image fImgBackground;
Image fImgLedOn;
ScopedPointer<ImageSlider>
xSliderLFORate, xSliderLFODelay,
xSliderLFODepth, xSliderPWMDepth, xSliderSubLevel, xSliderNoiseLevel,
xSliderHPF, xSliderCutoff, xSliderRes, xSliderEnv, xSliderLfo, xSliderKyb,
xSliderVCALevel, xSliderAtk, xSliderDcy, xSliderStn, xSliderRls,
xSwitchPWM, xSwitchEnv, xSwitchVCA;
ScopedPointer<ImageButton> xBtn16ft, xBtn8ft, xBtn4ft, xBtnPls, xBtnSaw, xBtnCh0, xBtnCh1, xBtnCh2;
uint8_t sw1 = 0, sw2 = 0;
enum Buttons {
btn16 = parameterCount+1,
btn8,
btn4,
btnPls,
btnSaw,
btnCh0,
btnCh1,
btnCh2
};
DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(DistrhoUIPeacock)
// ImageAboutWindow fAboutWindow;
};
END_NAMESPACE_DISTRHO
#endif