[vlmc-devel] commit: Fixing clip effects moving. ( Hugo Beauzée-Luyssen )

git at videolan.org git at videolan.org
Wed Sep 15 18:35:06 CEST 2010


vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Wed Sep 15 12:14:30 2010 +0200| [64530b35fadf1552ffdf528c6753f850cd7159b8] | committer: Hugo Beauzée-Luyssen 

Fixing clip effects moving.

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=64530b35fadf1552ffdf528c6753f850cd7159b8
---

 src/EffectsEngine/EffectUser.cpp |    2 +-
 src/EffectsEngine/EffectUser.h   |    2 +-
 src/Workflow/TrackWorkflow.cpp   |   18 ++++++++++++------
 src/Workflow/TrackWorkflow.h     |    2 +-
 4 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/src/EffectsEngine/EffectUser.cpp b/src/EffectsEngine/EffectUser.cpp
index fdcff54..f13ba34 100644
--- a/src/EffectsEngine/EffectUser.cpp
+++ b/src/EffectsEngine/EffectUser.cpp
@@ -312,7 +312,7 @@ EffectUser::moveEffect( EffectHelper *helper, qint64 newPos )
         {
             qint64  offset = helper->begin() - newPos;
             helper->setBoundaries( newPos, helper->end() - offset );
-            emit effectMoved( helper->uuid(), newPos );
+            emit effectMoved( helper, newPos );
             return ;
         }
     }
diff --git a/src/EffectsEngine/EffectUser.h b/src/EffectsEngine/EffectUser.h
index c63add8..8b6c54c 100644
--- a/src/EffectsEngine/EffectUser.h
+++ b/src/EffectsEngine/EffectUser.h
@@ -92,7 +92,7 @@ class EffectUser : public QObject
 
     signals:
         void                                    effectAdded( EffectHelper *helper, qint64 pos );
-        void                                    effectMoved( const QUuid&, qint64 newPos );
+        void                                    effectMoved( EffectHelper *helper, qint64 newPos );
         void                                    effectRemoved( const QUuid& );
 };
 
diff --git a/src/Workflow/TrackWorkflow.cpp b/src/Workflow/TrackWorkflow.cpp
index 4ced295..6d64298 100644
--- a/src/Workflow/TrackWorkflow.cpp
+++ b/src/Workflow/TrackWorkflow.cpp
@@ -54,8 +54,8 @@ TrackWorkflow::TrackWorkflow( Workflow::TrackType type, quint32 trackId  ) :
 
     connect( this, SIGNAL( effectAdded( EffectHelper*, qint64 ) ),
              this, SLOT( __effectAdded( EffectHelper*, qint64) ) );
-    connect( this, SIGNAL( effectMoved( QUuid, qint64 ) ),
-             this, SLOT( __effectMoved( QUuid, qint64 ) ) );
+    connect( this, SIGNAL( effectMoved( EffectHelper*, qint64 ) ),
+             this, SLOT( __effectMoved( EffectHelper*, qint64 ) ) );
     connect( this, SIGNAL( effectRemoved( QUuid ) ),
              this, SLOT( __effectRemoved(QUuid ) ) );
 }
@@ -99,8 +99,8 @@ TrackWorkflow::addClip( ClipWorkflow* cw, qint64 start )
     m_clips.insert( start, cw );
     connect( cw, SIGNAL( effectAdded( EffectHelper*, qint64 ) ),
              this, SLOT( __effectAdded( EffectHelper*, qint64 ) ) );
-    connect( cw, SIGNAL( effectMoved( QUuid, qint64 ) ),
-             this, SLOT( __effectMoved( QUuid, qint64) ) );
+    connect( cw, SIGNAL( effectMoved( EffectHelper*, qint64 ) ),
+             this, SLOT( __effectMoved( EffectHelper*, qint64) ) );
     connect( cw, SIGNAL( effectRemoved( QUuid ) ),
              this, SLOT( __effectRemoved( QUuid ) ) );
     emit clipAdded( this, cw->getClipHelper(), start );
@@ -652,9 +652,15 @@ TrackWorkflow::__effectRemoved( const QUuid& uuid )
 }
 
 void
-TrackWorkflow::__effectMoved( const QUuid& uuid, qint64 pos )
+TrackWorkflow::__effectMoved( EffectHelper* helper, qint64 pos )
 {
-    emit effectMoved( this, uuid, pos );
+    if ( helper->target()->effectType() == ClipEffectUser )
+    {
+        ClipWorkflow    *cw = qobject_cast<ClipWorkflow*>( helper->target() );
+        Q_ASSERT( cw != NULL );
+        pos += getClipPosition( cw->getClipHelper()->uuid() );
+    }
+    emit effectMoved( this, helper->uuid(), pos );
 }
 
 qint64
diff --git a/src/Workflow/TrackWorkflow.h b/src/Workflow/TrackWorkflow.h
index 7cef77c..1012895 100644
--- a/src/Workflow/TrackWorkflow.h
+++ b/src/Workflow/TrackWorkflow.h
@@ -135,7 +135,7 @@ class   TrackWorkflow : public EffectUser
     private slots:
         void                __effectAdded( EffectHelper*, qint64 );
         void                __effectRemoved( const QUuid& );
-        void                __effectMoved( const QUuid&, qint64 );
+        void                __effectMoved( EffectHelper*, qint64 );
 
     signals:
         void                lengthChanged( qint64 newLength );



More information about the Vlmc-devel mailing list