Commit 3a75a92c authored by Ludovic Fauvet's avatar Ludovic Fauvet

Update of the clipMoved event with the old track position

parent 8af99b48
......@@ -22,7 +22,8 @@
#include "AbstractGraphicsMediaItem.h"
AbstractGraphicsMediaItem::AbstractGraphicsMediaItem() : m_tracksView( NULL )
AbstractGraphicsMediaItem::AbstractGraphicsMediaItem() :
m_tracksView( NULL ), oldTrackNumber( -1 )
{
setCursor( Qt::OpenHandCursor );
}
......
......@@ -56,6 +56,11 @@ protected:
*/
TracksView* tracksView();
/**
* Contains the old trackNumber
*/
int oldTrackNumber;
virtual void mousePressEvent( QGraphicsSceneMouseEvent* event );
virtual void mouseReleaseEvent( QGraphicsSceneMouseEvent* event );
......
......@@ -246,6 +246,7 @@ void TracksView::dropEvent( QDropEvent* event )
event->acceptProposedAction();
qreal mappedXPos = ( mapToScene( event->pos() ).x() + 0.5 );
m_dragItem->oldTrackNumber = m_dragItem->trackNumber();
m_mainWorkflow->addClip( m_dragItem->clip(),
m_dragItem->trackNumber(),
(qint64)mappedXPos );
......@@ -360,8 +361,10 @@ void TracksView::mouseReleaseEvent( QMouseEvent* event )
if ( m_layout->itemAt( 0 )->graphicsItem()->childItems().count() > 0 )
addVideoTrack();
emit clipMoved( movieItem->clip()->getUuid(),
movieItem->oldTrackNumber,
movieItem->trackNumber(),
(qint64)movieItem->pos().x() );
movieItem->oldTrackNumber = movieItem->trackNumber();
m_actionMove = false;
m_actionRelativeX = -1;
m_actionItem = NULL;
......
......@@ -134,7 +134,7 @@ signals:
void zoomIn();
void zoomOut();
void durationChanged( int duration );
void clipMoved( const QUuid& uuid, int track, qint64 start );
void clipMoved( const QUuid& uuid, int oldTrack, int newTrack, qint64 start );
};
#endif // TRACKSVIEW_H
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