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