]> git.sesse.net Git - kdenlive/blobdiff - src/monitorscene.h
Some progress on the stop motion widget (improve management of existing sequences...
[kdenlive] / src / monitorscene.h
index 65237539943975f8892b177db4ca0241143a8b32..8831eb9ac246c8adb0c81c45fd03c3065215807a 100644 (file)
 
 class Render;
 
-enum resizeModes { NoResize, TopLeft, BottomLeft, TopRight, BottomRight, Left, Right, Top, Bottom };
 
 class MonitorScene : public QGraphicsScene
 {
     Q_OBJECT
 public:
     MonitorScene(Render *renderer, QObject* parent = 0);
+
+    /** @brief Sets m_view to this scenes view. */
     void setUp();
+
+    /** @brief Enables/Disables the scene for usage (background still updated).
+     * @param enabled (default = true) */
     void setEnabled(bool enabled = true);
-    bool getDirectUpdate();
+
+    /** @brief Makes the background frame fit again after the profile changed (and therefore the resolution might have changed). */
     void resetProfile();
 
+    /** @brief Adds an item to the scene and connects mouse events + change signals if it is a onmonitor item. */
+    void addItem(QGraphicsItem *item);
+
 protected:
+    /** @brief Emits signal mousePressed to be used in onmonitor items. */
     virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
+    /** @brief Emits signal mouseMoveEvent to be used in onmonitor items. */
     virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
+    /** @brief Emits signal mouseReleaseEvent to be used in onmonitor items. */
     virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
+    /** @brief Adds a keyframe if scene is disabled. */
+    virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
 
 public slots:
-    void slotUpdateBackground(bool fit = false);
+    /** @brief Sets the backgrounditem's pixmap to m_backgroundImage (only if a certain amount of time has passed since last update). */
+    void slotUpdateBackground();
+    
+    /** @brief Sets the KdenliveSetting directupdate with true = update parameters (rerender frame) during mouse move (before mouse button is released) */
     void slotSetDirectUpdate(bool directUpdate);
 
+    /** @brief Sets the scene's zoom level.
+     * @param value zoom level with 100 = show frame at original size */
+    void slotZoom(int value);
+    /** @brief Makes the zoom level fit the viewport's size. */
+    void slotZoomFit();
+    /** @brief Shows the frame at it's original size and center. */
+    void slotZoomOriginal();
+    /** @brief Zooms in by 1%. */
+    void slotZoomIn();
+    /** @brief Zooms out by 1%. */
+    void slotZoomOut();
+
 private slots:
-    void slotSetBackgroundImage(QImage image);
+    /** @brief Sets m_backgroundImage to @param image and requests updating the background item. */
+    void slotSetBackgroundImage(const QImage &image);
+    /** @brief Sets the mouse curors to @param cursor for the scene. */
+    void slotSetCursor(const QCursor &cursor);
 
 private:
-    resizeModes getResizeMode(QGraphicsRectItem *item, QPoint pos);
-
     Render *m_renderer;
     QGraphicsPixmapItem *m_background;
     QGraphicsRectItem *m_frameBorder;
     QTime m_lastUpdate;
     QGraphicsView *m_view;
-    QGraphicsItem *m_selectedItem;
-    resizeModes m_resizeMode;
-    QPointF m_clickPoint;
     QImage m_backgroundImage;
     bool m_enabled;
-    bool m_modified;
-    bool m_directUpdate;
+    qreal m_zoom;
 
 signals:
     void actionFinished();
+    void zoomChanged(int);
+    void addKeyframe();
+    void mouseMoved(QGraphicsSceneMouseEvent *event);
+    void mousePressed(QGraphicsSceneMouseEvent *event);
+    void mouseReleased(QGraphicsSceneMouseEvent *event);
 };
 
 #endif