Commit 246f862d authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen
Browse files

Refactored clip moving.

Old position isn't required anymore.
parent 9faaf73c
...@@ -60,14 +60,14 @@ void Commands::MainWorkflow::AddClip::undo() ...@@ -60,14 +60,14 @@ void Commands::MainWorkflow::AddClip::undo()
} }
Commands::MainWorkflow::MoveClip::MoveClip( ::MainWorkflow* workflow, const QUuid& uuid, Commands::MainWorkflow::MoveClip::MoveClip( ::MainWorkflow* workflow, const QUuid& uuid,
unsigned int oldTrack, qint64 oldPos, unsigned int newTrack, qint64 newPos, unsigned int oldTrack, unsigned int newTrack, qint64 newPos,
::MainWorkflow::TrackType trackType ) : ::MainWorkflow::TrackType trackType ) :
m_workflow( workflow ), m_uuid( uuid ), m_oldTrack( oldTrack ), m_workflow( workflow ), m_uuid( uuid ), m_oldTrack( oldTrack ),
m_newTrack( newTrack ), m_pos( newPos ), m_oldPos( oldPos ), m_newTrack( newTrack ), m_pos( newPos ), m_trackType( trackType )
m_trackType( trackType )
{ {
setText( QObject::tr( "Moving clip" ) ); setText( QObject::tr( "Moving clip" ) );
m_undoRedoAction = false; m_undoRedoAction = false;
m_oldPos = m_workflow->getClipPosition( uuid, oldTrack, trackType );
} }
void Commands::MainWorkflow::MoveClip::redo() void Commands::MainWorkflow::MoveClip::redo()
......
...@@ -67,7 +67,7 @@ namespace Commands ...@@ -67,7 +67,7 @@ namespace Commands
{ {
public: public:
MoveClip( ::MainWorkflow* workflow, const QUuid& uuid, MoveClip( ::MainWorkflow* workflow, const QUuid& uuid,
unsigned int oldTrack, qint64 oldPos, unsigned int newTrack, unsigned int oldTrack, unsigned int newTrack,
qint64 newPos, ::MainWorkflow::TrackType trackType ); qint64 newPos, ::MainWorkflow::TrackType trackType );
virtual void redo(); virtual void redo();
virtual void undo(); virtual void undo();
......
...@@ -616,7 +616,6 @@ void TracksView::mouseReleaseEvent( QMouseEvent* event ) ...@@ -616,7 +616,6 @@ void TracksView::mouseReleaseEvent( QMouseEvent* event )
Commands::trigger( new Commands::MainWorkflow::MoveClip( m_mainWorkflow, Commands::trigger( new Commands::MainWorkflow::MoveClip( m_mainWorkflow,
movieItem->clip()->getUuid(), movieItem->clip()->getUuid(),
movieItem->oldTrackNumber, movieItem->oldTrackNumber,
movieItem->oldPosition,
movieItem->trackNumber(), movieItem->trackNumber(),
movieItem->startPos(), movieItem->startPos(),
MainWorkflow::VideoTrack ) ); MainWorkflow::VideoTrack ) );
......
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