feat(gui): add GUI components and displays
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
#include <JuceHeader.h>
|
||||
#include "../Resources.h"
|
||||
#include "../Wavetable.h"
|
||||
|
||||
namespace serum
|
||||
{
|
||||
|
||||
// ===========================================================================
|
||||
// Single-cycle wavetable view (morphs with the WT position knob).
|
||||
// ===========================================================================
|
||||
class WaveformDisplay : public juce::Component
|
||||
{
|
||||
public:
|
||||
void setWavetables (const WavetableLibrary* lib) { wtLib = lib; }
|
||||
void setWaveIndex (int index) { wave = index; }
|
||||
void setFramePosition (float pos) { wtPos = pos; }
|
||||
void setEnabled (bool e) { enabled = e; }
|
||||
|
||||
void paint (juce::Graphics& g) override;
|
||||
|
||||
private:
|
||||
const WavetableLibrary* wtLib = nullptr;
|
||||
int wave = 0;
|
||||
float wtPos = 0.0f;
|
||||
bool enabled = true;
|
||||
};
|
||||
|
||||
} // namespace serum
|
||||
Reference in New Issue
Block a user