[vlmc-devel] commit: timeline: reset the lastKnownTrack when the clip is dropped on the timeline ( Ludovic Fauvet )
git at videolan.org
git at videolan.org
Tue Mar 23 12:25:07 CET 2010
vlmc | branch: master | Ludovic Fauvet <etix at l0cal.com> | Tue Mar 23 12:23:16 2010 +0100| [554b026c658b00b1cfc6eab8b913200984acbbf7] | committer: Ludovic Fauvet
timeline: reset the lastKnownTrack when the clip is dropped on the timeline
> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=554b026c658b00b1cfc6eab8b913200984acbbf7
---
src/Gui/timeline/TracksView.cpp | 14 ++++++++++----
src/Gui/timeline/TracksView.h | 1 +
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/src/Gui/timeline/TracksView.cpp b/src/Gui/timeline/TracksView.cpp
index 76263c2..8825e4b 100644
--- a/src/Gui/timeline/TracksView.cpp
+++ b/src/Gui/timeline/TracksView.cpp
@@ -54,6 +54,7 @@ TracksView::TracksView( QGraphicsScene *scene, MainWorkflow *mainWorkflow,
m_numVideoTrack = 0;
m_dragVideoItem = NULL;
m_dragAudioItem = NULL;
+ m_lastKnownTrack = NULL;
m_actionMove = false;
m_actionResize = false;
m_actionRelativeX = -1;
@@ -382,7 +383,9 @@ void
TracksView::moveMediaItem( AbstractGraphicsMediaItem *item, QPoint position )
{
GraphicsTrack *track = NULL;
- static GraphicsTrack *lastKnownTrack = getTrack( MainWorkflow::VideoTrack, 0 );
+
+ if ( !m_lastKnownTrack )
+ m_lastKnownTrack = getTrack( MainWorkflow::VideoTrack, 0 );
QList<QGraphicsItem*> list = items( 0, position.y() );
for ( int i = 0; i < list.size(); ++i )
@@ -396,12 +399,12 @@ TracksView::moveMediaItem( AbstractGraphicsMediaItem *item, QPoint position )
// When the mouse pointer is not on a track,
// use the last known track.
// This avoids "breaks" when moving a rush
- if ( !lastKnownTrack )
+ if ( !m_lastKnownTrack )
return;
- track = lastKnownTrack;
+ track = m_lastKnownTrack;
}
- lastKnownTrack = track;
+ m_lastKnownTrack = track;
qreal time = ( mapToScene( position ).x() + 0.5 );
moveMediaItem( item, track->trackNumber(), (qint64)time);
@@ -696,6 +699,8 @@ TracksView::dropEvent( QDropEvent *event )
}
UndoStack::getInstance()->endMacro();
+
+ m_lastKnownTrack = NULL;
}
void
@@ -951,6 +956,7 @@ TracksView::mouseReleaseEvent( QMouseEvent *event )
m_actionItem->oldPosition = m_actionItem->startPos();
m_actionRelativeX = -1;
m_actionItem = NULL;
+ m_lastKnownTrack = NULL;
}
else if ( m_actionResize )
{
diff --git a/src/Gui/timeline/TracksView.h b/src/Gui/timeline/TracksView.h
index 34e5864..36466cd 100644
--- a/src/Gui/timeline/TracksView.h
+++ b/src/Gui/timeline/TracksView.h
@@ -332,6 +332,7 @@ private:
int m_actionRelativeX;
AbstractGraphicsMediaItem::From m_actionResizeType;
AbstractGraphicsMediaItem *m_actionItem;
+ GraphicsTrack *m_lastKnownTrack;
signals:
/**
More information about the Vlmc-devel
mailing list