Commit 6957f7de authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Force repositionnement when moving a clip from a track to another

parent f823b33d
......@@ -275,8 +275,14 @@ void MainWorkflow::moveClip( const QUuid& clipUuid, unsigned int oldTr
}
else
{
bool needRepo;
if ( m_tracks[oldTrack]->getClipPosition( clipUuid ) != startingFrame )
needRepo = true;
ClipWorkflow* cw = m_tracks[oldTrack]->removeClipWorkflow( clipUuid );
m_tracks[newTrack]->addClip( cw, startingFrame );
if ( needRepo == true )
m_tracks[newTrack]->forceRepositionning();
activateTrack( oldTrack );
activateTrack( newTrack );
}
......
......@@ -136,9 +136,7 @@ void TrackWorkflow::renderClip( ClipWorkflow* cw, qint64 currentFrame,
cw->getStateLock()->unlock();
if ( needRepositioning == true )
{
adjustClipTime( currentFrame, start, cw );
}
QMutexLocker lock( cw->getSleepMutex() );
cw->wake();
}
......@@ -616,3 +614,9 @@ void TrackWorkflow::disconnectClipWorkflow( ClipWorkflow* cw )
disconnect( cw, SIGNAL( paused() ), this, SLOT( clipWorkflowPaused() ) );
disconnect( cw, SIGNAL( unpaused() ), this, SLOT( clipWorkflowUnpaused() ) );
}
void TrackWorkflow::forceRepositionning()
{
QMutexLocker lock( m_forceRepositionningMutex );
m_forceRepositionning = true;
}
......@@ -75,6 +75,7 @@ class TrackWorkflow : public QObject
void clear();
void setFullSpeedRender( bool value );
void forceRepositionning();
private:
void computeLength();
......
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