CuteLogger
Fast and simple logging solution for Qt based applications
audioloudnessscopewidget.h
1 /*
2  * Copyright (c) 2016-2017 Meltytech, LLC
3  * Author: Brian Matherly <code@brianmatherly.com>
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 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef AUDIOLOUDNESSSCOPEWIDGET_H
20 #define AUDIOLOUDNESSSCOPEWIDGET_H
21 
22 #include "scopewidget.h"
23 #include <QMutex>
24 #include <QImage>
25 #include <QVector>
26 #include <MltFilter.h>
27 
28 class QQuickWidget;
29 class QLabel;
30 class QTimer;
31 
32 class AudioLoudnessScopeWidget Q_DECL_FINAL : public ScopeWidget
33 {
34  Q_OBJECT
35 
36 public:
37  explicit AudioLoudnessScopeWidget();
38  ~AudioLoudnessScopeWidget();
39  QString getTitle() Q_DECL_OVERRIDE;
40  void setOrientation(Qt::Orientation orientation) Q_DECL_OVERRIDE;
41 
42 protected:
43  bool event(QEvent *event) Q_DECL_OVERRIDE;
44 
45 private slots:
46  void resetQview();
47  void onResetButtonClicked();
48  void onIntegratedToggled(bool checked);
49  void onShorttermToggled(bool checked);
50  void onMomentaryToggled(bool checked);
51  void onRangeToggled(bool checked);
52  void onPeakToggled(bool checked);
53  void onTruePeakToggled(bool checked);
54  void updateMeters(void);
55 
56 private:
57  // Functions run in scope thread.
58  void refreshScope(const QSize& size, bool full) Q_DECL_OVERRIDE;
59 
60  // Members accessed by scope thread.
61  Mlt::Filter* m_loudnessFilter;
62  double m_peak;
63  double m_true_peak;
64  bool m_newData;
65 
66  // Members accessed by GUI thread.
67  Qt::Orientation m_orientation;
68  QQuickWidget* m_qview;
69  QLabel* m_timeLabel;
70  QTimer* m_timer;
71 };
72 
73 #endif // AUDIOLOUDNESSSCOPEWIDGET_H
The ScopeWidget provides a common interface for all scopes in Shotcut.
Definition: scopewidget.h:57
virtual QString getTitle()=0