Mercurial > hg > sonic-visualiser
diff audioio/AudioCallbackPlaySource.cpp @ 25:e74f508db18c
* Add setRatio method to the time stretcher, and make it possible to change
  the ratio without having to construct and replace the time stretcher.  This
  means we can do it seamlessly.  Add a lot more ratios to the
  time stretch control in the main window
| author | Chris Cannam | 
|---|---|
| date | Fri, 15 Sep 2006 15:35:06 +0000 | 
| parents | 80126455d169 | 
| children | d88d117e0c34 | 
line wrap: on
 line diff
--- a/audioio/AudioCallbackPlaySource.cpp Fri Sep 15 13:50:22 2006 +0000 +++ b/audioio/AudioCallbackPlaySource.cpp Fri Sep 15 15:35:06 2006 +0000 @@ -602,6 +602,13 @@ } if (factor != 1) { + + if (existingStretcher && + existingStretcher->getSharpening() == sharpen) { + existingStretcher->setRatio(factor); + return; + } + PhaseVocoderTimeStretcher *newStretcher = new PhaseVocoderTimeStretcher (getTargetSampleRate(), getTargetChannelCount(),
