mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
DelayLine: Allow setting a new maximum delay time after construction
This commit is contained in:
parent
c41f64111f
commit
7b64bd7406
2 changed files with 19 additions and 1 deletions
|
|
@ -40,8 +40,9 @@ DelayLine<SampleType, InterpolationType>::DelayLine (int maximumDelayInSamples)
|
|||
{
|
||||
jassert (maximumDelayInSamples >= 0);
|
||||
|
||||
totalSize = jmax (4, maximumDelayInSamples + 1);
|
||||
sampleRate = 44100.0;
|
||||
|
||||
setMaximumDelayInSamples (maximumDelayInSamples);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
|
@ -81,6 +82,15 @@ void DelayLine<SampleType, InterpolationType>::prepare (const ProcessSpec& spec)
|
|||
reset();
|
||||
}
|
||||
|
||||
template <typename SampleType, typename InterpolationType>
|
||||
void DelayLine<SampleType, InterpolationType>::setMaximumDelayInSamples (int maxDelayInSamples)
|
||||
{
|
||||
jassert (maxDelayInSamples >= 0);
|
||||
totalSize = jmax (4, maxDelayInSamples + 1);
|
||||
bufferData.setSize ((int) bufferData.getNumChannels(), totalSize, false, false, true);
|
||||
reset();
|
||||
}
|
||||
|
||||
template <typename SampleType, typename InterpolationType>
|
||||
void DelayLine<SampleType, InterpolationType>::reset()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue