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;
59 class MainWindow : public KXmlGuiWindow {
63 MainWindow(QWidget *parent = 0);
66 static EffectsList videoEffects;
67 static EffectsList audioEffects;
68 static EffectsList customEffects;
69 static EffectsList transitions;
71 virtual bool queryClose();
72 virtual void customEvent(QEvent * e);
73 virtual void keyPressEvent(QKeyEvent *ke);
74 bool eventFilter(QObject *obj, QEvent *ev);
76 * This function is called when it is time for the app to save its
77 * properties for session management purposes.
79 void saveProperties(KConfig *);
82 * This function is called when this app is restored. The KConfig
83 * object points to the session management config file that was saved
84 * with @ref saveProperties
86 void readProperties(KConfig *);
89 KTabWidget* m_timelineArea;
90 QProgressBar *statusProgressBar;
92 KdenliveDoc *m_activeDocument;
93 TrackView *m_activeTimeline;
94 MonitorManager *m_monitorManager;
96 QDockWidget *projectListDock;
97 ProjectList *m_projectList;
99 QDockWidget *effectListDock;
100 EffectsListView *m_effectList;
101 //KListWidget *m_effectList;
103 QDockWidget *effectStackDock;
104 EffectStackView *effectStack;
106 QDockWidget *transitionConfigDock;
107 TransitionSettings *transitionConfig;
109 QDockWidget *clipMonitorDock;
110 Monitor *m_clipMonitor;
112 QDockWidget *projectMonitorDock;
113 Monitor *m_projectMonitor;
115 QDockWidget *recMonitorDock;
116 RecMonitor *m_recMonitor;
118 QDockWidget *undoViewDock;
119 QUndoView *m_undoView;
120 QUndoGroup *m_commandStack;
122 KComboBox *m_timecodeFormat;
124 QDockWidget *overviewDock;
125 CustomTrackView *m_overView;
127 QMenu *m_customEffectsMenu;
128 QMenu *m_timelineContextMenu;
129 QMenu *m_timelineContextClipMenu;
130 QMenu *m_timelineContextTransitionMenu;
132 RenderWidget *m_renderWidget;
134 JogShuttle *m_jogProcess;
136 KRecentFilesAction *m_fileOpenRecent;
137 KAction *m_projectSearch;
138 KAction *m_projectSearchNext;
140 QAction *m_buttonAudioThumbs;
141 QAction *m_buttonVideoThumbs;
142 QAction *m_buttonShowMarkers;
143 QAction *m_buttonFitZoom;
144 QAction *m_buttonSelectTool;
145 QAction *m_buttonRazorTool;
146 QAction *m_buttonSnap;
147 QActionGroup *m_toolGroup;
148 QAction *m_saveAction;
149 QSlider *m_zoomSlider;
150 StatusBarMessageLabel *m_messageLabel;
152 bool m_findActivated;
153 QString m_findString;
159 void activateShuttleDevice();
160 void slotShuttleAction(int code);
161 void connectDocumentInfo(KdenliveDoc *doc);
163 void doOpenFile(const KUrl &url, KAutoSaveFile *stale);
164 void recoverFiles(QList<KAutoSaveFile *> staleFiles);
167 void openFile(const KUrl &url);
168 void slotGotProgressInfo(const QString &message, int progress);
173 void activateDocument();
174 void connectDocument(TrackView*, KdenliveDoc*);
179 void saveFileAs(const QString &outputFileName);
180 void slotPreferences(int page = -1, int option = -1);
181 void updateConfiguration();
182 void slotConnectMonitors();
183 void slotRaiseMonitor(bool clipMonitor);
184 void slotSetClipDuration(const QString &id, int duration);
185 void slotUpdateMousePosition(int pos);
186 void slotAddEffect(QDomElement effect, GenTime pos = GenTime(), int track = -1);
187 void slotEditProfiles();
188 void slotEditProjectSettings();
189 void slotDisplayActionMessage(QAction *a);
190 void slotSwitchVideoThumbs();
191 void slotSwitchAudioThumbs();
192 void slotSwitchMarkersComments();
193 void slotSwitchSnap();
194 void slotRenderProject();
195 void slotDoRender(const QString &dest, const QString &render, const QStringList &overlay_args, const QStringList &avformat_args, bool zoneOnly, bool playAfter);
196 void slotFullScreen();
197 void slotUpdateDocumentState(bool modified);
201 void closeCurrentDocument();
202 void slotDeleteTimelineClip();
203 void slotAddClipMarker();
204 void slotDeleteClipMarker();
205 void slotDeleteAllClipMarkers();
206 void slotEditClipMarker();
207 void slotCutTimelineClip();
208 void slotAddVideoEffect(QAction *result);
209 void slotAddAudioEffect(QAction *result);
210 void slotAddCustomEffect(QAction *result);
211 void slotAddTransition(QAction *result);
212 void slotAddProjectClip(KUrl url);
213 void slotShuttleButton(int code);
214 void slotShowClipProperties(DocClipBase *clip);
215 void slotActivateEffectStackView();
216 void slotActivateTransitionView();
217 void slotChangeTool(QAction * action);
218 void slotSetTool(PROJECTTOOL tool);
219 void slotSnapForward();
220 void slotSnapRewind();
221 void slotClipStart();
228 void slotEditGuide();
229 void slotDeleteGuide();
230 void slotDeleteAllGuides();
234 void slotPasteEffects();
235 void slotReloadEffects();
236 void slotChangeClipSpeed();
238 void slotAdjustClipMonitor();
239 void slotAdjustProjectMonitor();