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
24#include <MltFilter.h>
25#include <QImage>
26#include <QMutex>
27#include <QVector>
28
29class QQuickWidget;
30class QLabel;
31class QTimer;
32
33class AudioLoudnessScopeWidget Q_DECL_FINAL : public ScopeWidget
34{
35 Q_OBJECT
36
37public:
38 explicit AudioLoudnessScopeWidget();
39 ~AudioLoudnessScopeWidget();
40 QString getTitle() Q_DECL_OVERRIDE;
41 void setOrientation(Qt::Orientation orientation) Q_DECL_OVERRIDE;
42 void setOrientation(Qt::Orientation orientation, bool force);
43
44protected:
45 bool event(QEvent *event) Q_DECL_OVERRIDE;
46
47private slots:
48 void resetQview();
49 void onResetButtonClicked();
50 void onIntegratedToggled(bool checked);
51 void onShorttermToggled(bool checked);
52 void onMomentaryToggled(bool checked);
53 void onRangeToggled(bool checked);
54 void onPeakToggled(bool checked);
55 void onTruePeakToggled(bool checked);
56 void updateMeters(void);
57
58private:
59 // Functions run in scope thread.
60 void refreshScope(const QSize &size, bool full) Q_DECL_OVERRIDE;
61
62 // Members accessed by scope thread.
63 Mlt::Filter *m_loudnessFilter;
64 double m_peak;
65 double m_true_peak;
66 bool m_newData;
67
68 // Members accessed by GUI thread.
69 Qt::Orientation m_orientation;
70 QQuickWidget *m_qview;
71 QLabel *m_timeLabel;
72 QTimer *m_timer;
73};
74
75#endif // AUDIOLOUDNESSSCOPEWIDGET_H
The ScopeWidget provides a common interface for all scopes in Shotcut.
Definition scopewidget.h:58
virtual QString getTitle()=0