diff --git a/extras/audio plugin demo/Source/PluginEditor.cpp b/extras/audio plugin demo/Source/PluginEditor.cpp index bde4ae19c7..0ee9b1908f 100644 --- a/extras/audio plugin demo/Source/PluginEditor.cpp +++ b/extras/audio plugin demo/Source/PluginEditor.cpp @@ -64,7 +64,8 @@ JuceDemoPluginAudioProcessorEditor::~JuceDemoPluginAudioProcessorEditor() //============================================================================== void JuceDemoPluginAudioProcessorEditor::paint (Graphics& g) { - g.setGradientFill (ColourGradient (Colours::white, 0, 0, Colours::grey, 0, (float) getHeight(), false)); + g.setGradientFill (ColourGradient (Colours::white, 0, 0, + Colours::grey, 0, (float) getHeight(), false)); g.fillAll(); } diff --git a/extras/audio plugin demo/Source/PluginEditor.h b/extras/audio plugin demo/Source/PluginEditor.h index a6efa2f59b..03808b9997 100644 --- a/extras/audio plugin demo/Source/PluginEditor.h +++ b/extras/audio plugin demo/Source/PluginEditor.h @@ -27,16 +27,15 @@ public: ~JuceDemoPluginAudioProcessorEditor(); //============================================================================== - void timerCallback(); - void paint (Graphics& g); - void resized(); - void sliderValueChanged (Slider*); + void timerCallback() override; + void paint (Graphics&) override; + void resized() override; + void sliderValueChanged (Slider*) override; private: MidiKeyboardComponent midiKeyboard; Label infoLabel, gainLabel, delayLabel; - Slider gainSlider; - Slider delaySlider; + Slider gainSlider, delaySlider; ScopedPointer resizer; ComponentBoundsConstrainer resizeLimits; diff --git a/extras/audio plugin demo/Source/PluginProcessor.cpp b/extras/audio plugin demo/Source/PluginProcessor.cpp index fabd7b73ae..664a21cc9b 100644 --- a/extras/audio plugin demo/Source/PluginProcessor.cpp +++ b/extras/audio plugin demo/Source/PluginProcessor.cpp @@ -131,14 +131,16 @@ private: double currentAngle, angleDelta, level, tailOff; }; +const float defaultGain = 1.0f; +const float defaultDelay = 0.5f; //============================================================================== JuceDemoPluginAudioProcessor::JuceDemoPluginAudioProcessor() : delayBuffer (2, 12000) { // Set up some default values.. - gain = 1.0f; - delay = 0.5f; + gain = defaultGain; + delay = defaultDelay; lastUIWidth = 400; lastUIHeight = 200; @@ -189,6 +191,18 @@ void JuceDemoPluginAudioProcessor::setParameter (int index, float newValue) } } +float JuceDemoPluginAudioProcessor::getParameterDefaultValue (int index) +{ + switch (index) + { + case gainParam: return defaultGain; + case delayParam: return defaultDelay; + default: break; + } + + return 0.0f; +} + const String JuceDemoPluginAudioProcessor::getParameterName (int index) { switch (index) diff --git a/extras/audio plugin demo/Source/PluginProcessor.h b/extras/audio plugin demo/Source/PluginProcessor.h index 3a4cf0d258..f8190476b2 100644 --- a/extras/audio plugin demo/Source/PluginProcessor.h +++ b/extras/audio plugin demo/Source/PluginProcessor.h @@ -16,6 +16,7 @@ //============================================================================== /** + As the name suggest, this class does the actual audio processing. */ class JuceDemoPluginAudioProcessor : public AudioProcessor { @@ -25,44 +26,45 @@ public: ~JuceDemoPluginAudioProcessor(); //============================================================================== - void prepareToPlay (double sampleRate, int samplesPerBlock); - void releaseResources(); - void processBlock (AudioSampleBuffer& buffer, MidiBuffer& midiMessages); - void reset(); + void prepareToPlay (double sampleRate, int samplesPerBlock) override; + void releaseResources() override; + void processBlock (AudioSampleBuffer& buffer, MidiBuffer& midiMessages) override; + void reset() override; //============================================================================== - bool hasEditor() const { return true; } - AudioProcessorEditor* createEditor(); + bool hasEditor() const override { return true; } + AudioProcessorEditor* createEditor() override; //============================================================================== - const String getName() const { return JucePlugin_Name; } + const String getName() const override { return JucePlugin_Name; } - int getNumParameters(); - float getParameter (int index); - void setParameter (int index, float newValue); - const String getParameterName (int index); - const String getParameterText (int index); + int getNumParameters() override; + float getParameter (int index) override; + float getParameterDefaultValue (int index) override; + void setParameter (int index, float newValue) override; + const String getParameterName (int index) override; + const String getParameterText (int index) override; - const String getInputChannelName (int channelIndex) const; - const String getOutputChannelName (int channelIndex) const; - bool isInputChannelStereoPair (int index) const; - bool isOutputChannelStereoPair (int index) const; + const String getInputChannelName (int channelIndex) const override; + const String getOutputChannelName (int channelIndex) const override; + bool isInputChannelStereoPair (int index) const override; + bool isOutputChannelStereoPair (int index) const override; - bool acceptsMidi() const; - bool producesMidi() const; - bool silenceInProducesSilenceOut() const; - double getTailLengthSeconds() const; + bool acceptsMidi() const override; + bool producesMidi() const override; + bool silenceInProducesSilenceOut() const override; + double getTailLengthSeconds() const override; //============================================================================== - int getNumPrograms() { return 0; } - int getCurrentProgram() { return 0; } - void setCurrentProgram (int /*index*/) { } - const String getProgramName (int /*index*/) { return String::empty; } - void changeProgramName (int /*index*/, const String& /*newName*/) { } + int getNumPrograms() override { return 0; } + int getCurrentProgram() override { return 0; } + void setCurrentProgram (int /*index*/) override {} + const String getProgramName (int /*index*/) override { return String::empty; } + void changeProgramName (int /*index*/, const String& /*newName*/) override {} //============================================================================== - void getStateInformation (MemoryBlock& destData); - void setStateInformation (const void* data, int sizeInBytes); + void getStateInformation (MemoryBlock& destData) override; + void setStateInformation (const void* data, int sizeInBytes) override; //============================================================================== // These properties are public so that our editor component can access them