Commit 93fbf286 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen
Browse files

Fixed end of mainworkflow detection bug

parent 476cae72
......@@ -73,7 +73,6 @@ WorkflowRenderer::WorkflowRenderer() :
this, SLOT( timelineCursorChanged(qint64) ) );
connect( m_mainWorkflow, SIGNAL( mainWorkflowPaused() ), this, SLOT( mainWorkflowPaused() ) );
connect( m_mainWorkflow, SIGNAL( mainWorkflowUnpaused() ), this, SLOT( mainWorkflowUnpaused() ) );
}
......
......@@ -55,6 +55,7 @@ MainWorkflow::MainWorkflow( int trackCount ) :
connect( m_tracks[i], SIGNAL( tracksPaused() ), this, SLOT( tracksPaused() ) );
connect( m_tracks[i], SIGNAL( tracksUnpaused() ), this, SLOT( tracksUnpaused() ) );
connect( m_tracks[i], SIGNAL( allTracksRenderCompleted() ), this, SLOT( tracksRenderCompleted() ) );
connect( m_tracks[i], SIGNAL( tracksEndReached() ), this, SLOT( tracksEndReached() ) );
}
m_outputBuffers = new OutputBuffers;
......@@ -387,6 +388,14 @@ void MainWorkflow::tracksPaused()
emit mainWorkflowPaused();
}
void MainWorkflow::tracksEndReached()
{
for ( unsigned int i = 0; i < MainWorkflow::NbTrackType; ++i )
if ( m_tracks[i]->endIsReached() == false )
return ;
emit mainWorkflowEndReached();
}
void MainWorkflow::tracksUnpaused()
{
for ( unsigned int i = 0; i < MainWorkflow::NbTrackType; ++i )
......
......@@ -157,6 +157,7 @@ class MainWorkflow : public QObject, public Singleton<MainWorkflow>
void tracksPaused();
void tracksUnpaused();
void tracksRenderCompleted();
void tracksEndReached();
public slots:
void loadProject( const QDomElement& project );
......
......@@ -73,6 +73,7 @@ void TrackHandler::addClip( Clip* clip, unsigned int trackId, qint64 star
void TrackHandler::startRender()
{
m_paused = false;
m_endReached = false;
for ( unsigned int i = 0; i < m_trackCount; ++i )
activateTrack( i );
computeLength();
......@@ -244,6 +245,11 @@ bool TrackHandler::isPaused() const
return m_paused;
}
bool TrackHandler::endIsReached() const
{
return m_endReached;
}
bool TrackHandler::allTracksRendered() const
{
return m_renderCompleted;
......@@ -258,8 +264,8 @@ void TrackHandler::trackEndReached( unsigned int trackId )
if ( m_tracks[i].activated() == true )
return ;
}
//FIXME::
//emit mainWorkflowEndReached();
m_endReached = true;
emit tracksEndReached();
}
void TrackHandler::trackPaused()
......
......@@ -60,6 +60,7 @@ class TrackHandler : public QObject
void setFullSpeedRender( bool value );
bool isPaused() const;
bool endIsReached() const;
bool allTracksRendered() const;
void save( QDomDocument& doc, QDomElement& timelineNode ) const;
......@@ -81,6 +82,7 @@ class TrackHandler : public QObject
QMutex* m_nbTracksToRenderMutex;
void* m_synchroneRenderingBuffer;
bool m_paused;
bool m_endReached;
/**
* \brief This flag is used to know if all tracks handled
* have been rendered.
......@@ -100,6 +102,7 @@ class TrackHandler : public QObject
void tracksPaused();
void tracksUnpaused();
void allTracksRenderCompleted();
void tracksEndReached();
};
#endif // TRACKHANDLER_H
Supports Markdown
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