]> git.sesse.net Git - kdenlive/blobdiff - src/abstractmonitor.h
Cleanup slideshow clip method, prepare for improved sequence support (still needs...
[kdenlive] / src / abstractmonitor.h
index 8365e5b93ab4af86d5c05697050b27e3f7c96e3e..c58ae0e0bb104554815734f062c9542d357daf59 100644 (file)
@@ -36,16 +36,32 @@ class VideoPreviewContainer : public QFrame
 public:
     VideoPreviewContainer(QWidget *parent = 0);
     ~VideoPreviewContainer();
+    /** @brief Set the image to be displayed, will be put in the queue. */
     void setImage(QImage img);
+    /** @brief Start the display refresh timer. */
     void start();
+    /** @brief Stop the display refresh timer. */
     void stop();
+    /** @brief Set the display ratio for this display. */
+    void setRatio(double ratio);
 
 protected:
     virtual void paintEvent(QPaintEvent */*event*/);
+    virtual void resizeEvent(QResizeEvent * event);
 
 private:
+    /** @brief The display aspect ratio for profile. */
+    double m_dar;
+    /** @brief When true, the whole widget surface will be repainted, useful when resizing widget. */
+    bool m_refresh;
+    /** @brief The rectangle defining the area for painting our image. */
+    QRect m_displayRect;
+    /** @brief The queue of images to be displayed. */
     QList <QImage *> m_imageQueue;
+    /** @brief We refresh the image with a timer, since this widget is only for preview during capture. */
     QTimer m_refreshTimer;
+    /** @brief Re-calculate the display zone after a resize or aspect ratio change. */
+    void updateDisplayZone();
 };
 
 
@@ -58,7 +74,7 @@ Q_OBJECT public:
      *  @param name A unique identifier for this renderer
      *  @param winid The parent widget identifier (required for SDL display). Set to 0 for OpenGL rendering
      *  @param profile The MLT profile used for the renderer (default one will be used if empty). */
-    AbstractRender(const QString &name, QWidget *parent = 0):QObject(parent), m_name(name), sendFrameForAnalysis(false) {};
+    AbstractRender(const QString &name, QWidget *parent = 0):QObject(parent), sendFrameForAnalysis(false), m_name(name) {};
 
     /** @brief Destroy the MLT Renderer. */
     virtual ~AbstractRender() {};
@@ -79,7 +95,7 @@ signals:
     void frameUpdated(QImage);
 
     /** @brief This signal contains the audio of the current frame. */
-    void audioSamplesSignal(QVector<int16_t>, int, int, int);
+    void audioSamplesSignal(const QVector<int16_t>&, const int&, const int&, const int&);
 };
 
 class AbstractMonitor : public QWidget