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