]> git.sesse.net Git - kdenlive/blobdiff - src/renderer.h
Fix several problems with clip crop start, fix undo transition deletion, set monitor...
[kdenlive] / src / renderer.h
index 7c8bd0317caf45748695258e5787c0c326811535..979ab46a4977a8aef433c8a4b92133690246bad6 100644 (file)
@@ -31,8 +31,6 @@
 #include "effectdesc.h"
 #include "effectparamdescfactory.h"*/
 
-#include <mlt++/Mlt.h>
-
 /**Render encapsulates the client side of the interface to a renderer.
 From Kdenlive's point of view, you treat the Render object as the
 renderer, and simply use it as if it was local. Calls are asyncrhonous -
@@ -71,14 +69,15 @@ Q_OBJECT public:
     /** Seeks the renderer clip to the given time. */
     void seek(GenTime time);
     void seekToFrame(int pos);
+    bool m_isBlocked;
 
-    static QPixmap getVideoThumbnail(char *profile, QString file, int frame, int width, int height);
+    //static QPixmap getVideoThumbnail(char *profile, QString file, int frame, int width, int height);
     QPixmap getImageThumbnail(KUrl url, int width, int height);
 
     /** Return thumbnail for color clip */
     //void getImage(int id, QString color, QPoint size);
 
-    static QPixmap frameThumbnail(Mlt::Frame *frame, int width, int height, bool border = false);
+    // static QPixmap frameThumbnail(Mlt::Frame *frame, int width, int height, bool border = false);
 
     /** Return thumbnail for image clip */
     //void getImage(KUrl url, QPoint size);
@@ -95,7 +94,7 @@ Q_OBJECT public:
     void setSceneList(QDomDocument list, int position = 0);
     void setSceneList(QString playlist, int position = 0);
     QString sceneList();
-    void saveSceneList(QString path);
+    void saveSceneList(QString path, QDomElement kdenliveData = QDomElement());
 
     /** Wraps the VEML command of the same name. Tells the renderer to
     play the current scene at the speed specified, relative to normal
@@ -107,7 +106,7 @@ Q_OBJECT public:
     void stop(const GenTime & startTime);
     void setVolume(double volume);
 
-    QPixmap extractFrame(int frame_position, int width, int height);
+    QPixmap extractFrame(int frame_position, int width = -1, int height = -1);
     /** Wraps the VEML command of the same name. Tells the renderer to
     play the current scene at the speed specified, relative to normal
     playback. e.g. 1.0 is normal speed, 0.0 is paused, -1.0 means play
@@ -126,7 +125,7 @@ Q_OBJECT public:
     not playing anything. */
     double playSpeed();
     /** Returns the current seek position of the renderer. */
-    const GenTime & seekPosition() const;
+    GenTime seekPosition() const;
 
     void emitFrameNumber(double position);
     void emitConsumerStopped();
@@ -144,21 +143,30 @@ Q_OBJECT public:
     void refreshDisplay();
     int resetProfile(QString profile);
     const double fps() const;
+    const int renderWidth() const;
+    const int renderHeight() const;
+    /** get display aspect ratio */
+    const double dar() const;
 
     /** Playlist manipulation */
-    void mltInsertClip(int track, GenTime position, QDomElement element);
+    void mltInsertClip(int track, GenTime position, GenTime crop, QDomElement element);
+    void mltUpdateClip(int track, GenTime position, GenTime crop, QDomElement element);
     void mltCutClip(int track, GenTime position);
     void mltResizeClipEnd(int track, GenTime pos, GenTime in, GenTime out);
     void mltResizeClipStart(int track, GenTime pos, GenTime moveEnd, GenTime moveStart, GenTime in, GenTime out);
-    void mltMoveClip(int startTrack, int endTrack, GenTime pos, GenTime moveStart);
-    void mltMoveClip(int startTrack, int endTrack, int pos, int moveStart);
+    bool mltMoveClip(int startTrack, int endTrack, GenTime pos, GenTime moveStart);
+    bool mltMoveClip(int startTrack, int endTrack, int pos, int moveStart);
     void mltRemoveClip(int track, GenTime position);
-    void mltRemoveEffect(int track, GenTime position, QString index, bool doRefresh = true);
-    void mltAddEffect(int track, GenTime position, QMap <QString, QString> args, bool doRefresh = true);
-    void mltEditEffect(int track, GenTime position, QMap <QString, QString> args);
+    bool mltRemoveEffect(int track, GenTime position, QString index, bool doRefresh = true);
+    bool mltAddEffect(int track, GenTime position, QMap <QString, QString> args, bool doRefresh = true);
+    bool mltEditEffect(int track, GenTime position, QMap <QString, QString> args);
+    void mltMoveEffect(int track, GenTime position, int oldPos, int newPos);
     void mltChangeTrackState(int track, bool mute, bool blind);
-    void mltMoveTransition(QString type, int startTrack, int trackOffset, GenTime oldIn, GenTime oldOut, GenTime newIn, GenTime newOut);
-    void mltAddTransition(QString tag, int a_track, int b_track, GenTime in, GenTime out, QMap <QString, QString> args);
+    void mltMoveTransition(QString type, int startTrack,  int newTrack, int newTransitionTrack, GenTime oldIn, GenTime oldOut, GenTime newIn, GenTime newOut);
+    void mltAddTransition(QString tag, int a_track, int b_track, GenTime in, GenTime out, QDomElement xml, bool refresh = true);
+    void mltDeleteTransition(QString tag, int a_track, int b_track, GenTime in, GenTime out, QDomElement xml, bool refresh = true);
+    void mltUpdateTransition(QString oldTag, QString tag, int a_track, int b_track, GenTime in, GenTime out, QDomElement xml);
+    void mltUpdateTransitionParams(QString type, int a_track, int b_track, GenTime in, GenTime out, QDomElement xml);
 
 
 private:   // Private attributes & methods
@@ -173,14 +181,12 @@ private:   // Private attributes & methods
     double m_fps;
     uint m_monitorId;
     bool m_generateScenelist;
-    bool m_isBlocked;
 
     /** Holds the path to on screen display profile */
     QString m_osdProfile;
 
     QTimer *refreshTimer;
     QTimer *osdTimer;
-    QTimer *m_connectTimer;
     KUrl m_exportedFile;
     int exportDuration, firstExportFrame, lastExportFrame;
 
@@ -194,14 +200,15 @@ private:   // Private attributes & methods
     /** Sets the description of this renderer to desc. */
     void setDescription(const QString & description);
     void closeMlt();
-    void mltCheckLength();
+    void mltCheckLength(bool reload = true);
+    QMap<QString, QString> mltGetTransitionParamsFromXml(QDomElement xml);
 
 private slots:  // Private slots
     /** refresh monitor display */
     void refresh();
     void slotOsdTimeout();
     void connectPlaylist();
-    void initSceneList();
+    //void initSceneList();
 
 signals:   // Signals
     /** emitted when the renderer recieves a reply to a getFileProperties request. */