Commit 16a8ae01 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Preview can now be started at any frame (only by moving the timeline cursor for now)

parent 17328459
...@@ -56,6 +56,15 @@ WorkflowRenderer::WorkflowRenderer() : ...@@ -56,6 +56,15 @@ WorkflowRenderer::WorkflowRenderer() :
m_condMutex = new QMutex; m_condMutex = new QMutex;
m_waitCond = new QWaitCondition; m_waitCond = new QWaitCondition;
//Workflow part
connect( m_mainWorkflow, SIGNAL( frameChanged(qint64) ),
Timeline::getInstance()->tracksView()->tracksCursor(), SLOT( setCursorPos( qint64 ) ), Qt::QueuedConnection );
connect( Timeline::getInstance()->tracksView()->tracksCursor(), SIGNAL( cursorPositionChanged( qint64 ) ),
this, SLOT( timelineCursorChanged(qint64) ) );
connect( m_mainWorkflow, SIGNAL( mainWorkflowPaused() ), this, SLOT( mainWorkflowPaused() ) );
connect( m_mainWorkflow, SIGNAL( mainWorkflowUnpaused() ), this, SLOT( mainWorkflowUnpaused() ) );
} }
...@@ -128,14 +137,6 @@ void WorkflowRenderer::startPreview() ...@@ -128,14 +137,6 @@ void WorkflowRenderer::startPreview()
return ; return ;
m_mediaPlayer->setMedia( m_media ); m_mediaPlayer->setMedia( m_media );
//Workflow part
connect( m_mainWorkflow, SIGNAL( frameChanged(qint64) ),
Timeline::getInstance()->tracksView()->tracksCursor(), SLOT( setCursorPos( qint64 ) ), Qt::QueuedConnection );
connect( Timeline::getInstance()->tracksView()->tracksCursor(), SIGNAL( cursorPositionChanged( qint64 ) ),
this, SLOT( timelineCursorChanged(qint64) ) );
connect( m_mainWorkflow, SIGNAL( mainWorkflowPaused() ), this, SLOT( mainWorkflowPaused() ) );
connect( m_mainWorkflow, SIGNAL( mainWorkflowUnpaused() ), this, SLOT( mainWorkflowUnpaused() ) );
//Media player part: to update PreviewWidget //Media player part: to update PreviewWidget
connect( m_mediaPlayer, SIGNAL( playing() ), this, SLOT( __videoPlaying() ), Qt::DirectConnection ); connect( m_mediaPlayer, SIGNAL( playing() ), this, SLOT( __videoPlaying() ), Qt::DirectConnection );
connect( m_mediaPlayer, SIGNAL( paused() ), this, SLOT( __videoPaused() ), Qt::DirectConnection ); connect( m_mediaPlayer, SIGNAL( paused() ), this, SLOT( __videoPaused() ), Qt::DirectConnection );
......
...@@ -29,6 +29,7 @@ unsigned char* MainWorkflow::blackOutput = NULL; ...@@ -29,6 +29,7 @@ unsigned char* MainWorkflow::blackOutput = NULL;
MainWorkflow* MainWorkflow::m_instance = NULL; MainWorkflow* MainWorkflow::m_instance = NULL;
MainWorkflow::MainWorkflow( int trackCount ) : MainWorkflow::MainWorkflow( int trackCount ) :
m_currentFrame( 0 ),
m_length( 0 ), m_length( 0 ),
m_trackCount( trackCount ), m_trackCount( trackCount ),
m_renderStarted( false ) m_renderStarted( false )
...@@ -59,6 +60,7 @@ MainWorkflow::MainWorkflow( int trackCount ) : ...@@ -59,6 +60,7 @@ MainWorkflow::MainWorkflow( int trackCount ) :
MainWorkflow::~MainWorkflow() MainWorkflow::~MainWorkflow()
{ {
//FIXME: this is probably useless, since already done by the renderer
stop(); stop();
delete m_nbTracksToRenderMutex; delete m_nbTracksToRenderMutex;
...@@ -107,8 +109,6 @@ void MainWorkflow::startRender() ...@@ -107,8 +109,6 @@ void MainWorkflow::startRender()
{ {
m_renderStarted = true; m_renderStarted = true;
m_paused = false; m_paused = false;
m_currentFrame = 0;
emit frameChanged( 0 );
for ( unsigned int i = 0; i < m_trackCount; ++i ) for ( unsigned int i = 0; i < m_trackCount; ++i )
activateTrack( i ); activateTrack( i );
computeLength(); computeLength();
...@@ -222,10 +222,6 @@ void MainWorkflow::trackEndReached( unsigned int trackId ) ...@@ -222,10 +222,6 @@ void MainWorkflow::trackEndReached( unsigned int trackId )
return ; return ;
} }
emit mainWorkflowEndReached(); emit mainWorkflowEndReached();
m_renderStarted = false;
m_currentFrame = 0;
emit frameChanged( 0 );
emit positionChanged( 0 );
} }
unsigned int MainWorkflow::getTrackCount() const unsigned int MainWorkflow::getTrackCount() const
...@@ -245,6 +241,7 @@ void MainWorkflow::stop() ...@@ -245,6 +241,7 @@ void MainWorkflow::stop()
} }
m_currentFrame = 0; m_currentFrame = 0;
emit frameChanged( 0 ); emit frameChanged( 0 );
emit positionChanged( 0 );
} }
MainWorkflow* MainWorkflow::getInstance() MainWorkflow* MainWorkflow::getInstance()
......
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