]> git.sesse.net Git - kdenlive/blobdiff - src/mainwindow.h
Fix issue 254: starting up with project supplied on CLI should not result in 'Untitle...
[kdenlive] / src / mainwindow.h
index 5be8803f05dd0ccc6acc7913056bc21c3744f0bd..f629ce8d007562389b7109dbdf0cb0b101836284 100644 (file)
 
 #ifndef MAINWINDOW_H
 #define MAINWINDOW_H
+
 #include <QDockWidget>
 #include <QUndoView>
 #include <QLabel>
 #include <QProgressBar>
+#include <QEvent>
+#include <QTimer>
 
 #include <KXmlGuiWindow>
 #include <KTextEdit>
 #include <KUndoStack>
 #include <KRecentFilesAction>
 #include <KComboBox>
+#include <kautosavefile.h>
 
-#include "projectlist.h"
-#include "monitor.h"
-#include "monitormanager.h"
-#include "kdenlivedoc.h"
-#include "trackview.h"
-#include "customtrackview.h"
 #include "effectslist.h"
-#include "effectslistview.h"
-#include "effectstackview.h"
+#include "gentime.h"
+#include "definitions.h"
+#include "statusbarmessagelabel.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 MainWindow : public KXmlGuiWindow {
+    Q_OBJECT
 
-class MainWindow : public KXmlGuiWindow
-{
-  Q_OBJECT
-  
-  public:
-    MainWindow(QWidget *parent=0);
+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. */
+    MainWindow(const QString &MltPath = QString(), const KUrl & Url = KUrl(), QWidget *parent = 0);
+    void parseProfiles(const QString &mltPath = QString());
 
-    void parseProfiles();
-    void customEvent ( QEvent * event );
-  protected:
+    static EffectsList videoEffects;
+    static EffectsList audioEffects;
+    static EffectsList customEffects;
+    static EffectsList transitions;
+protected:
     virtual bool queryClose();
-  
-  private:
+    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.
+     */
+    void saveProperties(KConfig *);
+
+    /**
+     * 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
+     */
+    void readProperties(KConfig *);
+
+private:
     KTabWidget* m_timelineArea;
     QProgressBar *statusProgressBar;
-    QLabel* statusLabel;
     void setupActions();
-    QString fileName;
     KdenliveDoc *m_activeDocument;
+    TrackView *m_activeTimeline;
     MonitorManager *m_monitorManager;
 
     QDockWidget *projectListDock;
@@ -77,7 +117,7 @@ class MainWindow : public KXmlGuiWindow
     EffectStackView *effectStack;
 
     QDockWidget *transitionConfigDock;
-    KListWidget *transitionConfig;
+    TransitionSettings *transitionConfig;
 
     QDockWidget *clipMonitorDock;
     Monitor *m_clipMonitor;
@@ -85,45 +125,145 @@ class MainWindow : public KXmlGuiWindow
     QDockWidget *projectMonitorDock;
     Monitor *m_projectMonitor;
 
+    QDockWidget *recMonitorDock;
+    RecMonitor *m_recMonitor;
+
     QDockWidget *undoViewDock;
     QUndoView *m_undoView;
-    KUndoStack *m_commandStack;
-    QAction *m_undo;
-    QAction *m_redo;
+    QUndoGroup *m_commandStack;
 
     KComboBox *m_timecodeFormat;
 
     QDockWidget *overviewDock;
     CustomTrackView *m_overView;
 
-    EffectsList m_videoEffects;
-    EffectsList m_audioEffects;
-    EffectsList m_customEffects;
+    QMenu *m_customEffectsMenu;
+    QMenu *m_timelineContextMenu;
+    QMenu *m_timelineContextClipMenu;
+    QMenu *m_timelineContextTransitionMenu;
+
+    RenderWidget *m_renderWidget;
+
+#ifndef NO_JOGSHUTTLE
+    JogShuttle *m_jogProcess;
+#endif /* NO_JOGSHUTTLE */
 
     KRecentFilesAction *m_fileOpenRecent;
+    KAction *m_projectSearch;
+    KAction *m_projectSearchNext;
+
+    KAction *m_buttonAudioThumbs;
+    KAction *m_buttonVideoThumbs;
+    KAction *m_buttonShowMarkers;
+    KAction *m_buttonFitZoom;
+    KAction *m_buttonSelectTool;
+    KAction *m_buttonRazorTool;
+    KAction *m_buttonSnap;
+    QActionGroup *m_toolGroup;
+    KAction *m_saveAction;
+    KAction *m_closeAction;
+    QSlider *m_zoomSlider;
+    StatusBarMessageLabel *m_messageLabel;
+
+    bool m_findActivated;
+    QString m_findString;
+    QTimer m_findTimer;
+    bool m_initialized;
+
     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);
 
-  public slots:
+public slots:
     void openFile(const KUrl &url);
+    void slotGotProgressInfo(const QString &message, int progress);
 
-  private slots:
-    void newFile();
+private slots:
+    void newFile(bool showProjectSettings = true);
+    void queryQuit();
     void activateDocument();
     void connectDocument(TrackView*, KdenliveDoc*);
     void openFile();
+    void openLastFile();
     void saveFile();
     void saveFileAs();
     void saveFileAs(const QString &outputFileName);
-    void slotPreferences();
+    void slotPreferences(int page = -1, int option = -1);
+    void updateConfiguration();
     void slotConnectMonitors();
     void slotRaiseMonitor(bool clipMonitor);
-    void slotSetClipDuration(int id, int duration);
+    void slotSetClipDuration(const QString &id, int duration);
     void slotUpdateMousePosition(int pos);
     void slotAddEffect(QDomElement effect, GenTime pos = GenTime(), int track = -1);
     void slotEditProfiles();
     void slotEditProjectSettings();
-    void slotDisplayActionMessage( QAction *a);
+    void slotDisplayActionMessage(QAction *a);
+    void slotSwitchVideoThumbs();
+    void slotSwitchAudioThumbs();
+    void slotSwitchMarkersComments();
+    void slotSwitchSnap();
+    void slotRenderProject();
+    void slotDoRender(const QString &dest, const QString &render, const QStringList &overlay_args, const QStringList &avformat_args, bool zoneOnly, bool playAfter, double guideStart, double guideEnd);
+    void slotFullScreen();
+    void slotUpdateDocumentState(bool modified);
+    void slotZoomIn();
+    void slotZoomOut();
+    void slotFitZoom();
+    void closeCurrentDocument();
+    void slotDeleteTimelineClip();
+    void slotAddClipMarker();
+    void slotDeleteClipMarker();
+    void slotDeleteAllClipMarkers();
+    void slotEditClipMarker();
+    void slotCutTimelineClip();
+    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 slotActivateEffectStackView();
+    void slotActivateTransitionView();
+    void slotChangeTool(QAction * action);
+    void slotSetTool(PROJECTTOOL tool);
+    void slotSnapForward();
+    void slotSnapRewind();
+    void slotClipStart();
+    void slotClipEnd();
+    void slotFind();
+    void findTimeout();
+    void slotFindNext();
+
+    void slotAddGuide();
+    void slotEditGuide();
+    void slotDeleteGuide();
+    void slotDeleteAllGuides();
+    void slotGuidesUpdated();
+
+    void slotCopy();
+    void slotPaste();
+    void slotPasteEffects();
+    void slotReloadEffects();
+    void slotChangeClipSpeed();
+
+    void slotAdjustClipMonitor();
+    void slotAdjustProjectMonitor();
+    void slotSaveZone(Render *render, QPoint zone);
+
+    void slotSetInPoint();
+    void slotSetOutPoint();
+    void configureNotifications();
 };
+
+
 #endif