diff --git a/src/juce_appframework/audio/processors/juce_AudioProcessor.cpp b/src/juce_appframework/audio/processors/juce_AudioProcessor.cpp index 9459548c3f..859e9d86ef 100644 --- a/src/juce_appframework/audio/processors/juce_AudioProcessor.cpp +++ b/src/juce_appframework/audio/processors/juce_AudioProcessor.cpp @@ -203,6 +203,10 @@ void AudioProcessor::suspendProcessing (const bool shouldBeSuspended) suspended = shouldBeSuspended; } +void AudioProcessor::reset() +{ +} + //============================================================================== void AudioProcessor::editorBeingDeleted (AudioProcessorEditor* const editor) throw() { diff --git a/src/juce_appframework/audio/processors/juce_AudioProcessor.h b/src/juce_appframework/audio/processors/juce_AudioProcessor.h index 45dd745e3d..fbaaa88622 100644 --- a/src/juce_appframework/audio/processors/juce_AudioProcessor.h +++ b/src/juce_appframework/audio/processors/juce_AudioProcessor.h @@ -285,6 +285,13 @@ public: */ bool isSuspended() const throw() { return suspended; } + /** A plugin can override this to be told when it should reset any playing voices. + + The default implementation does nothing, but a host may call this to tell the + plugin that it should stop any tails or sounds that have been left running. + */ + virtual void reset(); + //============================================================================== /** Returns true if the processor is being run in an offline mode for rendering. diff --git a/src/juce_appframework/gui/components/special/juce_AudioDeviceSelectorComponent.cpp b/src/juce_appframework/gui/components/special/juce_AudioDeviceSelectorComponent.cpp index c2c0e92874..955c9215a5 100644 --- a/src/juce_appframework/gui/components/special/juce_AudioDeviceSelectorComponent.cpp +++ b/src/juce_appframework/gui/components/special/juce_AudioDeviceSelectorComponent.cpp @@ -277,10 +277,12 @@ public: if (outputDeviceDropDown != 0) { outputDeviceDropDown->setBounds (lx, y, w, h); - testButton->setBounds (proportionOfWidth (0.77f), - outputDeviceDropDown->getY(), - proportionOfWidth (0.18f), - h); + + if (testButton != 0) + testButton->setBounds (proportionOfWidth (0.77f), + outputDeviceDropDown->getY(), + proportionOfWidth (0.18f), + h); y += dh; } @@ -424,7 +426,7 @@ public: getTopLevelComponent()->toFront (true); } } - else if (button == testButton) + else if (button == testButton && testButton != 0) { setup.manager->playTestSound(); } @@ -463,8 +465,11 @@ public: : TRANS ("device:")); outputDeviceLabel->attachToComponent (outputDeviceDropDown, true); - addAndMakeVisible (testButton = new TextButton (TRANS ("Test"))); - testButton->addButtonListener (this); + if (setup.maxNumOutputChannels > 0) + { + addAndMakeVisible (testButton = new TextButton (TRANS ("Test"))); + testButton->addButtonListener (this); + } } addNamesToDeviceBox (*outputDeviceDropDown, false); @@ -646,7 +651,7 @@ private: box->setSelectedId (index + 1, true); - if (! isInput) + if (testButton != 0 && ! isInput) testButton->setEnabled (index >= 0); } }