mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
DelayLine: Add function to retrieve the maximum possible delay time
This commit is contained in:
parent
4c95897ad3
commit
fad3490946
2 changed files with 8 additions and 1 deletions
|
|
@ -49,7 +49,7 @@ DelayLine<SampleType, InterpolationType>::DelayLine (int maximumDelayInSamples)
|
|||
template <typename SampleType, typename InterpolationType>
|
||||
void DelayLine<SampleType, InterpolationType>::setDelay (SampleType newDelayInSamples)
|
||||
{
|
||||
auto upperLimit = (SampleType) (totalSize - 1);
|
||||
auto upperLimit = (SampleType) getMaximumDelayInSamples();
|
||||
jassert (isPositiveAndNotGreaterThan (newDelayInSamples, upperLimit));
|
||||
|
||||
delay = jlimit ((SampleType) 0, upperLimit, newDelayInSamples);
|
||||
|
|
|
|||
|
|
@ -120,6 +120,13 @@ public:
|
|||
*/
|
||||
void setMaximumDelayInSamples (int maxDelayInSamples);
|
||||
|
||||
/** Gets the maximum possible delay in samples.
|
||||
|
||||
For very short delay times, the result of getMaximumDelayInSamples() may
|
||||
differ from the last value passed to setMaximumDelayInSamples().
|
||||
*/
|
||||
int getMaximumDelayInSamples() const noexcept { return totalSize - 1; }
|
||||
|
||||
/** Resets the internal state variables of the processor. */
|
||||
void reset();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue