]> git.sesse.net Git - kdenlive/blob - src/monitor.h
Rework monitor & timeline UI, and send profile to renderer
[kdenlive] / src / monitor.h
1 /***************************************************************************
2  *   Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org)        *
3  *                                                                         *
4  *   This program is free software; you can redistribute it and/or modify  *
5  *   it under the terms of the GNU General Public License as published by  *
6  *   the Free Software Foundation; either version 2 of the License, or     *
7  *   (at your option) any later version.                                   *
8  *                                                                         *
9  *   This program is distributed in the hope that it will be useful,       *
10  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
11  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
12  *   GNU General Public License for more details.                          *
13  *                                                                         *
14  *   You should have received a copy of the GNU General Public License     *
15  *   along with this program; if not, write to the                         *
16  *   Free Software Foundation, Inc.,                                       *
17  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
18  ***************************************************************************/
19
20
21 #ifndef MONITOR_H
22 #define MONITOR_H
23
24 #include <QToolBar>
25 #include <KIcon>
26 #include <KAction>
27 #include <KRestrictedLine>
28
29 #include "ui_monitor_ui.h"
30 #include "renderer.h"
31 #include "monitormanager.h"
32 #include "smallruler.h"
33
34 class MonitorManager;
35
36 class Monitor : public QWidget {
37     Q_OBJECT
38
39 public:
40     Monitor(QString name, MonitorManager *manager, QWidget *parent = 0);
41     Render *render;
42     void resetProfile(QString prof);
43     QString name() const;
44
45
46 protected:
47     virtual void mousePressEvent(QMouseEvent * event);
48     virtual void wheelEvent(QWheelEvent * event);
49     virtual void resizeEvent(QResizeEvent * event);
50 //    virtual void paintEvent(QPaintEvent * event);
51
52 private:
53     Ui::Monitor_UI ui;
54     MonitorManager *m_monitorManager;
55     QString m_name;
56     double m_scale;
57     int m_length;
58     int m_position;
59     SmallRuler *m_ruler;
60     KIcon m_playIcon;
61     KIcon m_pauseIcon;
62     bool m_isActive;
63     QToolBar *m_toolbar;
64     KRestrictedLine *m_timePos;
65     QAction *m_playAction;
66
67 private slots:
68     void adjustRulerSize(int length);
69     void seekCursor(int pos);
70     void rendererStopped(int pos);
71     void slotRewindOneFrame();
72     void slotForwardOneFrame();
73     void slotForward();
74     void slotRewind();
75
76 public slots:
77     void slotOpenFile(const QString &);
78     void slotSetXml(const QDomElement &e);
79     void initMonitor();
80     void refreshMonitor(bool visible);
81     void slotSeek(int pos);
82     void stop();
83     void start();
84     void activateMonitor();
85     void slotPlay();
86     void saveSceneList(QString path, QDomElement e = QDomElement());
87
88 signals:
89     void renderPosition(int);
90     void durationChanged(int);
91 };
92
93 #endif