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