Commit 85045699 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

GraphicsEffectItem: Follow the container clip when it changes track

parent bc39a6ad
......@@ -95,6 +95,7 @@ void
AbstractGraphicsItem::setTrack( GraphicsTrack* track )
{
setParentItem( track );
emit trackChanged( track );
}
GraphicsTrack*
......
......@@ -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;
......
......@@ -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();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment