]> git.sesse.net Git - kdenlive/blob - src/lib/audio/audioCorrelationInfo.h
Audio alignment libraries moved to src/lib/audio/
[kdenlive] / src / lib / audio / audioCorrelationInfo.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 AUDIOCORRELATIONINFO_H
12 #define AUDIOCORRELATIONINFO_H
13
14 #include <QImage>
15
16 /**
17   This class holds the correlation of two audio samples.
18   It is mainly a container for data, the correlation itself is calculated
19   in the class AudioCorrelation.
20   */
21 class AudioCorrelationInfo
22 {
23 public:
24     AudioCorrelationInfo(int mainSize, int subSize);
25     ~AudioCorrelationInfo();
26
27     int size() const;
28     int64_t* correlationVector();
29     int64_t const* correlationVector() const;
30
31     int64_t max() const;
32     void setMax(int64_t max); ///< Can be set to avoid calculating the max again in this function
33
34     int maxIndex() const;
35
36     QImage toImage(int height = 400) const;
37
38 private:
39     int m_mainSize;
40     int m_subSize;
41
42     int64_t *m_correlationVector;
43     int64_t m_max;
44
45 };
46
47 #endif // AUDIOCORRELATIONINFO_H