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