#pragma once #include #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) { if (wtLib != lib) { wtLib = lib; repaint(); } } void setWaveIndex (int index) { if (wave != index) { wave = index; repaint(); } } void setFramePosition (float pos) { if (wtPos != pos) { wtPos = pos; repaint(); } } void setEnabled (bool e) { if (enabled != e) { enabled = e; repaint(); } } void paint (juce::Graphics& g) override; private: const WavetableLibrary* wtLib = nullptr; int wave = 0; float wtPos = 0.0f; bool enabled = true; }; } // namespace serum