]> git.sesse.net Git - kdenlive/blob - src/mainwindow.h
07a54664b3f50c7bd86673fd69b68fb2b49d8866
[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 queryQuit();
169     void activateDocument();
170     void connectDocument(TrackView*, KdenliveDoc*);
171     void openFile();
172     void openLastFile();
173     void saveFile();
174     void saveFileAs();
175     void saveFileAs(const QString &outputFileName);
176     void slotPreferences(int page = -1, int option = -1);
177     void updateConfiguration();
178     void slotConnectMonitors();
179     void slotRaiseMonitor(bool clipMonitor);
180     void slotSetClipDuration(int id, int duration);
181     void slotUpdateMousePosition(int pos);
182     void slotAddEffect(QDomElement effect, GenTime pos = GenTime(), int track = -1);
183     void slotEditProfiles();
184     void slotEditProjectSettings();
185     void slotDisplayActionMessage(QAction *a);
186     void slotSwitchVideoThumbs();
187     void slotSwitchAudioThumbs();
188     void slotSwitchMarkersComments();
189     void slotSwitchSnap();
190     void slotRenderProject();
191     void slotDoRender(const QString &dest, const QString &render, const QStringList &avformat_args, bool zoneOnly, bool playAfter);
192     void slotFullScreen();
193     void slotUpdateDocumentState(bool modified);
194     void slotZoomIn();
195     void slotZoomOut();
196     void slotFitZoom();
197     void slotRemoveTab();
198     void slotDeleteTimelineClip();
199     void slotAddClipMarker();
200     void slotDeleteClipMarker();
201     void slotDeleteAllClipMarkers();
202     void slotEditClipMarker();
203     void slotCutTimelineClip();
204     void slotAddVideoEffect(QAction *result);
205     void slotAddAudioEffect(QAction *result);
206     void slotAddCustomEffect(QAction *result);
207     void slotAddTransition(QAction *result);
208     void slotAddProjectClip(KUrl url);
209     void slotShuttleButton(int code);
210     void slotShowClipProperties(DocClipBase *clip);
211     void slotActivateEffectStackView();
212     void slotActivateTransitionView();
213     void slotChangeTool(QAction * action);
214     void slotSetTool(PROJECTTOOL tool);
215     void slotSnapForward();
216     void slotSnapRewind();
217     void slotClipStart();
218     void slotClipEnd();
219     void slotFind();
220     void findTimeout();
221     void slotFindNext();
222
223     void slotAddGuide();
224     void slotEditGuide();
225     void slotDeleteGuide();
226     void slotDeleteAllGuides();
227
228     void slotCopy();
229     void slotPaste();
230     void slotPasteEffects();
231     void slotReloadEffects();
232     void slotChangeClipSpeed();
233
234     void slotAdjustClipMonitor();
235     void slotAdjustProjectMonitor();
236 };
237
238
239 #endif