]> git.sesse.net Git - kdenlive/blobdiff - src/lib/audio/audioCorrelation.h
Use QLatin1String
[kdenlive] / src / lib / audio / audioCorrelation.h
index 1f943687c568a74425d8d551b4943e830e407737..3c8527b2b075e4e9c8b79f348b584d9895507e01 100644 (file)
@@ -15,7 +15,6 @@
 #include "audioEnvelope.h"
 #include <QList>
 
-class AudioCorrelationInfo;
 
 /**
   This class does the correlation between two tracks
@@ -27,16 +26,27 @@ class AudioCorrelationInfo;
 class AudioCorrelation
 {
 public:
+    /// AudioCorrelation will take ownership of mainTrackEnvelope
     AudioCorrelation(AudioEnvelope *mainTrackEnvelope);
     ~AudioCorrelation();
 
-    /// \return The child's index
-    int addChild(AudioEnvelope *envelope);
+    /**
+      This object will take ownership of the passed envelope.
+      \return The child's index
+      */
+    int addChild(AudioEnvelope *envelope, bool useFFT = false);
 
     const AudioCorrelationInfo *info(int childIndex) const;
     int getShift(int childIndex) const;
 
-
+    /**
+      Correlates the two vectors envMain and envSub.
+      \c correlation must be a pre-allocated vector of size sizeMain+sizeSub+1.
+      */
+    static void correlate(const int64_t *envMain, int sizeMain,
+                          const int64_t *envSub, int sizeSub,
+                          int64_t *correlation,
+                          int64_t *out_max = NULL);
 private:
     AudioEnvelope *m_mainTrackEnvelope;