]> git.sesse.net Git - kdenlive/blobdiff - src/monitor.h
Use enum instead of string to identify monitors
[kdenlive] / src / monitor.h
index ecf7df82cbb6768ff3f19101e38d83fecbf54998..8794c89c542ed82ccb3036bec90115469d342136 100644 (file)
 
 
 #include "gentime.h"
+#include "renderer.h"
+#include "definitions.h"
 #include "timecodedisplay.h"
-#if defined(Q_WS_MAC) || defined(USE_OPEN_GL)
+#include "abstractmonitor.h"
+#ifdef USE_OPENGL
 #include "videoglwidget.h"
 #endif
 
 #include <KAction>
 #include <KRestrictedLine>
 
-
-class MonitorManager;
-class Render;
 class SmallRuler;
 class DocClipBase;
 class AbstractClipItem;
 class Transition;
 class ClipItem;
 class MonitorEditWidget;
-
 class Monitor;
+class MonitorManager;
 
 class VideoContainer : public QFrame
 {
@@ -57,9 +57,7 @@ public:
 
 protected:
     virtual void mouseDoubleClickEvent(QMouseEvent * event);
-    virtual void mousePressEvent(QMouseEvent * event);
     virtual void mouseReleaseEvent(QMouseEvent *event);
-    virtual void mouseMoveEvent(QMouseEvent *event);
     void keyPressEvent(QKeyEvent *event);
     virtual void wheelEvent(QWheelEvent * event);
 
@@ -75,16 +73,8 @@ public:
     MonitorRefresh(QWidget *parent = 0);
     void setRenderer(Render* render);
 
-protected:
-    virtual void paintEvent(QPaintEvent *event);
-
 private:
     Render *m_renderer;
-
-signals:
-    void switchFullScreen();
-    void switchPlay();
-    void mouseSeek(int, bool);
 };
 
 class Overlay : public QLabel
@@ -96,18 +86,26 @@ public:
 
 private:
     bool m_isZone;
+
+protected:
+    virtual void mouseDoubleClickEvent ( QMouseEvent * event );
+    virtual void mousePressEvent ( QMouseEvent * event );
+    virtual void mouseReleaseEvent ( QMouseEvent * event );
+    
+signals:
+    void editMarker();
 };
 
-class Monitor : public QWidget
+class Monitor : public AbstractMonitor
 {
     Q_OBJECT
 
 public:
-    Monitor(QString name, MonitorManager *manager, QString profile = QString(), QWidget *parent = 0);
-    virtual ~Monitor();
+    Monitor(Kdenlive::MONITORID id, MonitorManager *manager, QString profile = QString(), QWidget *parent = 0);
+    ~Monitor();
     Render *render;
-    void resetProfile(const QString profile);
-    QString name() const;
+    AbstractRender *abstractRender();
+    void resetProfile(const QString &profile);
     void resetSize();
     bool isActive() const;
     void pause();
@@ -120,11 +118,14 @@ public:
     void updateMarkers(DocClipBase *source);
     MonitorEditWidget *getEffectEdit();
     QWidget *container();
+    void reloadProducer(const QString &id);
     QFrame *m_volumePopup;
 
 protected:
     virtual void mousePressEvent(QMouseEvent * event);
     virtual void mouseReleaseEvent(QMouseEvent * event);
+    virtual void mouseDoubleClickEvent(QMouseEvent * event);
+    virtual void resizeEvent(QResizeEvent *event);
 
     /** @brief Move to another position on mouse wheel event.
      *
@@ -141,12 +142,11 @@ protected:
     //virtual void paintEvent(QPaintEvent * event);
 
 private:
-    QString m_name;
+    Kdenlive::MONITORID m_name;
     MonitorManager *m_monitorManager;
     DocClipBase *m_currentClip;
     SmallRuler *m_ruler;
     Overlay *m_overlay;
-    bool m_isActive;
     double m_scale;
     int m_length;
     bool m_dragStarted;
@@ -169,7 +169,8 @@ private:
     /** true if selected clip is transition, false = selected clip is clip.
      *  Necessary because sometimes we get two signals, e.g. we get a clip and we get selected transition = NULL. */
     bool m_loopClipTransition;
-#if defined(Q_WS_MAC) || defined(USE_OPEN_GL)
+
+#ifdef USE_OPENGL
     VideoGLWidget *m_glWidget;
     bool createOpenGlWidget(QWidget *parent, const QString profile);
 #endif
@@ -179,6 +180,7 @@ private:
     QToolBar *m_toolbar;
     QWidget *m_volumeWidget;
     QSlider *m_audioSlider;
+    QAction *m_editMarker;
 
 private slots:
     void seekCursor(int pos);
@@ -195,16 +197,19 @@ private slots:
     void slotGoToMarker(QAction *action);
     void slotSetVolume(int volume);
     void slotShowVolume();
+    void slotEditMarker();
+    void slotExtractCurrentZone();
 
 public slots:
     void slotOpenFile(const QString &);
-    void slotSetXml(DocClipBase *clip, QPoint zone = QPoint(), const int position = -1);
+    void slotSetClipProducer(DocClipBase *clip, QPoint zone = QPoint(), bool forceUpdate = false, int position = -1);
+    void updateClipProducer(Mlt::Producer *prod);
     void refreshMonitor(bool visible);
     void refreshMonitor();
     void slotSeek(int pos);
     void stop();
     void start();
-    void activateMonitor();
+    bool activateMonitor();
     void slotPlay();
     void slotPlayZone();
     void slotLoopZone();
@@ -240,13 +245,15 @@ public slots:
 signals:
     void renderPosition(int);
     void durationChanged(int);
-    void refreshClipThumbnail(const QString &);
+    void refreshClipThumbnail(const QString &, bool);
     void adjustMonitorSize();
     void zoneUpdated(QPoint);
-    void saveZone(Render *, QPoint);
+    void saveZone(Render *, QPoint, DocClipBase *);
     /** @brief  Editing transitions / effects over the monitor requires the renderer to send frames as QImage.
      *      This causes a major slowdown, so we only enable it if required */
     void requestFrameForAnalysis(bool);
+    /** @brief Request a zone extraction (ffmpeg transcoding). */
+    void extractZone(const QString &id, QPoint zone);
 };
 
 #endif