]> git.sesse.net Git - kdenlive/blob - src/recmonitor.h
krazy fix: add explicit to declarations
[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 #include <KDateTime>
33
34 #include "ui_recmonitor_ui.h"
35 #include "smallruler.h"
36 #include "regiongrabber.h"
37
38 class RecMonitor : public QWidget {
39     Q_OBJECT
40
41 public:
42     explicit RecMonitor(QString name, QWidget *parent = 0);
43     virtual ~RecMonitor();
44
45     QString name() const;
46
47     enum CAPTUREDEVICE {FIREWIRE = 0, VIDEO4LINUX = 1, SCREENGRAB = 2};
48
49 protected:
50     virtual void mousePressEvent(QMouseEvent * event);
51
52 private:
53     Ui::RecMonitor_UI ui;
54     QString m_tmpFolder;
55     QString m_name;
56     RegionGrabber *rgnGrab;
57     bool m_isActive;
58     KDateTime m_captureTime;
59
60     KUrl m_captureFile;
61     KIcon m_playIcon;
62     KIcon m_pauseIcon;
63
64     QProcess *captureProcess;
65     QProcess *displayProcess;
66     QTimer *m_initTimer;
67     bool m_isCapturing;
68     /** did the user capture something ? */
69     bool m_didCapture;
70     bool m_isPlaying;
71     QStringList m_captureArgs;
72     QStringList m_displayArgs;
73     QAction *m_recAction;
74     QAction *m_playAction;
75     QAction *m_fwdAction;
76     QAction *m_rewAction;
77     QAction *m_stopAction;
78     QAction *m_discAction;
79     void checkDeviceAvailability();
80     QPixmap mergeSideBySide(const QPixmap& pix, const QString txt);
81     void manageCapturedFiles();
82
83 private slots:
84     void slotStartCapture(bool play = true);
85     void slotStopCapture();
86     void slotRecord();
87     void slotProcessStatus(QProcess::ProcessState status);
88     void slotVideoDeviceChanged(int ix);
89     void slotRewind();
90     void slotForward();
91     void slotDisconnect();
92     //void slotStartGrab(const QRect &rect);
93     void slotConfigure();
94
95 public slots:
96     void refreshRecMonitor(bool visible);
97     void stop();
98     void start();
99     void activateRecMonitor();
100     void slotPlay();
101
102 signals:
103     void renderPosition(int);
104     void durationChanged(int);
105     void addProjectClip(KUrl);
106     void showConfigDialog(int, int);
107 };
108
109 #endif