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