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 QSlider *m_zoomSlider;
149 StatusBarMessageLabel *m_messageLabel;
151 bool m_findActivated;
152 QString m_findString;
158 void activateShuttleDevice();
159 void slotShuttleAction(int code);
160 void connectDocumentInfo(KdenliveDoc *doc);
162 void doOpenFile(const KUrl &url, KAutoSaveFile *stale);
163 void recoverFiles(QList<KAutoSaveFile *> staleFiles);
166 void openFile(const KUrl &url);
167 void slotGotProgressInfo(const QString &message, int progress);
172 void activateDocument();
173 void connectDocument(TrackView*, KdenliveDoc*);
178 void saveFileAs(const QString &outputFileName);
179 void slotPreferences(int page = -1, int option = -1);
180 void updateConfiguration();
181 void slotConnectMonitors();
182 void slotRaiseMonitor(bool clipMonitor);
183 void slotSetClipDuration(const QString &id, int duration);
184 void slotUpdateMousePosition(int pos);
185 void slotAddEffect(QDomElement effect, GenTime pos = GenTime(), int track = -1);
186 void slotEditProfiles();
187 void slotEditProjectSettings();
188 void slotDisplayActionMessage(QAction *a);
189 void slotSwitchVideoThumbs();
190 void slotSwitchAudioThumbs();
191 void slotSwitchMarkersComments();
192 void slotSwitchSnap();
193 void slotRenderProject();
194 void slotDoRender(const QString &dest, const QString &render, const QStringList &avformat_args, bool zoneOnly, bool playAfter);
195 void slotFullScreen();
196 void slotUpdateDocumentState(bool modified);
200 void slotRemoveTab();
201 void slotDeleteTimelineClip();
202 void slotAddClipMarker();
203 void slotDeleteClipMarker();
204 void slotDeleteAllClipMarkers();
205 void slotEditClipMarker();
206 void slotCutTimelineClip();
207 void slotAddVideoEffect(QAction *result);
208 void slotAddAudioEffect(QAction *result);
209 void slotAddCustomEffect(QAction *result);
210 void slotAddTransition(QAction *result);
211 void slotAddProjectClip(KUrl url);
212 void slotShuttleButton(int code);
213 void slotShowClipProperties(DocClipBase *clip);
214 void slotActivateEffectStackView();
215 void slotActivateTransitionView();
216 void slotChangeTool(QAction * action);
217 void slotSetTool(PROJECTTOOL tool);
218 void slotSnapForward();
219 void slotSnapRewind();
220 void slotClipStart();
227 void slotEditGuide();
228 void slotDeleteGuide();
229 void slotDeleteAllGuides();
233 void slotPasteEffects();
234 void slotReloadEffects();
235 void slotChangeClipSpeed();
237 void slotAdjustClipMonitor();
238 void slotAdjustProjectMonitor();