#include "NonAutomatableSandboxTestProcessor.h" #include "NonAutomatableSandboxTestProcessorEditor.h" //============================================================================== NonAutomatableSandboxTestProcessor::NonAutomatableSandboxTestProcessor() #ifndef JucePlugin_PreferredChannelConfigurations : AudioProcessor (BusesProperties() #if ! JucePlugin_IsMidiEffect #if ! JucePlugin_IsSynth .withInput ("Input", juce::AudioChannelSet::stereo(), true) #endif .withOutput ("Output", juce::AudioChannelSet::stereo(), true) #endif ), valueTreeState(*this, nullptr, juce::Identifier("Tester"), { std::make_unique("testValue", "Test Value", juce::NormalisableRange{0.f, 1.f, 0.01f}, 0, "?"), }) #endif { testValueParam = valueTreeState.getParameter("testValue"); } NonAutomatableSandboxTestProcessor::~NonAutomatableSandboxTestProcessor() {} //============================================================================== const juce::String NonAutomatableSandboxTestProcessor::getName() const { return JucePlugin_Name; } bool NonAutomatableSandboxTestProcessor::acceptsMidi() const { #if JucePlugin_WantsMidiInput return true; #else return false; #endif } bool NonAutomatableSandboxTestProcessor::producesMidi() const { #if JucePlugin_ProducesMidiOutput return true; #else return false; #endif } bool NonAutomatableSandboxTestProcessor::isMidiEffect() const { #if JucePlugin_IsMidiEffect return true; #else return false; #endif } double NonAutomatableSandboxTestProcessor::getTailLengthSeconds() const { return 0.0; } int NonAutomatableSandboxTestProcessor::getNumPrograms() { return 1; } int NonAutomatableSandboxTestProcessor::getCurrentProgram() { return 0; } void NonAutomatableSandboxTestProcessor::setCurrentProgram (int index) {} const juce::String NonAutomatableSandboxTestProcessor::getProgramName (int index) { return {}; } void NonAutomatableSandboxTestProcessor::changeProgramName (int index, const juce::String& newName) {} //============================================================================== void NonAutomatableSandboxTestProcessor::prepareToPlay (double sampleRate, int samplesPerBlock) {} void NonAutomatableSandboxTestProcessor::releaseResources() { } #ifndef JucePlugin_PreferredChannelConfigurations bool NonAutomatableSandboxTestProcessor::isBusesLayoutSupported (const BusesLayout& layouts) const { #if JucePlugin_IsMidiEffect juce::ignoreUnused (layouts); return true; #else if (layouts.getMainOutputChannelSet() != juce::AudioChannelSet::mono() && layouts.getMainOutputChannelSet() != juce::AudioChannelSet::stereo()) return false; #if ! JucePlugin_IsSynth if (layouts.getMainOutputChannelSet() != layouts.getMainInputChannelSet()) return false; #endif return true; #endif } #endif void NonAutomatableSandboxTestProcessor::processBlock (juce::AudioBuffer& buffer, juce::MidiBuffer& midiMessages) { juce::ScopedNoDenormals noDenormals; auto totalNumInputChannels = getTotalNumInputChannels(); auto totalNumOutputChannels = getTotalNumOutputChannels(); for (auto i = totalNumInputChannels; i < totalNumOutputChannels; ++i) buffer.clear (i, 0, buffer.getNumSamples()); } //============================================================================== bool NonAutomatableSandboxTestProcessor::hasEditor() const { return true; } juce::AudioProcessorEditor* NonAutomatableSandboxTestProcessor::createEditor() { return new NonAutomatableSandboxTestProcessorEditor (*this, valueTreeState); } //============================================================================== void NonAutomatableSandboxTestProcessor::getStateInformation (juce::MemoryBlock& destData) {} void NonAutomatableSandboxTestProcessor::setStateInformation (const void* data, int sizeInBytes) {} //============================================================================== juce::AudioProcessor* JUCE_CALLTYPE createPluginFilter() { return new NonAutomatableSandboxTestProcessor(); }