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;
60 class MainWindow : public KXmlGuiWindow {
64 MainWindow(const QString &MltPath = QString(), QWidget *parent = 0);
65 void parseProfiles(const QString &mltPath = QString());
67 static EffectsList videoEffects;
68 static EffectsList audioEffects;
69 static EffectsList customEffects;
70 static EffectsList transitions;
72 virtual bool queryClose();
73 virtual void customEvent(QEvent * e);
74 virtual void keyPressEvent(QKeyEvent *ke);
75 bool eventFilter(QObject *obj, QEvent *ev);
77 * This function is called when it is time for the app to save its
78 * properties for session management purposes.
80 void saveProperties(KConfig *);
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
87 void readProperties(KConfig *);
90 KTabWidget* m_timelineArea;
91 QProgressBar *statusProgressBar;
93 KdenliveDoc *m_activeDocument;
94 TrackView *m_activeTimeline;
95 MonitorManager *m_monitorManager;
97 QDockWidget *projectListDock;
98 ProjectList *m_projectList;
100 QDockWidget *effectListDock;
101 EffectsListView *m_effectList;
102 //KListWidget *m_effectList;
104 QDockWidget *effectStackDock;
105 EffectStackView *effectStack;
107 QDockWidget *transitionConfigDock;
108 TransitionSettings *transitionConfig;
110 QDockWidget *clipMonitorDock;
111 Monitor *m_clipMonitor;
113 QDockWidget *projectMonitorDock;
114 Monitor *m_projectMonitor;
116 QDockWidget *recMonitorDock;
117 RecMonitor *m_recMonitor;
119 QDockWidget *undoViewDock;
120 QUndoView *m_undoView;
121 QUndoGroup *m_commandStack;
123 KComboBox *m_timecodeFormat;
125 QDockWidget *overviewDock;
126 CustomTrackView *m_overView;
128 QMenu *m_customEffectsMenu;
129 QMenu *m_timelineContextMenu;
130 QMenu *m_timelineContextClipMenu;
131 QMenu *m_timelineContextTransitionMenu;
133 RenderWidget *m_renderWidget;
135 JogShuttle *m_jogProcess;
137 KRecentFilesAction *m_fileOpenRecent;
138 KAction *m_projectSearch;
139 KAction *m_projectSearchNext;
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;
153 bool m_findActivated;
154 QString m_findString;
160 void activateShuttleDevice();
161 void slotShuttleAction(int code);
162 void connectDocumentInfo(KdenliveDoc *doc);
164 void doOpenFile(const KUrl &url, KAutoSaveFile *stale);
165 void recoverFiles(QList<KAutoSaveFile *> staleFiles);
168 void openFile(const KUrl &url);
169 void slotGotProgressInfo(const QString &message, int progress);
174 void activateDocument();
175 void connectDocument(TrackView*, KdenliveDoc*);
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);
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();
229 void slotEditGuide();
230 void slotDeleteGuide();
231 void slotDeleteAllGuides();
232 void slotGuidesUpdated();
236 void slotPasteEffects();
237 void slotReloadEffects();
238 void slotChangeClipSpeed();
240 void slotAdjustClipMonitor();
241 void slotAdjustProjectMonitor();
242 void slotSaveZone(Render *render, QPoint zone);
244 void slotSetInPoint();
245 void slotSetOutPoint();
246 void configureNotifications();