Browse Source

Minor fix for ResamplingAudioSource, minor addition to Slider.

tags/2021-05-28
jules 14 years ago
parent
commit
afcc66e449
3 changed files with 13 additions and 3 deletions
  1. +1
    -1
      modules/juce_audio_basics/sources/juce_ResamplingAudioSource.cpp
  2. +6
    -2
      modules/juce_gui_basics/widgets/juce_Slider.cpp
  3. +6
    -0
      modules/juce_gui_basics/widgets/juce_Slider.h

+ 1
- 1
modules/juce_audio_basics/sources/juce_ResamplingAudioSource.cpp View File

@@ -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;)


+ 6
- 2
modules/juce_gui_basics/widgets/juce_Slider.cpp View File

@@ -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()
{


+ 6
- 0
modules/juce_gui_basics/widgets/juce_Slider.h View File

@@ -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.


Loading…
Cancel
Save