]> git.sesse.net Git - kdenlive/blob - src/recmonitor.h
NEW: Kdenlive can now create screencasts.
[kdenlive] / src / recmonitor.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 RECMONITOR_H
22 #define RECMONITOR_H
23
24 #include <QToolBar>
25 #include <QTimer>
26 #include <QProcess>
27 #include <QImage>
28
29 #include <KIcon>
30 #include <KAction>
31 #include <KRestrictedLine>
32
33 #include "ui_recmonitor_ui.h"
34 #include "smallruler.h"
35 #include "regiongrabber.h"
36
37 class RecMonitor : public QWidget {
38     Q_OBJECT
39
40 public:
41     RecMonitor(QString name, QWidget *parent = 0);
42     QString name() const;
43
44 enum CAPTUREDEVICE {FIREWIRE = 0, VIDEO4LINUX = 1, SCREENGRAB =2};
45
46 protected:
47     virtual void mousePressEvent(QMouseEvent * event);
48
49 private:
50     Ui::RecMonitor_UI ui;
51     QString m_tmpFolder;
52     QString m_name;
53         RegionGrabber *rgnGrab;
54     bool m_isActive;
55
56
57     KUrl m_captureFile;
58     KIcon m_playIcon;
59     KIcon m_pauseIcon;
60
61     QProcess *captureProcess;
62     QProcess *displayProcess;
63     QTimer *m_initTimer;
64     bool m_isCapturing;
65     bool m_isPlaying;
66     QStringList m_captureArgs;
67     QStringList m_displayArgs;
68     QAction *m_recAction;
69     QAction *m_playAction;
70     QAction *m_fwdAction;
71     QAction *m_rewAction;
72     QAction *m_stopAction;
73     QAction *m_discAction;
74
75 private slots:
76     void slotStartCapture(bool play = true);
77     void slotStopCapture();
78     void slotRecord();
79     void slotProcessStatus(QProcess::ProcessState status);
80     void slotVideoDeviceChanged(int ix);
81     void slotRewind();
82     void slotForward();
83     void slotDisconnect();
84         void slotStartGrab(const QRect &rect);
85
86 public slots:
87     void refreshRecMonitor(bool visible);
88     void stop();
89     void start();
90     void activateRecMonitor();
91     void slotPlay();
92
93 signals:
94     void renderPosition(int);
95     void durationChanged(int);
96     void addProjectClip(KUrl);
97 };
98
99 #endif