forked from mltframework/shotcut
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscopecontroller.cpp
More file actions
64 lines (61 loc) · 2.75 KB
/
scopecontroller.cpp
File metadata and controls
64 lines (61 loc) · 2.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
* Copyright (c) 2015-2016 Meltytech, LLC
* Author: Brian Matherly <code@brianmatherly.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "scopecontroller.h"
#include "widgets/scopes/audioloudnessscopewidget.h"
#include "widgets/scopes/audiopeakmeterscopewidget.h"
#include "widgets/scopes/audiospectrumscopewidget.h"
#include "widgets/scopes/audiowaveformscopewidget.h"
#include "widgets/scopes/videohistogramscopewidget.h"
#include "widgets/scopes/videorgbparadescopewidget.h"
#include "widgets/scopes/videorgbwaveformscopewidget.h"
#include "widgets/scopes/videovectorscopewidget.h"
#include "widgets/scopes/videowaveformscopewidget.h"
#include "widgets/scopes/videozoomscopewidget.h"
#include "docks/scopedock.h"
#include "settings.h"
#include <Logger.h>
#include <QMainWindow>
#include <QMenu>
ScopeController::ScopeController(QMainWindow *mainWindow, QMenu *menu)
: QObject(mainWindow)
{
LOG_DEBUG() << "begin";
QMenu *scopeMenu = menu->addMenu(tr("Scopes"));
createScopeDock<AudioLoudnessScopeWidget>(mainWindow, scopeMenu);
createScopeDock<AudioPeakMeterScopeWidget>(mainWindow, scopeMenu);
createScopeDock<AudioSpectrumScopeWidget>(mainWindow, scopeMenu);
createScopeDock<AudioWaveformScopeWidget>(mainWindow, scopeMenu);
if (!Settings.playerGPU()) {
createScopeDock<VideoHistogramScopeWidget>(mainWindow, scopeMenu);
createScopeDock<VideoRgbParadeScopeWidget>(mainWindow, scopeMenu);
createScopeDock<VideoRgbWaveformScopeWidget>(mainWindow, scopeMenu);
createScopeDock<VideoVectorScopeWidget>(mainWindow, scopeMenu);
createScopeDock<VideoWaveformScopeWidget>(mainWindow, scopeMenu);
createScopeDock<VideoZoomScopeWidget>(mainWindow, scopeMenu);
}
LOG_DEBUG() << "end";
}
template<typename ScopeTYPE> void ScopeController::createScopeDock(QMainWindow *mainWindow,
QMenu *menu)
{
ScopeWidget *scopeWidget = new ScopeTYPE();
ScopeDock *scopeDock = new ScopeDock(this, scopeWidget);
scopeDock->hide();
menu->addAction(scopeDock->toggleViewAction());
mainWindow->addDockWidget(Qt::RightDockWidgetArea, scopeDock);
}