[2a5ac4]: src / mainwindow.h Maximize Restore History

Download this file

mainwindow.h    353 lines (315 with data), 11.9 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
/***************************************************************************
* Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org) *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QDockWidget>
#include <QUndoView>
#include <QLabel>
#include <QProgressBar>
#include <QEvent>
#include <QTimer>
#include <QShortcut>
#include <KXmlGuiWindow>
#include <KTextEdit>
#include <KListWidget>
#include <KTabWidget>
#include <KUndoStack>
#include <KRecentFilesAction>
#include <KComboBox>
#include <kautosavefile.h>
#include "effectslist.h"
#include "gentime.h"
#include "definitions.h"
#include "statusbarmessagelabel.h"
#include "dvdwizard.h"
class KdenliveDoc;
class TrackView;
class MonitorManager;
class ProjectList;
class EffectsListView;
class EffectStackView;
class TransitionSettings;
class Monitor;
class RecMonitor;
class CustomTrackView;
class RenderWidget;
#ifndef NO_JOGSHUTTLE
class JogShuttle;
#endif /* NO_JOGSHUTTLE */
class DocClipBase;
class Render;
class Transition;
class MainWindow : public KXmlGuiWindow
{
Q_OBJECT
Q_CLASSINFO("D-Bus Interface", "org.kdenlive.MainWindow")
public:
/** Constructor
* \param MltPath path to MLT environment
* \param Url Url to open
* \param parent Std. widget parent
*
* The constructor inits the main window. If Url is present, it will be opened.
* If Url is not present, and openLastproject is set, last project will be set
* If no file is open after trying this, a default "newfile" will be created. */
explicit MainWindow(const QString &MltPath = QString(), const KUrl & Url = KUrl(), QWidget *parent = 0);
void parseProfiles(const QString &mltPath = QString());
static EffectsList videoEffects;
static EffectsList audioEffects;
static EffectsList customEffects;
static EffectsList transitions;
protected:
virtual bool queryClose();
virtual void customEvent(QEvent * e);
virtual void keyPressEvent(QKeyEvent *ke);
/** Override hideEvent to get events when the mainwindow gets hidden */
virtual void hideEvent(QHideEvent *e);
bool eventFilter(QObject *obj, QEvent *ev);
/**
* This function is called when it is time for the app to save its
* properties for session management purposes.
*/
virtual void saveProperties(KConfigGroup &config);
/**
* This function is called when this app is restored. The KConfig
* object points to the session management config file that was saved
* with @ref saveProperties
*/
virtual void readProperties(const KConfigGroup &config);
private:
KTabWidget* m_timelineArea;
QProgressBar *m_statusProgressBar;
void setupActions();
KdenliveDoc *m_activeDocument;
TrackView *m_activeTimeline;
MonitorManager *m_monitorManager;
QDockWidget *m_projectListDock;
ProjectList *m_projectList;
QDockWidget *m_effectListDock;
EffectsListView *m_effectList;
//KListWidget *m_effectList;
QDockWidget *m_effectStackDock;
EffectStackView *m_effectStack;
QDockWidget *m_transitionConfigDock;
TransitionSettings *m_transitionConfig;
QDockWidget *m_clipMonitorDock;
Monitor *m_clipMonitor;
QDockWidget *m_projectMonitorDock;
Monitor *m_projectMonitor;
QDockWidget *m_recMonitorDock;
RecMonitor *m_recMonitor;
QDockWidget *m_undoViewDock;
QUndoView *m_undoView;
QUndoGroup *m_commandStack;
KComboBox *m_timecodeFormat;
QMenu *m_customEffectsMenu;
QMenu *m_timelineContextMenu;
QMenu *m_timelineContextClipMenu;
QMenu *m_timelineContextTransitionMenu;
KUrl m_startUrl;
/**
* Shortcut to remove the focus of any element. Allows to get out
* of e.g. text input fields and to press another shortcut.
*/
QShortcut* m_shortcutRemoveFocus;
RenderWidget *m_renderWidget;
#ifndef NO_JOGSHUTTLE
JogShuttle *m_jogProcess;
#endif /* NO_JOGSHUTTLE */
KRecentFilesAction *m_fileOpenRecent;
KAction *m_fileRevert;
KAction *m_projectSearch;
KAction *m_projectSearchNext;
KAction *m_buttonAudioThumbs;
KAction *m_buttonVideoThumbs;
KAction *m_buttonShowMarkers;
KAction *m_buttonFitZoom;
KAction *m_normalEditTool;
KAction *m_overwriteEditTool;
KAction *m_insertEditTool;
KAction *m_buttonSelectTool;
KAction *m_buttonRazorTool;
KAction *m_buttonSpacerTool;
KAction *m_buttonSnap;
KAction *m_saveAction;
KAction *m_closeAction;
QSlider *m_zoomSlider;
KAction *m_loopZone;
KAction *m_playZone;
StatusBarMessageLabel *m_messageLabel;
QActionGroup *m_clipTypeGroup;
bool m_findActivated;
QString m_findString;
QTimer m_findTimer;
void readOptions();
void saveOptions();
#ifndef NO_JOGSHUTTLE
void activateShuttleDevice();
void slotShuttleAction(int code);
#endif /* NO_JOGSHUTTLE */
void connectDocumentInfo(KdenliveDoc *doc);
void findAhead();
void doOpenFile(const KUrl &url, KAutoSaveFile *stale);
void recoverFiles(QList<KAutoSaveFile *> staleFiles);
void loadPlugins();
void populateMenus(QObject *plugin);
void addToMenu(QObject *plugin, const QStringList &texts,
QMenu *menu, const char *member,
QActionGroup *actionGroup);
void aboutPlugins();
int getNewStuff(const QString &configFile = QString());
QStringList m_pluginFileNames;
QByteArray m_timelineState;
void loadTranscoders();
QPixmap createSchemePreviewIcon(const KSharedConfigPtr &config);
public slots:
void openFile(const KUrl &url);
void slotGotProgressInfo(const QString &message, int progress);
Q_SCRIPTABLE void setRenderingProgress(const QString &url, int progress);
Q_SCRIPTABLE void setRenderingFinished(const QString &url, int status, const QString &error);
private slots:
void newFile(bool showProjectSettings = true, bool force = false);
void queryQuit();
void activateDocument();
void connectDocument(TrackView*, KdenliveDoc*);
void openFile();
void openLastFile();
bool saveFile();
bool saveFileAs();
bool saveFileAs(const QString &outputFileName);
void slotPreferences(int page = -1, int option = -1);
void updateConfiguration();
void slotConnectMonitors();
void slotRaiseMonitor(bool clipMonitor);
void slotUpdateClip(const QString &id);
void slotUpdateMousePosition(int pos);
void slotAddEffect(const QDomElement effect, GenTime pos = GenTime(), int track = -1);
void slotEditProfiles();
void slotDetectAudioDriver();
void slotEditProjectSettings();
void slotDisplayActionMessage(QAction *a);
void slotSwitchVideoThumbs();
void slotSwitchAudioThumbs();
void slotSwitchMarkersComments();
void slotSwitchSnap();
void slotRenderProject();
void slotFullScreen();
void slotUpdateDocumentState(bool modified);
void slotZoomIn();
void slotZoomOut();
void slotFitZoom();
void closeCurrentDocument(bool saveChanges = true);
void slotDeleteTimelineClip();
void slotAddClipMarker();
void slotDeleteClipMarker();
void slotDeleteAllClipMarkers();
void slotEditClipMarker();
void slotCutTimelineClip();
void slotInsertClipOverwrite();
void slotSelectTimelineClip();
void slotSelectTimelineTransition();
void slotDeselectTimelineClip();
void slotDeselectTimelineTransition();
void slotSelectAddTimelineClip();
void slotSelectAddTimelineTransition();
void slotAddVideoEffect(QAction *result);
void slotAddAudioEffect(QAction *result);
void slotAddCustomEffect(QAction *result);
void slotAddTransition(QAction *result);
void slotAddProjectClip(KUrl url);
#ifndef NO_JOGSHUTTLE
void slotShuttleButton(int code);
#endif /* NO_JOGSHUTTLE */
void slotShowClipProperties(DocClipBase *clip);
void slotShowClipProperties(QList <DocClipBase *>cliplist, QMap<QString, QString> commonproperties);
void slotActivateEffectStackView();
void slotActivateTransitionView(Transition *);
void slotChangeTool(QAction * action);
void slotChangeEdit(QAction * action);
void slotSetTool(PROJECTTOOL tool);
void slotSnapForward();
void slotSnapRewind();
void slotClipStart();
void slotClipEnd();
void slotZoneStart();
void slotZoneEnd();
void slotFind();
void findTimeout();
void slotFindNext();
void slotInsertSpace();
void slotRemoveSpace();
void slotAddGuide();
void slotEditGuide();
void slotDeleteGuide();
void slotDeleteAllGuides();
void slotGuidesUpdated();
void slotCopy();
void slotPaste();
void slotPasteEffects();
void slotReloadEffects();
void slotAdjustClipMonitor();
void slotAdjustProjectMonitor();
void slotSaveZone(Render *render, QPoint zone);
void slotSetInPoint();
void slotSetOutPoint();
void slotResizeItemStart();
void slotResizeItemEnd();
void configureNotifications();
void slotInsertTrack(int ix = 0);
void slotDeleteTrack(int ix = 0);
void slotChangeTrack(int ix = 0);
void slotGetNewLumaStuff();
void slotGetNewTitleStuff();
void slotGetNewRenderStuff();
void slotGetNewMltProfileStuff();
void slotAutoTransition();
void slotRunWizard();
void generateClip();
void slotZoneMoved(int start, int end);
void slotUpdatePreviewSettings();
void slotDvdWizard(const QString &url = QString(), const QString &profile = "dv_pal");
void slotGroupClips();
void slotUnGroupClips();
void slotSplitAudio();
void slotUpdateClipType(QAction *action);
void slotShowTimeline(bool show);
void slotMaximizeCurrent(bool show);
void slotTranscode(KUrl::List urls = KUrl::List());
void slotTranscodeClip();
void slotSetDocumentRenderProfile(const QString &dest, const QString &group, const QString &name, const QString &file);
void slotPrepareRendering(bool scriptExport, bool zoneOnly, const QString &chapterFile);
void slotUpdateTimecodeFormat(int ix);
/** Removes the focus of anything */
void slotRemoveFocus();
void slotCleanProject();
void slotSetZoom(int value);
void slotUpdateClipMarkers(DocClipBase *clip);
void slotRevert();
void slotShutdown();
void slotUpdateTrackInfo();
/** \brief Change color scheme */
void slotChangePalette(QAction *action, const QString &themename = QString());
void slotSwitchMonitors();
void slotInsertZoneToTree();
void slotInsertZoneToTimeline();
void slotDeleteProjectClips(QStringList ids, QMap<QString, QString> folderids);
signals:
Q_SCRIPTABLE void abortRenderJob(const QString &url);
};
#endif