]> git.sesse.net Git - kdenlive/blob - src/mainwindow.h
ee58677a7e2770f0d441f5fd881cc7a13d325f26
[kdenlive] / src / mainwindow.h
1 /***************************************************************************
2  *   Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org)        *
3  *                                                                         *
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.                                   *
8  *                                                                         *
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.                          *
13  *                                                                         *
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  ***************************************************************************/
19
20
21 #ifndef MAINWINDOW_H
22 #define MAINWINDOW_H
23
24 #include <QDockWidget>
25 #include <QUndoView>
26 #include <QLabel>
27 #include <QProgressBar>
28 #include <QEvent>
29
30 #include <KXmlGuiWindow>
31 #include <KTextEdit>
32 #include <KListWidget>
33 #include <KTabWidget>
34 #include <KUndoStack>
35 #include <KRecentFilesAction>
36 #include <KComboBox>
37
38 #include "effectslist.h"
39 #include "gentime.h"
40 #include "definitions.h"
41
42 class KdenliveDoc;
43 class TrackView;
44 class MonitorManager;
45 class ProjectList;
46 class EffectsListView;
47 class EffectStackView;
48 class TransitionSettings;
49 class Monitor;
50 class RecMonitor;
51 class CustomTrackView;
52 class RenderWidget;
53 class JogShuttle;
54 class DocClipBase;
55
56 class MainWindow : public KXmlGuiWindow {
57     Q_OBJECT
58
59 public:
60     MainWindow(QWidget *parent = 0);
61     void parseProfiles();
62
63     static EffectsList videoEffects;
64     static EffectsList audioEffects;
65     static EffectsList customEffects;
66     static EffectsList transitions;
67 protected:
68     virtual bool queryClose();
69     virtual void customEvent(QEvent * e);
70
71 private:
72     KTabWidget* m_timelineArea;
73     QProgressBar *statusProgressBar;
74     QLabel* statusLabel;
75     void setupActions();
76     KdenliveDoc *m_activeDocument;
77     TrackView *m_activeTimeline;
78     MonitorManager *m_monitorManager;
79
80     QDockWidget *projectListDock;
81     ProjectList *m_projectList;
82
83     QDockWidget *effectListDock;
84     EffectsListView *m_effectList;
85     //KListWidget *m_effectList;
86
87     QDockWidget *effectStackDock;
88     EffectStackView *effectStack;
89
90     QDockWidget *transitionConfigDock;
91     TransitionSettings *transitionConfig;
92
93     QDockWidget *clipMonitorDock;
94     Monitor *m_clipMonitor;
95
96     QDockWidget *projectMonitorDock;
97     Monitor *m_projectMonitor;
98
99     QDockWidget *recMonitorDock;
100     RecMonitor *m_recMonitor;
101
102     QDockWidget *undoViewDock;
103     QUndoView *m_undoView;
104     QUndoGroup *m_commandStack;
105
106     KComboBox *m_timecodeFormat;
107
108     QDockWidget *overviewDock;
109     CustomTrackView *m_overView;
110
111     QMenu *m_timelineContextMenu;
112     QMenu *m_timelineContextClipMenu;
113     QMenu *m_timelineContextTransitionMenu;
114
115     RenderWidget *m_renderWidget;
116
117     JogShuttle *m_jogProcess;
118
119     KRecentFilesAction *m_fileOpenRecent;
120
121     QAction *m_buttonAudioThumbs;
122     QAction *m_buttonVideoThumbs;
123     QAction *m_buttonShowMarkers;
124     QAction *m_buttonFitZoom;
125     QAction *m_buttonSelectTool;
126     QAction *m_buttonRazorTool;
127     QActionGroup *m_toolGroup;
128     QSlider *m_zoomSlider;
129
130     void readOptions();
131     void saveOptions();
132     void activateShuttleDevice();
133     void slotShuttleAction(int code);
134
135 public slots:
136     void openFile(const KUrl &url);
137
138 private slots:
139     void newFile();
140     void undo();
141     void redo();
142     void queryQuit();
143     void activateDocument();
144     void connectDocument(TrackView*, KdenliveDoc*);
145     void openFile();
146     void saveFile();
147     void saveFileAs();
148     void saveFileAs(const QString &outputFileName);
149     void slotPreferences();
150     void updateConfiguration();
151     void slotConnectMonitors();
152     void slotRaiseMonitor(bool clipMonitor);
153     void slotSetClipDuration(int id, int duration);
154     void slotUpdateMousePosition(int pos);
155     void slotAddEffect(QDomElement effect, GenTime pos = GenTime(), int track = -1);
156     void slotEditProfiles();
157     void slotEditProjectSettings();
158     void slotDisplayActionMessage(QAction *a);
159     void slotGotProgressInfo(KUrl url, int progress);
160     void slotSwitchVideoThumbs();
161     void slotSwitchAudioThumbs();
162     void slotSwitchMarkersComments();
163     void slotRenderProject();
164     void slotDoRender(const QString &dest, const QString &render, const QStringList &avformat_args, bool zoneOnly, bool playAfter);
165     void slotFullScreen();
166     void slotUpdateDocumentState(bool modified);
167     void slotZoomIn();
168     void slotZoomOut();
169     void slotFitZoom();
170     void slotRemoveTab();
171     void slotDeleteTimelineClip();
172     void slotAddClipMarker();
173     void slotCutTimelineClip();
174     void slotAddVideoEffect(QAction *result);
175     void slotAddAudioEffect(QAction *result);
176     void slotAddCustomEffect(QAction *result);
177     void slotAddProjectClip(KUrl url);
178     void slotShuttleButton(int code);
179     void slotShowClipProperties(DocClipBase *clip);
180     void slotActivateEffectStackView();
181     void slotActivateTransitionView();
182     void slotChangeTool(QAction * action);
183     void slotSetTool(PROJECTTOOL tool);
184     void slotSnapForward();
185     void slotSnapRewind();
186 };
187
188 #endif