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>
39 #include "effectslist.h"
41 #include "definitions.h"
42 #include "statusbarmessagelabel.h"
48 class EffectsListView;
49 class EffectStackView;
50 class TransitionSettings;
53 class CustomTrackView;
58 class MainWindow : public KXmlGuiWindow {
62 MainWindow(QWidget *parent = 0);
65 static EffectsList videoEffects;
66 static EffectsList audioEffects;
67 static EffectsList customEffects;
68 static EffectsList transitions;
70 virtual bool queryClose();
71 virtual void customEvent(QEvent * e);
72 virtual void keyPressEvent(QKeyEvent *ke);
73 bool eventFilter(QObject *obj, QEvent *ev);
75 * This function is called when it is time for the app to save its
76 * properties for session management purposes.
78 void saveProperties(KConfig *);
81 * This function is called when this app is restored. The KConfig
82 * object points to the session management config file that was saved
83 * with @ref saveProperties
85 void readProperties(KConfig *);
88 KTabWidget* m_timelineArea;
89 QProgressBar *statusProgressBar;
91 KdenliveDoc *m_activeDocument;
92 TrackView *m_activeTimeline;
93 MonitorManager *m_monitorManager;
95 QDockWidget *projectListDock;
96 ProjectList *m_projectList;
98 QDockWidget *effectListDock;
99 EffectsListView *m_effectList;
100 //KListWidget *m_effectList;
102 QDockWidget *effectStackDock;
103 EffectStackView *effectStack;
105 QDockWidget *transitionConfigDock;
106 TransitionSettings *transitionConfig;
108 QDockWidget *clipMonitorDock;
109 Monitor *m_clipMonitor;
111 QDockWidget *projectMonitorDock;
112 Monitor *m_projectMonitor;
114 QDockWidget *recMonitorDock;
115 RecMonitor *m_recMonitor;
117 QDockWidget *undoViewDock;
118 QUndoView *m_undoView;
119 QUndoGroup *m_commandStack;
121 KComboBox *m_timecodeFormat;
123 QDockWidget *overviewDock;
124 CustomTrackView *m_overView;
126 QMenu *m_timelineContextMenu;
127 QMenu *m_timelineContextClipMenu;
128 QMenu *m_timelineContextTransitionMenu;
130 RenderWidget *m_renderWidget;
132 JogShuttle *m_jogProcess;
134 KRecentFilesAction *m_fileOpenRecent;
135 KAction *m_projectSearch;
136 KAction *m_projectSearchNext;
138 QAction *m_buttonAudioThumbs;
139 QAction *m_buttonVideoThumbs;
140 QAction *m_buttonShowMarkers;
141 QAction *m_buttonFitZoom;
142 QAction *m_buttonSelectTool;
143 QAction *m_buttonRazorTool;
144 QAction *m_buttonSnap;
145 QActionGroup *m_toolGroup;
146 QSlider *m_zoomSlider;
147 StatusBarMessageLabel *m_messageLabel;
149 bool m_findActivated;
150 QString m_findString;
156 void activateShuttleDevice();
157 void slotShuttleAction(int code);
158 void connectDocumentInfo(KdenliveDoc *doc);
162 void openFile(const KUrl &url);
163 void slotGotProgressInfo(const QString &message, int progress);
170 void activateDocument();
171 void connectDocument(TrackView*, KdenliveDoc*);
176 void saveFileAs(const QString &outputFileName);
177 void slotPreferences();
178 void updateConfiguration();
179 void slotConnectMonitors();
180 void slotRaiseMonitor(bool clipMonitor);
181 void slotSetClipDuration(int id, int duration);
182 void slotUpdateMousePosition(int pos);
183 void slotAddEffect(QDomElement effect, GenTime pos = GenTime(), int track = -1);
184 void slotEditProfiles();
185 void slotEditProjectSettings();
186 void slotDisplayActionMessage(QAction *a);
187 void slotSwitchVideoThumbs();
188 void slotSwitchAudioThumbs();
189 void slotSwitchMarkersComments();
190 void slotSwitchSnap();
191 void slotRenderProject();
192 void slotDoRender(const QString &dest, const QString &render, const QStringList &avformat_args, bool zoneOnly, bool playAfter);
193 void slotFullScreen();
194 void slotUpdateDocumentState(bool modified);
198 void slotRemoveTab();
199 void slotDeleteTimelineClip();
200 void slotAddClipMarker();
201 void slotDeleteClipMarker();
202 void slotDeleteAllClipMarkers();
203 void slotEditClipMarker();
204 void slotCutTimelineClip();
205 void slotAddVideoEffect(QAction *result);
206 void slotAddAudioEffect(QAction *result);
207 void slotAddCustomEffect(QAction *result);
208 void slotAddTransition(QAction *result);
209 void slotAddProjectClip(KUrl url);
210 void slotShuttleButton(int code);
211 void slotShowClipProperties(DocClipBase *clip);
212 void slotActivateEffectStackView();
213 void slotActivateTransitionView();
214 void slotChangeTool(QAction * action);
215 void slotSetTool(PROJECTTOOL tool);
216 void slotSnapForward();
217 void slotSnapRewind();
218 void slotClipStart();
225 void slotEditGuide();
226 void slotDeleteGuide();
227 void slotDeleteAllGuides();