]> git.sesse.net Git - kdenlive/blob - src/scopes/colorscopes/abstractgfxscopewidget.cpp
Fix includes
[kdenlive] / src / scopes / colorscopes / abstractgfxscopewidget.cpp
1 /***************************************************************************
2  *   Copyright (C) 2010 by Simon Andreas Eugster (simon.eu@gmail.com)      *
3  *   This file is part of kdenlive. See www.kdenlive.org.                  *
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 2 of the License, or     *
8  *   (at your option) any later version.                                   *
9  ***************************************************************************/
10
11 #include "abstractgfxscopewidget.h"
12 #include "renderer.h"
13 #include "monitormanager.h"
14
15 #include <QMouseEvent>
16
17 // Uncomment for debugging.
18 //#define DEBUG_AGSW
19
20 #ifdef DEBUG_AGSW
21 #endif
22
23 const int REALTIME_FPS = 30;
24
25 AbstractGfxScopeWidget::AbstractGfxScopeWidget(bool trackMouse, QWidget *parent) :
26         AbstractScopeWidget(trackMouse, parent)
27 {
28 }
29
30 AbstractGfxScopeWidget::~AbstractGfxScopeWidget() { }
31
32 QImage AbstractGfxScopeWidget::renderScope(uint accelerationFactor)
33 {
34     QMutexLocker lock(&m_mutex);
35     return renderGfxScope(accelerationFactor, m_scopeImage);
36 }
37
38 void AbstractGfxScopeWidget::mouseReleaseEvent(QMouseEvent *event)
39 {
40     AbstractScopeWidget::mouseReleaseEvent(event);
41     emit signalFrameRequest(widgetName());
42 }
43
44
45 ///// Slots /////
46
47
48 void AbstractGfxScopeWidget::slotRenderZoneUpdated(const QImage &frame)
49 {
50     QMutexLocker lock(&m_mutex);
51     m_scopeImage = frame.rgbSwapped();
52     AbstractScopeWidget::slotRenderZoneUpdated();
53 }
54
55 void AbstractGfxScopeWidget::slotAutoRefreshToggled(bool autoRefresh)
56 {
57     if (autoRefresh) {
58         emit signalFrameRequest(widgetName());
59     }
60 }
61
62
63 #ifdef DEBUG_AGSW
64 #undef DEBUG_AGSW
65 #endif
66
67 #include "abstractgfxscopewidget.moc"