Have the DynamicsCompressorNode support multi-channel data
[WebKit-https.git] / Source / WebCore / platform / audio / DynamicsCompressorKernel.h
index cf319b3..da8e4c8 100644 (file)
 
 #include "AudioArray.h"
 
+#include <wtf/OwnPtr.h>
+#include <wtf/PassOwnPtr.h>
+
 namespace WebCore {
 
 class DynamicsCompressorKernel {
 public:
-    DynamicsCompressorKernel(float sampleRate);
+    DynamicsCompressorKernel(float sampleRate, unsigned numberOfChannels);
+
+    void setNumberOfChannels(unsigned);
 
     // Performs stereo-linked compression.
-    void process(const float *sourceL,
-                 float *destinationL,
-                 const float *sourceR,
-                 float *destinationR,
+    void process(float* sourceChannels[],
+                 float* destinationChannels[],
+                 unsigned numberOfChannels,
                  unsigned framesToProcess,
 
                  float dbThreshold,
@@ -66,7 +70,7 @@ public:
 
 protected:
     float m_sampleRate;
-    
+
     float m_detectorAverage;
     float m_compressorGain;
 
@@ -81,8 +85,7 @@ protected:
     unsigned m_lastPreDelayFrames;
     void setPreDelayTime(float);
 
-    AudioFloatArray m_preDelayBufferL;
-    AudioFloatArray m_preDelayBufferR;
+    Vector<OwnPtr<AudioFloatArray> > m_preDelayBuffers;
     int m_preDelayReadIndex;
     int m_preDelayWriteIndex;