feat(plugin): add plugin processor and editor
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
#pragma once
|
||||
|
||||
#include <JuceHeader.h>
|
||||
#include "Params.h"
|
||||
#include "Engine.h"
|
||||
#include "RAVEButton.h"
|
||||
|
||||
namespace serum
|
||||
{
|
||||
|
||||
// ===========================================================================
|
||||
// SerumAlt — a wavetable synthesiser (VST3 / AU). Hosts the APVTS, the audio
|
||||
// engine, preset management and the RAVE controller.
|
||||
// ===========================================================================
|
||||
class SerumAltAudioProcessor : public juce::AudioProcessor
|
||||
{
|
||||
public:
|
||||
SerumAltAudioProcessor();
|
||||
~SerumAltAudioProcessor() override;
|
||||
|
||||
// --- AudioProcessor ---
|
||||
void prepareToPlay (double sampleRate, int samplesPerBlock) override;
|
||||
void releaseResources() override;
|
||||
void processBlock (juce::AudioBuffer<float>&, juce::MidiBuffer&) override;
|
||||
|
||||
juce::AudioProcessorEditor* createEditor() override;
|
||||
bool hasEditor() const override { return true; }
|
||||
|
||||
const juce::String getName() const override { return "SerumAlt"; }
|
||||
bool acceptsMidi() const override { return true; }
|
||||
bool producesMidi() const override { return false; }
|
||||
bool isMidiEffect() const override { return false; }
|
||||
double getTailLengthSeconds() const override { return 2.0; }
|
||||
|
||||
int getNumPrograms() override;
|
||||
int getCurrentProgram() override;
|
||||
void setCurrentProgram (int index) override;
|
||||
const juce::String getProgramName (int index) override;
|
||||
void changeProgramName (int index, const juce::String& newName) override;
|
||||
|
||||
void getStateInformation (juce::MemoryBlock& destData) override;
|
||||
void setStateInformation (const void* data, int sizeInBytes) override;
|
||||
|
||||
// --- SerumAlt ---
|
||||
void setRaveEnabled (bool enabled);
|
||||
bool isRaveEnabled() const;
|
||||
|
||||
int getUiScaleIndex() const;
|
||||
void setUiScaleIndex (int index);
|
||||
float getUiScale() const;
|
||||
|
||||
void loadFactoryPreset (int index);
|
||||
int getNumFactoryPresets() const;
|
||||
|
||||
// Public DSP state (read/write from the GUI thread).
|
||||
juce::AudioProcessorValueTreeState parameters;
|
||||
Engine engine;
|
||||
RaveController rave;
|
||||
|
||||
static juce::AudioProcessorValueTreeState::ParameterLayout createParameterLayout();
|
||||
|
||||
private:
|
||||
int currentProgram = 0;
|
||||
|
||||
void restoreLfoShapesFromState (const juce::ValueTree& state);
|
||||
void saveLfoShapesToState (juce::ValueTree& state) const;
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (SerumAltAudioProcessor)
|
||||
};
|
||||
|
||||
} // namespace serum
|
||||
Reference in New Issue
Block a user