From ea932294a2c681c43939e98a399f9249df1a4989 Mon Sep 17 00:00:00 2001 From: Joshua Valdez Date: Mon, 22 Jan 2024 14:05:38 -0800 Subject: [PATCH] reset plugin processor and editor --- plugin/include/PS1-Reverb/PluginEditor.h | 8 ++--- plugin/include/PS1-Reverb/PluginProcessor.h | 14 ++++---- plugin/source/PluginEditor.cpp | 6 ++-- plugin/source/PluginProcessor.cpp | 36 ++++++++++++--------- 4 files changed, 34 insertions(+), 30 deletions(-) diff --git a/plugin/include/PS1-Reverb/PluginEditor.h b/plugin/include/PS1-Reverb/PluginEditor.h index e0b41f2..8c9f511 100644 --- a/plugin/include/PS1-Reverb/PluginEditor.h +++ b/plugin/include/PS1-Reverb/PluginEditor.h @@ -6,17 +6,17 @@ namespace audio_plugin { class AudioPluginAudioProcessorEditor : public juce::AudioProcessorEditor { public: - explicit AudioPluginAudioProcessorEditor(AudioPluginAudioProcessor &); + explicit AudioPluginAudioProcessorEditor(AudioPluginAudioProcessor&); ~AudioPluginAudioProcessorEditor() override; - void paint(juce::Graphics &) override; + void paint(juce::Graphics&) override; void resized() override; private: // This reference is provided as a quick way for your editor to // access the processor object that created it. - AudioPluginAudioProcessor &processorRef; + AudioPluginAudioProcessor& processorRef; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(AudioPluginAudioProcessorEditor) }; -} // namespace audio_plugin \ No newline at end of file +} // namespace audio_plugin \ No newline at end of file diff --git a/plugin/include/PS1-Reverb/PluginProcessor.h b/plugin/include/PS1-Reverb/PluginProcessor.h index 32d5c6e..de38f90 100644 --- a/plugin/include/PS1-Reverb/PluginProcessor.h +++ b/plugin/include/PS1-Reverb/PluginProcessor.h @@ -11,12 +11,12 @@ class AudioPluginAudioProcessor : public juce::AudioProcessor { void prepareToPlay(double sampleRate, int samplesPerBlock) override; void releaseResources() override; - bool isBusesLayoutSupported(const BusesLayout &layouts) const override; + bool isBusesLayoutSupported(const BusesLayout& layouts) const override; - void processBlock(juce::AudioBuffer &, juce::MidiBuffer &) override; + void processBlock(juce::AudioBuffer&, juce::MidiBuffer&) override; using AudioProcessor::processBlock; - juce::AudioProcessorEditor *createEditor() override; + juce::AudioProcessorEditor* createEditor() override; bool hasEditor() const override; const juce::String getName() const override; @@ -30,12 +30,12 @@ class AudioPluginAudioProcessor : public juce::AudioProcessor { 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 changeProgramName(int index, const juce::String& newName) override; - void getStateInformation(juce::MemoryBlock &destData) override; - void setStateInformation(const void *data, int sizeInBytes) override; + void getStateInformation(juce::MemoryBlock& destData) override; + void setStateInformation(const void* data, int sizeInBytes) override; private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(AudioPluginAudioProcessor) }; -} // namespace audio_plugin \ No newline at end of file +} // namespace audio_plugin \ No newline at end of file diff --git a/plugin/source/PluginEditor.cpp b/plugin/source/PluginEditor.cpp index b543d45..8b74a5f 100644 --- a/plugin/source/PluginEditor.cpp +++ b/plugin/source/PluginEditor.cpp @@ -3,7 +3,7 @@ namespace audio_plugin { AudioPluginAudioProcessorEditor::AudioPluginAudioProcessorEditor( - AudioPluginAudioProcessor &p) + AudioPluginAudioProcessor& p) : AudioProcessorEditor(&p), processorRef(p) { juce::ignoreUnused(processorRef); // Make sure that before the constructor has finished, you've set the @@ -13,7 +13,7 @@ AudioPluginAudioProcessorEditor::AudioPluginAudioProcessorEditor( AudioPluginAudioProcessorEditor::~AudioPluginAudioProcessorEditor() {} -void AudioPluginAudioProcessorEditor::paint(juce::Graphics &g) { +void AudioPluginAudioProcessorEditor::paint(juce::Graphics& g) { // (Our component is opaque, so we must completely fill the background with a // solid colour) g.fillAll( @@ -29,4 +29,4 @@ void AudioPluginAudioProcessorEditor::resized() { // This is generally where you'll want to lay out the positions of any // subcomponents in your editor.. } -} // namespace audio_plugin \ No newline at end of file +} // namespace audio_plugin \ No newline at end of file diff --git a/plugin/source/PluginProcessor.cpp b/plugin/source/PluginProcessor.cpp index fd38438..ae33524 100644 --- a/plugin/source/PluginProcessor.cpp +++ b/plugin/source/PluginProcessor.cpp @@ -44,15 +44,19 @@ bool AudioPluginAudioProcessor::isMidiEffect() const { #endif } -double AudioPluginAudioProcessor::getTailLengthSeconds() const { return 0.0; } +double AudioPluginAudioProcessor::getTailLengthSeconds() const { + return 0.0; +} int AudioPluginAudioProcessor::getNumPrograms() { - return 1; // NB: some hosts don't cope very well if you tell them there are 0 - // programs, so this should be at least 1, even if you're not really - // implementing programs. + return 1; // NB: some hosts don't cope very well if you tell them there are 0 + // programs, so this should be at least 1, even if you're not + // really implementing programs. } -int AudioPluginAudioProcessor::getCurrentProgram() { return 0; } +int AudioPluginAudioProcessor::getCurrentProgram() { + return 0; +} void AudioPluginAudioProcessor::setCurrentProgram(int index) { juce::ignoreUnused(index); @@ -64,7 +68,7 @@ const juce::String AudioPluginAudioProcessor::getProgramName(int index) { } void AudioPluginAudioProcessor::changeProgramName(int index, - const juce::String &newName) { + const juce::String& newName) { juce::ignoreUnused(index, newName); } @@ -81,7 +85,7 @@ void AudioPluginAudioProcessor::releaseResources() { } bool AudioPluginAudioProcessor::isBusesLayoutSupported( - const BusesLayout &layouts) const { + const BusesLayout& layouts) const { #if JucePlugin_IsMidiEffect juce::ignoreUnused(layouts); return true; @@ -104,8 +108,8 @@ bool AudioPluginAudioProcessor::isBusesLayoutSupported( #endif } -void AudioPluginAudioProcessor::processBlock(juce::AudioBuffer &buffer, - juce::MidiBuffer &midiMessages) { +void AudioPluginAudioProcessor::processBlock(juce::AudioBuffer& buffer, + juce::MidiBuffer& midiMessages) { juce::ignoreUnused(midiMessages); juce::ScopedNoDenormals noDenormals; @@ -128,39 +132,39 @@ void AudioPluginAudioProcessor::processBlock(juce::AudioBuffer &buffer, // Alternatively, you can process the samples with the channels // interleaved by keeping the same state. for (int channel = 0; channel < totalNumInputChannels; ++channel) { - auto *channelData = buffer.getWritePointer(channel); + auto* channelData = buffer.getWritePointer(channel); juce::ignoreUnused(channelData); // ..do something to the data... } } bool AudioPluginAudioProcessor::hasEditor() const { - return true; // (change this to false if you choose to not supply an editor) + return true; // (change this to false if you choose to not supply an editor) } -juce::AudioProcessorEditor *AudioPluginAudioProcessor::createEditor() { +juce::AudioProcessorEditor* AudioPluginAudioProcessor::createEditor() { return new AudioPluginAudioProcessorEditor(*this); } void AudioPluginAudioProcessor::getStateInformation( - juce::MemoryBlock &destData) { + juce::MemoryBlock& destData) { // You should use this method to store your parameters in the memory block. // You could do that either as raw data, or use the XML or ValueTree classes // as intermediaries to make it easy to save and load complex data. juce::ignoreUnused(destData); } -void AudioPluginAudioProcessor::setStateInformation(const void *data, +void AudioPluginAudioProcessor::setStateInformation(const void* data, int sizeInBytes) { // You should use this method to restore your parameters from this memory // block, whose contents will have been created by the getStateInformation() // call. juce::ignoreUnused(data, sizeInBytes); } -} // namespace audio_plugin +} // namespace audio_plugin // This creates new instances of the plugin. // This function definition must be in the global namespace. -juce::AudioProcessor *JUCE_CALLTYPE createPluginFilter() { +juce::AudioProcessor* JUCE_CALLTYPE createPluginFilter() { return new audio_plugin::AudioPluginAudioProcessor(); } \ No newline at end of file