[vlmc-devel] Timeline: Use "position" as an absolute postion in frames to start producing frames.

Yikai Lu git at videolan.org
Mon Jul 11 14:21:22 CEST 2016


vlmc | branch: master | Yikai Lu <luyikei.qmltu at gmail.com> | Mon Jul 11 21:13:16 2016 +0900| [dd6dfcb7d90057dafa3feb9d8a0ce919eaa47b90] | committer: Yikai Lu

Timeline: Use "position" as an absolute postion in frames to start producing frames.

> https://code.videolan.org/videolan/vlmc/commit/dd6dfcb7d90057dafa3feb9d8a0ce919eaa47b90
---

 src/Gui/timeline/Clip.qml  | 9 +++++----
 src/Gui/timeline/Track.qml | 6 +++---
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/Gui/timeline/Clip.qml b/src/Gui/timeline/Clip.qml
index deebed5..73ddcc7 100644
--- a/src/Gui/timeline/Clip.qml
+++ b/src/Gui/timeline/Clip.qml
@@ -3,7 +3,7 @@ import QtQuick 2.0
 Rectangle {
     id: clip
     // NEVER SET X DIRECTLY. BINDING WILL BE REMOVED.
-    x: clipInfo ? ftop( clipInfo["begin"] + clipInfo["position"] ) : 0
+    x: clipInfo ? ftop( clipInfo["position"] ) : 0
     width: clipInfo ? ftop( clipInfo["end"] - clipInfo["begin"] + 1 ) : 0
     z: 10001
     gradient: Gradient {
@@ -34,12 +34,13 @@ Rectangle {
 
     function setPixelPosition( pixels )
     {
-        clipInfo["position"] = ptof( pixels ) - clipInfo["begin"];
+        if ( pixels >= 0 )
+            clipInfo["position"] = ptof( pixels );
     }
 
-    function pixelPosition( pixels )
+    function pixelPosition()
     {
-        return ftop( clipInfo["begin"] + clipInfo["position"] );
+        return ftop( clipInfo["position"] );
     }
 
     function move() {
diff --git a/src/Gui/timeline/Track.qml b/src/Gui/timeline/Track.qml
index ac6c3d1..91a93f4 100644
--- a/src/Gui/timeline/Track.qml
+++ b/src/Gui/timeline/Track.qml
@@ -110,19 +110,19 @@ Item {
                         if ( currentUuid ) {
                             if ( aClipInfo )
                             {
-                                aClipInfo["position"] = ptof( drag.x - ftop( aClipInfo["begin"] ) );
+                                aClipInfo["position"] = ptof( drag.x );
                                 aClipInfo = addClip( "Audio", trackId, aClipInfo );
                             }
                             if ( vClipInfo )
                             {
-                                vClipInfo["position"] = ptof( drag.x - ftop( vClipInfo["begin"] ) );
+                                vClipInfo["position"] = ptof( drag.x );
                                 vClipInfo = addClip( "Video", trackId, vClipInfo );
                             }
                         }
                         else {
                             var newClipInfo = workflow.clipInfo( drag.getDataAsString( "vlmc/uuid" ) );
                             currentUuid = "" + newClipInfo["uuid"];
-                            newClipInfo["position"] = ptof( drag.x - ftop( newClipInfo["begin"] ) );
+                            newClipInfo["position"] = ptof( drag.x );
                             newClipInfo["uuid"] = "tempUuid";
 
                             clearSelectedClips();



More information about the Vlmc-devel mailing list