]> git.sesse.net Git - kdenlive/blob - src/audioscopes/audiospectrum.h
Made AbstractAudioScope and AbstractGfxScope inherit from AbstractScope; Done for...
[kdenlive] / src / audioscopes / audiospectrum.h
1 /***************************************************************************
2  *   Copyright (C) 2010 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 AUDIOSPECTRUM_H
12 #define AUDIOSPECTRUM_H
13
14 #include <QtCore>
15
16 #include "abstractaudioscopewidget.h"
17 #include "ui_audiospectrum_ui.h"
18 #include "tools/kiss_fftr.h"
19
20 class AudioSpectrum_UI;
21
22 class AudioSpectrum : public AbstractAudioScopeWidget {
23     Q_OBJECT
24
25 public:
26     AudioSpectrum(Monitor *projMonitor, Monitor *clipMonitor, QWidget *parent = 0);
27     ~AudioSpectrum();
28
29     // Implemented virtual methods
30     QString widgetName() const;
31
32 protected:
33     ///// Implemented methods /////
34     QRect scopeRect();
35     QImage renderHUD(uint accelerationFactor);
36     QImage renderAudioScope(uint accelerationFactor, const QVector<int16_t> audioFrame, const int freq, const int num_channels, const int num_samples);
37     QImage renderBackground(uint accelerationFactor);
38     bool isHUDDependingOnInput() const;
39     bool isScopeDependingOnInput() const;
40     bool isBackgroundDependingOnInput() const;
41     virtual void readConfig();
42     void writeConfig();
43
44 private:
45     Ui::AudioSpectrum_UI *ui;
46     kiss_fftr_cfg m_cfg;
47
48     QAction *m_aLin;
49     QAction *m_aLog;
50     QActionGroup *m_agScale;
51
52     QSize m_distance;
53
54     /** Lower bound for the dB value to display */
55     int m_dBmin;
56     /** Upper bound (max: 0) */
57     int m_dBmax;
58
59     uint m_freqMax;
60
61 private slots:
62     void slotUpdateCfg();
63
64 };
65
66 #endif // AUDIOSPECTRUM_H