diff audioio/PhaseVocoderTimeStretcher.h @ 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 a2ad974b0c8c
children d88d117e0c34
line wrap: on
line diff
--- a/audioio/PhaseVocoderTimeStretcher.h	Fri Sep 15 13:50:22 2006 +0000
+++ b/audioio/PhaseVocoderTimeStretcher.h	Fri Sep 15 15:35:06 2006 +0000
@@ -21,6 +21,8 @@
 
 #include <fftw3.h>
 
+#include <QMutex>
+
 /**
  * A time stretcher that alters the performance speed of audio,
  * preserving pitch.
@@ -87,6 +89,11 @@
     //!!! and reset?
 
     /**
+     * Change the time stretch ratio.
+     */
+    void setRatio(float ratio);
+
+    /**
      * Get the hop size for input.
      */
     size_t getInputIncrement() const { return m_n1; }
@@ -141,8 +148,13 @@
     void synthesiseBlock(size_t channel, float *out, float *modulation,
                          size_t lastStep);
 
+    void initialise();
+    void calculateParameters();
+    void cleanup();
+
     size_t m_sampleRate;
     size_t m_channels;
+    size_t m_maxProcessInputBlockSize;
     float m_ratio;
     bool m_sharpen;
     size_t m_n1;
@@ -173,6 +185,8 @@
     RingBuffer<float> **m_outbuf;
     float **m_mashbuf;
     float *m_modulationbuf;
+
+    QMutex *m_mutex;
 };
 
 #endif