diff --git a/modules/juce_audio_basics/sources/juce_ResamplingAudioSource.cpp b/modules/juce_audio_basics/sources/juce_ResamplingAudioSource.cpp index 46c6cc9ba0..e8b9671bea 100644 --- a/modules/juce_audio_basics/sources/juce_ResamplingAudioSource.cpp +++ b/modules/juce_audio_basics/sources/juce_ResamplingAudioSource.cpp @@ -169,7 +169,7 @@ void ResamplingAudioSource::getNextAudioBlock (const AudioSourceChannelInfo& inf for (int i = channelsToProcess; --i >= 0;) applyFilter (info.buffer->getSampleData (i, info.startSample), info.numSamples, filterStates[i]); } - else if (localRatio <= 1.0001) + else if (localRatio <= 1.0001 && info.numSamples > 0) { // if the filter's not currently being applied, keep it stoked with the last couple of samples to avoid discontinuities for (int i = channelsToProcess; --i >= 0;) diff --git a/modules/juce_gui_basics/widgets/juce_Slider.cpp b/modules/juce_gui_basics/widgets/juce_Slider.cpp index ac8baf268f..9aa7a693f9 100644 --- a/modules/juce_gui_basics/widgets/juce_Slider.cpp +++ b/modules/juce_gui_basics/widgets/juce_Slider.cpp @@ -296,13 +296,17 @@ void Slider::setSliderSnapsToMousePosition (const bool shouldSnapToMouse) snapsToMousePos = shouldSnapToMouse; } -void Slider::setPopupDisplayEnabled (const bool enabled, - Component* const parentComponentToUse) +void Slider::setPopupDisplayEnabled (const bool enabled, Component* const parentComponentToUse) { popupDisplayEnabled = enabled; parentForPopupDisplay = parentComponentToUse; } +Component* Slider::getCurrentPopupDisplay() const noexcept +{ + return popupDisplay.get(); +} + //============================================================================== void Slider::colourChanged() { diff --git a/modules/juce_gui_basics/widgets/juce_Slider.h b/modules/juce_gui_basics/widgets/juce_Slider.h index 4ce1b5fd31..43a24ab132 100644 --- a/modules/juce_gui_basics/widgets/juce_Slider.h +++ b/modules/juce_gui_basics/widgets/juce_Slider.h @@ -607,6 +607,12 @@ public: void setPopupDisplayEnabled (bool isEnabled, Component* parentComponentToUse); + /** If a popup display is enabled and is currently visible, this returns the component + that is being shown, or nullptr if none is currently in use. + @see setPopupDisplayEnabled + */ + Component* getCurrentPopupDisplay() const noexcept; + /** If this is set to true, then right-clicking on the slider will pop-up a menu to let the user change the way it works.