]> git.sesse.net Git - kdenlive/blob - src/mainwindow.h
add config button to rec monitor
[kdenlive] / src / mainwindow.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 MAINWINDOW_H
22 #define MAINWINDOW_H
23
24 #include <QDockWidget>
25 #include <QUndoView>
26 #include <QLabel>
27 #include <QProgressBar>
28 #include <QEvent>
29 #include <QTimer>
30
31 #include <KXmlGuiWindow>
32 #include <KTextEdit>
33 #include <KListWidget>
34 #include <KTabWidget>
35 #include <KUndoStack>
36 #include <KRecentFilesAction>
37 #include <KComboBox>
38
39 #include "effectslist.h"
40 #include "gentime.h"
41 #include "definitions.h"
42 #include "statusbarmessagelabel.h"
43
44 class KdenliveDoc;
45 class TrackView;
46 class MonitorManager;
47 class ProjectList;
48 class EffectsListView;
49 class EffectStackView;
50 class TransitionSettings;
51 class Monitor;
52 class RecMonitor;
53 class CustomTrackView;
54 class RenderWidget;
55 class JogShuttle;
56 class DocClipBase;
57
58 class MainWindow : public KXmlGuiWindow {
59     Q_OBJECT
60
61 public:
62     MainWindow(QWidget *parent = 0);
63     void parseProfiles();
64
65     static EffectsList videoEffects;
66     static EffectsList audioEffects;
67     static EffectsList customEffects;
68     static EffectsList transitions;
69 protected:
70     virtual bool queryClose();
71     virtual void customEvent(QEvent * e);
72     virtual void keyPressEvent(QKeyEvent *ke);
73     bool eventFilter(QObject *obj, QEvent *ev);
74     /**
75      * This function is called when it is time for the app to save its
76      * properties for session management purposes.
77      */
78     void saveProperties(KConfig *);
79
80     /**
81      * This function is called when this app is restored.  The KConfig
82      * object points to the session management config file that was saved
83      * with @ref saveProperties
84      */
85     void readProperties(KConfig *);
86
87 private:
88     KTabWidget* m_timelineArea;
89     QProgressBar *statusProgressBar;
90     void setupActions();
91     KdenliveDoc *m_activeDocument;
92     TrackView *m_activeTimeline;
93     MonitorManager *m_monitorManager;
94
95     QDockWidget *projectListDock;
96     ProjectList *m_projectList;
97
98     QDockWidget *effectListDock;
99     EffectsListView *m_effectList;
100     //KListWidget *m_effectList;
101
102     QDockWidget *effectStackDock;
103     EffectStackView *effectStack;
104
105     QDockWidget *transitionConfigDock;
106     TransitionSettings *transitionConfig;
107
108     QDockWidget *clipMonitorDock;
109     Monitor *m_clipMonitor;
110
111     QDockWidget *projectMonitorDock;
112     Monitor *m_projectMonitor;
113
114     QDockWidget *recMonitorDock;
115     RecMonitor *m_recMonitor;
116
117     QDockWidget *undoViewDock;
118     QUndoView *m_undoView;
119     QUndoGroup *m_commandStack;
120
121     KComboBox *m_timecodeFormat;
122
123     QDockWidget *overviewDock;
124     CustomTrackView *m_overView;
125
126     QMenu *m_customEffectsMenu;
127     QMenu *m_timelineContextMenu;
128     QMenu *m_timelineContextClipMenu;
129     QMenu *m_timelineContextTransitionMenu;
130
131     RenderWidget *m_renderWidget;
132
133     JogShuttle *m_jogProcess;
134
135     KRecentFilesAction *m_fileOpenRecent;
136     KAction *m_projectSearch;
137     KAction *m_projectSearchNext;
138
139     QAction *m_buttonAudioThumbs;
140     QAction *m_buttonVideoThumbs;
141     QAction *m_buttonShowMarkers;
142     QAction *m_buttonFitZoom;
143     QAction *m_buttonSelectTool;
144     QAction *m_buttonRazorTool;
145     QAction *m_buttonSnap;
146     QActionGroup *m_toolGroup;
147     QSlider *m_zoomSlider;
148     StatusBarMessageLabel *m_messageLabel;
149
150     bool m_findActivated;
151     QString m_findString;
152     QTimer m_findTimer;
153     bool m_initialized;
154
155     void readOptions();
156     void saveOptions();
157     void activateShuttleDevice();
158     void slotShuttleAction(int code);
159     void connectDocumentInfo(KdenliveDoc *doc);
160     void findAhead();
161
162 public slots:
163     void openFile(const KUrl &url);
164     void slotGotProgressInfo(const QString &message, int progress);
165
166 private slots:
167     void newFile();
168     void undo();
169     void redo();
170     void queryQuit();
171     void activateDocument();
172     void connectDocument(TrackView*, KdenliveDoc*);
173     void openFile();
174     void openLastFile();
175     void saveFile();
176     void saveFileAs();
177     void saveFileAs(const QString &outputFileName);
178     void slotPreferences(int page = -1, int option = -1);
179     void updateConfiguration();
180     void slotConnectMonitors();
181     void slotRaiseMonitor(bool clipMonitor);
182     void slotSetClipDuration(int id, int duration);
183     void slotUpdateMousePosition(int pos);
184     void slotAddEffect(QDomElement effect, GenTime pos = GenTime(), int track = -1);
185     void slotEditProfiles();
186     void slotEditProjectSettings();
187     void slotDisplayActionMessage(QAction *a);
188     void slotSwitchVideoThumbs();
189     void slotSwitchAudioThumbs();
190     void slotSwitchMarkersComments();
191     void slotSwitchSnap();
192     void slotRenderProject();
193     void slotDoRender(const QString &dest, const QString &render, const QStringList &avformat_args, bool zoneOnly, bool playAfter);
194     void slotFullScreen();
195     void slotUpdateDocumentState(bool modified);
196     void slotZoomIn();
197     void slotZoomOut();
198     void slotFitZoom();
199     void slotRemoveTab();
200     void slotDeleteTimelineClip();
201     void slotAddClipMarker();
202     void slotDeleteClipMarker();
203     void slotDeleteAllClipMarkers();
204     void slotEditClipMarker();
205     void slotCutTimelineClip();
206     void slotAddVideoEffect(QAction *result);
207     void slotAddAudioEffect(QAction *result);
208     void slotAddCustomEffect(QAction *result);
209     void slotAddTransition(QAction *result);
210     void slotAddProjectClip(KUrl url);
211     void slotShuttleButton(int code);
212     void slotShowClipProperties(DocClipBase *clip);
213     void slotActivateEffectStackView();
214     void slotActivateTransitionView();
215     void slotChangeTool(QAction * action);
216     void slotSetTool(PROJECTTOOL tool);
217     void slotSnapForward();
218     void slotSnapRewind();
219     void slotClipStart();
220     void slotClipEnd();
221     void slotFind();
222     void findTimeout();
223     void slotFindNext();
224
225     void slotAddGuide();
226     void slotEditGuide();
227     void slotDeleteGuide();
228     void slotDeleteAllGuides();
229
230     void slotCopy();
231     void slotPaste();
232     void slotPasteEffects();
233     void slotReloadEffects();
234
235 };
236
237
238 #endif