CuteLogger
Fast and simple logging solution for Qt based applications
audiowaveformscopewidget.h
1 /*
2  * Copyright (c) 2015-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 AUDIOWAVEFORMSCOPEWIDGET_H
20 #define AUDIOWAVEFORMSCOPEWIDGET_H
21 
22 #include "scopewidget.h"
23 #include <QMutex>
24 #include <QImage>
25 #include <QTime>
26 
27 class AudioWaveformScopeWidget Q_DECL_FINAL : public ScopeWidget
28 {
29  Q_OBJECT
30 
31 public:
32  explicit AudioWaveformScopeWidget();
33  ~AudioWaveformScopeWidget();
34  QString getTitle() Q_DECL_OVERRIDE;
35 
36 private:
37  // Functions run in scope thread.
38  void refreshScope(const QSize& size, bool full) Q_DECL_OVERRIDE;
39  void createGrid(const QSize& size);
40 
41  // Functions run in GUI thread.
42  void paintEvent(QPaintEvent*) Q_DECL_OVERRIDE;
43 
44  // Members accessed only in scope thread (no thread protection).
45  SharedFrame m_frame;
46  QImage m_renderWave;
47  QTime m_refreshTime;
48  int m_graphTopPadding;
49  int m_graphLeftPadding;
50  int m_channels;
51 
52  // Members accessed in multiple threads (mutex protected).
53  QMutex m_mutex;
54  QImage m_displayWave;
55  QImage m_displayGrid;
56 };
57 
58 #endif // AUDIOWAVEFORMSCOPEWIDGET_H
The ScopeWidget provides a common interface for all scopes in Shotcut.
Definition: scopewidget.h:57
The SharedFrame provides thread safe access to Mlt::Frame data.
Definition: sharedframe.h:48
virtual QString getTitle()=0