]> git.sesse.net Git - kdenlive/blob - src/mainwindow.h
new icons, snapping can now be en/disabled
[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 #include "statusbarmessagelabel.h"
42
43 class KdenliveDoc;
44 class TrackView;
45 class MonitorManager;
46 class ProjectList;
47 class EffectsListView;
48 class EffectStackView;
49 class TransitionSettings;
50 class Monitor;
51 class RecMonitor;
52 class CustomTrackView;
53 class RenderWidget;
54 class JogShuttle;
55 class DocClipBase;
56
57 class MainWindow : public KXmlGuiWindow {
58     Q_OBJECT
59
60 public:
61     MainWindow(QWidget *parent = 0);
62     void parseProfiles();
63
64     static EffectsList videoEffects;
65     static EffectsList audioEffects;
66     static EffectsList customEffects;
67     static EffectsList transitions;
68 protected:
69     virtual bool queryClose();
70     virtual void customEvent(QEvent * e);
71
72 private:
73     KTabWidget* m_timelineArea;
74     QProgressBar *statusProgressBar;
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     QAction *m_buttonSnap;
128     QActionGroup *m_toolGroup;
129     QSlider *m_zoomSlider;
130     StatusBarMessageLabel *m_messageLabel;
131
132     void readOptions();
133     void saveOptions();
134     void activateShuttleDevice();
135     void slotShuttleAction(int code);
136     void connectDocumentInfo(KdenliveDoc *doc);
137
138 public slots:
139     void openFile(const KUrl &url);
140     void slotGotProgressInfo(const QString &message, int progress);
141
142 private slots:
143     void newFile();
144     void undo();
145     void redo();
146     void queryQuit();
147     void activateDocument();
148     void connectDocument(TrackView*, KdenliveDoc*);
149     void openFile();
150     void saveFile();
151     void saveFileAs();
152     void saveFileAs(const QString &outputFileName);
153     void slotPreferences();
154     void updateConfiguration();
155     void slotConnectMonitors();
156     void slotRaiseMonitor(bool clipMonitor);
157     void slotSetClipDuration(int id, int duration);
158     void slotUpdateMousePosition(int pos);
159     void slotAddEffect(QDomElement effect, GenTime pos = GenTime(), int track = -1);
160     void slotEditProfiles();
161     void slotEditProjectSettings();
162     void slotDisplayActionMessage(QAction *a);
163     void slotSwitchVideoThumbs();
164     void slotSwitchAudioThumbs();
165     void slotSwitchMarkersComments();
166         void slotSwitchSnap();
167     void slotRenderProject();
168     void slotDoRender(const QString &dest, const QString &render, const QStringList &avformat_args, bool zoneOnly, bool playAfter);
169     void slotFullScreen();
170     void slotUpdateDocumentState(bool modified);
171     void slotZoomIn();
172     void slotZoomOut();
173     void slotFitZoom();
174     void slotRemoveTab();
175     void slotDeleteTimelineClip();
176     void slotAddClipMarker();
177     void slotDeleteClipMarker();
178     void slotEditClipMarker();
179     void slotCutTimelineClip();
180     void slotAddVideoEffect(QAction *result);
181     void slotAddAudioEffect(QAction *result);
182     void slotAddCustomEffect(QAction *result);
183     void slotAddTransition(QAction *result);
184     void slotAddProjectClip(KUrl url);
185     void slotShuttleButton(int code);
186     void slotShowClipProperties(DocClipBase *clip);
187     void slotActivateEffectStackView();
188     void slotActivateTransitionView();
189     void slotChangeTool(QAction * action);
190     void slotSetTool(PROJECTTOOL tool);
191     void slotSnapForward();
192     void slotSnapRewind();
193 };
194
195 #endif