1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Minor fix for ResamplingAudioSource, minor addition to Slider.

This commit is contained in:
jules 2011-10-25 11:31:33 +01:00
parent 5567e16566
commit afcc66e449
3 changed files with 13 additions and 3 deletions

View file

@ -169,7 +169,7 @@ void ResamplingAudioSource::getNextAudioBlock (const AudioSourceChannelInfo& inf
for (int i = channelsToProcess; --i >= 0;) for (int i = channelsToProcess; --i >= 0;)
applyFilter (info.buffer->getSampleData (i, info.startSample), info.numSamples, filterStates[i]); 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 // 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;) for (int i = channelsToProcess; --i >= 0;)

View file

@ -296,13 +296,17 @@ void Slider::setSliderSnapsToMousePosition (const bool shouldSnapToMouse)
snapsToMousePos = shouldSnapToMouse; snapsToMousePos = shouldSnapToMouse;
} }
void Slider::setPopupDisplayEnabled (const bool enabled, void Slider::setPopupDisplayEnabled (const bool enabled, Component* const parentComponentToUse)
Component* const parentComponentToUse)
{ {
popupDisplayEnabled = enabled; popupDisplayEnabled = enabled;
parentForPopupDisplay = parentComponentToUse; parentForPopupDisplay = parentComponentToUse;
} }
Component* Slider::getCurrentPopupDisplay() const noexcept
{
return popupDisplay.get();
}
//============================================================================== //==============================================================================
void Slider::colourChanged() void Slider::colourChanged()
{ {

View file

@ -607,6 +607,12 @@ public:
void setPopupDisplayEnabled (bool isEnabled, void setPopupDisplayEnabled (bool isEnabled,
Component* parentComponentToUse); 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 /** 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. a menu to let the user change the way it works.