]> git.sesse.net Git - kdenlive/blob - testingArea/audioEnvelope.h
Audio envelope calculation extracted into own class, mean and standard deviation...
[kdenlive] / testingArea / audioEnvelope.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 AUDIOENVELOPE_H
12 #define AUDIOENVELOPE_H
13
14 #include "audioInfo.h"
15 #include <mlt++/Mlt.h>
16
17 class QImage;
18 class AudioEnvelope
19 {
20 public:
21     AudioEnvelope(Mlt::Producer *producer);
22     ~AudioEnvelope();
23
24     void loadEnvelope();
25     int64_t loadStdDev();
26
27     QImage drawEnvelope();
28
29     void dumpInfo() const;
30
31 private:
32     uint64_t *m_envelope;
33     Mlt::Producer *m_producer;
34     AudioInfo *m_info;
35
36     int m_envelopeSize;
37     uint64_t m_envelopeMax;
38     uint64_t m_envelopeMean;
39     uint64_t m_envelopeStdDev;
40
41     bool m_envelopeStdDevCalculated;
42 };
43
44 #endif // AUDIOENVELOPE_H