[vlmc-devel] commit: GraphicsEffectItem: Follow the container clip when it changes track ( Hugo Beauzée-Luyssen )

git at videolan.org git at videolan.org
Tue Sep 21 15:29:06 CEST 2010


vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Tue Sep 21 15:28:29 2010 +0200| [85045699e7cdbe17cd65139bb0a7542127235b6e] | committer: Hugo Beauzée-Luyssen 

GraphicsEffectItem: Follow the container clip when it changes track

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

 src/Gui/timeline/AbstractGraphicsItem.cpp |    1 +
 src/Gui/timeline/AbstractGraphicsItem.h   |    8 +++++---
 src/Gui/timeline/GraphicsEffectItem.cpp   |    3 +++
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/Gui/timeline/AbstractGraphicsItem.cpp b/src/Gui/timeline/AbstractGraphicsItem.cpp
index 6adf58a..3d404c7 100644
--- a/src/Gui/timeline/AbstractGraphicsItem.cpp
+++ b/src/Gui/timeline/AbstractGraphicsItem.cpp
@@ -95,6 +95,7 @@ void
 AbstractGraphicsItem::setTrack( GraphicsTrack* track )
 {
     setParentItem( track );
+    emit trackChanged( track );
 }
 
 GraphicsTrack*
diff --git a/src/Gui/timeline/AbstractGraphicsItem.h b/src/Gui/timeline/AbstractGraphicsItem.h
index 3121f3b..10e7f0c 100644
--- a/src/Gui/timeline/AbstractGraphicsItem.h
+++ b/src/Gui/timeline/AbstractGraphicsItem.h
@@ -81,9 +81,6 @@ class AbstractGraphicsItem : public QObject, public QGraphicsItem
         /// Return the current track of the item
         qint32 trackNumber();
 
-        /// Set the item's parent track
-        void setTrack( GraphicsTrack* track );
-
         /// Return the item's parent track
         GraphicsTrack* track();
 
@@ -185,8 +182,13 @@ class AbstractGraphicsItem : public QObject, public QGraphicsItem
          */
         void adjustLength();
 
+        /// Set the item's parent track
+        void setTrack( GraphicsTrack* track );
+
+
     signals:
         void                moved( qint64 pos );
+        void                trackChanged( GraphicsTrack *tracks );
 
         friend class        TracksView;
 
diff --git a/src/Gui/timeline/GraphicsEffectItem.cpp b/src/Gui/timeline/GraphicsEffectItem.cpp
index 3ab91fc..e1190ef 100644
--- a/src/Gui/timeline/GraphicsEffectItem.cpp
+++ b/src/Gui/timeline/GraphicsEffectItem.cpp
@@ -300,6 +300,8 @@ GraphicsEffectItem::setContainer( AbstractGraphicsMediaItem *item )
     if ( item != NULL )
     {
         connect( item, SIGNAL( moved( qint64 ) ), this, SLOT( containerMoved( qint64 ) ) );
+        connect( item, SIGNAL( trackChanged( GraphicsTrack* ) ),
+                 this, SLOT( setTrack( GraphicsTrack* ) ) );
         if ( m_effectHelper->length() > item->helper()->length() )
             m_effectHelper->setBoundaries( 0, item->helper()->length() );
         if ( startPos() < item->pos().x() )
@@ -332,3 +334,4 @@ GraphicsEffectItem::contextMenuEvent( QGraphicsSceneContextMenuEvent *event )
         update();
     }
 }
+



More information about the Vlmc-devel mailing list