1 /***************************************************************************
2 * Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org) *
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. *
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. *
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 ***************************************************************************/
24 #include <QDockWidget>
27 #include <QProgressBar>
31 #include <KXmlGuiWindow>
33 #include <KListWidget>
36 #include <KRecentFilesAction>
38 #include <kautosavefile.h>
40 #include "effectslist.h"
42 #include "definitions.h"
43 #include "statusbarmessagelabel.h"
49 class EffectsListView;
50 class EffectStackView;
51 class TransitionSettings;
54 class CustomTrackView;
58 #endif /* NO_JOGSHUTTLE */
62 class MainWindow : public KXmlGuiWindow {
66 MainWindow(const QString &MltPath = QString(), QWidget *parent = 0);
67 void parseProfiles(const QString &mltPath = QString());
69 static EffectsList videoEffects;
70 static EffectsList audioEffects;
71 static EffectsList customEffects;
72 static EffectsList transitions;
74 virtual bool queryClose();
75 virtual void customEvent(QEvent * e);
76 virtual void keyPressEvent(QKeyEvent *ke);
77 bool eventFilter(QObject *obj, QEvent *ev);
79 * This function is called when it is time for the app to save its
80 * properties for session management purposes.
82 void saveProperties(KConfig *);
85 * This function is called when this app is restored. The KConfig
86 * object points to the session management config file that was saved
87 * with @ref saveProperties
89 void readProperties(KConfig *);
92 KTabWidget* m_timelineArea;
93 QProgressBar *statusProgressBar;
95 KdenliveDoc *m_activeDocument;
96 TrackView *m_activeTimeline;
97 MonitorManager *m_monitorManager;
99 QDockWidget *projectListDock;
100 ProjectList *m_projectList;
102 QDockWidget *effectListDock;
103 EffectsListView *m_effectList;
104 //KListWidget *m_effectList;
106 QDockWidget *effectStackDock;
107 EffectStackView *effectStack;
109 QDockWidget *transitionConfigDock;
110 TransitionSettings *transitionConfig;
112 QDockWidget *clipMonitorDock;
113 Monitor *m_clipMonitor;
115 QDockWidget *projectMonitorDock;
116 Monitor *m_projectMonitor;
118 QDockWidget *recMonitorDock;
119 RecMonitor *m_recMonitor;
121 QDockWidget *undoViewDock;
122 QUndoView *m_undoView;
123 QUndoGroup *m_commandStack;
125 KComboBox *m_timecodeFormat;
127 QDockWidget *overviewDock;
128 CustomTrackView *m_overView;
130 QMenu *m_customEffectsMenu;
131 QMenu *m_timelineContextMenu;
132 QMenu *m_timelineContextClipMenu;
133 QMenu *m_timelineContextTransitionMenu;
135 RenderWidget *m_renderWidget;
137 #ifndef NO_JOGSHUTTLE
138 JogShuttle *m_jogProcess;
139 #endif /* NO_JOGSHUTTLE */
141 KRecentFilesAction *m_fileOpenRecent;
142 KAction *m_projectSearch;
143 KAction *m_projectSearchNext;
145 KAction *m_buttonAudioThumbs;
146 KAction *m_buttonVideoThumbs;
147 KAction *m_buttonShowMarkers;
148 KAction *m_buttonFitZoom;
149 KAction *m_buttonSelectTool;
150 KAction *m_buttonRazorTool;
151 KAction *m_buttonSnap;
152 QActionGroup *m_toolGroup;
153 KAction *m_saveAction;
154 KAction *m_closeAction;
155 QSlider *m_zoomSlider;
156 StatusBarMessageLabel *m_messageLabel;
158 bool m_findActivated;
159 QString m_findString;
165 #ifndef NO_JOGSHUTTLE
166 void activateShuttleDevice();
167 void slotShuttleAction(int code);
168 #endif /* NO_JOGSHUTTLE */
169 void connectDocumentInfo(KdenliveDoc *doc);
171 void doOpenFile(const KUrl &url, KAutoSaveFile *stale);
172 void recoverFiles(QList<KAutoSaveFile *> staleFiles);
175 void openFile(const KUrl &url);
176 void slotGotProgressInfo(const QString &message, int progress);
179 void newFile(bool showProjectSettings = true);
181 void activateDocument();
182 void connectDocument(TrackView*, KdenliveDoc*);
187 void saveFileAs(const QString &outputFileName);
188 void slotPreferences(int page = -1, int option = -1);
189 void updateConfiguration();
190 void slotConnectMonitors();
191 void slotRaiseMonitor(bool clipMonitor);
192 void slotSetClipDuration(const QString &id, int duration);
193 void slotUpdateMousePosition(int pos);
194 void slotAddEffect(QDomElement effect, GenTime pos = GenTime(), int track = -1);
195 void slotEditProfiles();
196 void slotEditProjectSettings();
197 void slotDisplayActionMessage(QAction *a);
198 void slotSwitchVideoThumbs();
199 void slotSwitchAudioThumbs();
200 void slotSwitchMarkersComments();
201 void slotSwitchSnap();
202 void slotRenderProject();
203 void slotDoRender(const QString &dest, const QString &render, const QStringList &overlay_args, const QStringList &avformat_args, bool zoneOnly, bool playAfter, double guideStart, double guideEnd);
204 void slotFullScreen();
205 void slotUpdateDocumentState(bool modified);
209 void closeCurrentDocument();
210 void slotDeleteTimelineClip();
211 void slotAddClipMarker();
212 void slotDeleteClipMarker();
213 void slotDeleteAllClipMarkers();
214 void slotEditClipMarker();
215 void slotCutTimelineClip();
216 void slotAddVideoEffect(QAction *result);
217 void slotAddAudioEffect(QAction *result);
218 void slotAddCustomEffect(QAction *result);
219 void slotAddTransition(QAction *result);
220 void slotAddProjectClip(KUrl url);
221 #ifndef NO_JOGSHUTTLE
222 void slotShuttleButton(int code);
223 #endif /* NO_JOGSHUTTLE */
224 void slotShowClipProperties(DocClipBase *clip);
225 void slotActivateEffectStackView();
226 void slotActivateTransitionView();
227 void slotChangeTool(QAction * action);
228 void slotSetTool(PROJECTTOOL tool);
229 void slotSnapForward();
230 void slotSnapRewind();
231 void slotClipStart();
238 void slotEditGuide();
239 void slotDeleteGuide();
240 void slotDeleteAllGuides();
241 void slotGuidesUpdated();
245 void slotPasteEffects();
246 void slotReloadEffects();
247 void slotChangeClipSpeed();
249 void slotAdjustClipMonitor();
250 void slotAdjustProjectMonitor();
251 void slotSaveZone(Render *render, QPoint zone);
253 void slotSetInPoint();
254 void slotSetOutPoint();
255 void configureNotifications();