]> git.sesse.net Git - kdenlive/blob - src/lib/audio/audioCorrelation.h
QString::toStdString() replaced by QString::toLocal8Bit() as KDE4
[kdenlive] / src / lib / audio / audioCorrelation.h
1 /***************************************************************************
2  *   Copyright (C) 2012 by Simon Andreas Eugster (simon.eu@gmail.com)      *
3  *   This file is part of kdenlive. See www.kdenlive.org.                  *
4  *                                                                         *
5  *   This program is free software; you can redistribute it and/or modify  *
6  *   it under the terms of the GNU General Public License as published by  *
7  *   the Free Software Foundation; either version 2 of the License, or     *
8  *   (at your option) any later version.                                   *
9  ***************************************************************************/
10
11 #ifndef AUDIOCORRELATION_H
12 #define AUDIOCORRELATION_H
13
14 #include "audioCorrelationInfo.h"
15 #include "audioEnvelope.h"
16 #include <QList>
17
18 class AudioCorrelationInfo;
19
20 /**
21   This class does the correlation between two tracks
22   in order to synchronize (align) them.
23
24   It uses one main track (used in the initializer); further tracks will be
25   aligned relative to this main track.
26   */
27 class AudioCorrelation
28 {
29 public:
30     /// AudioCorrelation will take ownership of mainTrackEnvelope
31     AudioCorrelation(AudioEnvelope *mainTrackEnvelope);
32     ~AudioCorrelation();
33
34     /**
35       This object will take ownership of the passed envelope.
36       \return The child's index
37       */
38     int addChild(AudioEnvelope *envelope);
39
40     const AudioCorrelationInfo *info(int childIndex) const;
41     int getShift(int childIndex) const;
42
43
44 private:
45     AudioEnvelope *m_mainTrackEnvelope;
46
47     QList<AudioEnvelope*> m_children;
48     QList<AudioCorrelationInfo*> m_correlations;
49 };
50
51 #endif // AUDIOCORRELATION_H