]> git.sesse.net Git - kdenlive/blob - src/colorscopes/abstractgfxscopewidget.h
Complete rewrite of the video4linux capture to use MLT, in progress.
[kdenlive] / src / colorscopes / abstractgfxscopewidget.h
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 #ifndef ABSTRACTGFXSCOPEWIDGET_H
12 #define ABSTRACTGFXSCOPEWIDGET_H
13
14 #include <QtCore>
15 #include <QWidget>
16
17 #include "abstractscopewidget.h"
18 #include "renderer.h"
19
20 class QMenu;
21
22 class MonitorManager;
23
24 class AbstractGfxScopeWidget : public AbstractScopeWidget
25 {
26     Q_OBJECT
27
28 public:
29     AbstractGfxScopeWidget(MonitorManager *manager, bool trackMouse = false, QWidget *parent = 0);
30     virtual ~AbstractGfxScopeWidget(); // Must be virtual because of inheritance, to avoid memory leaks
31
32 protected:
33     ///// Variables /////
34
35     MonitorManager *m_manager;
36     AbstractRender *m_activeRender;
37
38     /** @brief Scope renderer. Must emit signalScopeRenderingFinished()
39         when calculation has finished, to allow multi-threading.
40         accelerationFactor hints how much faster than usual the calculation should be accomplished, if possible. */
41     virtual QImage renderGfxScope(uint accelerationFactor, const QImage) = 0;
42
43     virtual QImage renderScope(uint accelerationFactor);
44
45     void mouseReleaseEvent(QMouseEvent *);
46
47 private:
48     QImage m_scopeImage;
49
50 public slots:
51     /** @brief Must be called when the active monitor has shown a new frame.
52       This slot must be connected in the implementing class, it is *not*
53       done in this abstract class. */
54     void slotActiveMonitorChanged();
55
56 protected slots:
57     virtual void slotAutoRefreshToggled(bool autoRefresh);
58
59 private slots:
60     void slotRenderZoneUpdated(QImage);
61
62 };
63
64 #endif // ABSTRACTGFXSCOPEWIDGET_H