Commit 86eb9083 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

When the workflow is beeing rendered as a preview, the slider moves accordingly

parent c56fd547
......@@ -54,6 +54,7 @@ unsigned char* MainWorkflow::getOutput()
unsigned char* ret = m_tracks[0]->getOutput( m_currentFrame );
++m_currentFrame;
emit frameChanged( m_currentFrame );
emit positionChanged( (float)m_currentFrame / (float)m_length );
return ret;
}
......@@ -64,6 +65,7 @@ void MainWorkflow::setPosition( float pos )
m_tracks[0]->setPosition( pos );
m_currentFrame = frame;
emit frameChanged( frame );
//Do not emit a signal for the RenderWidget, since it's the one that triggered that call...
}
qint64 MainWorkflow::getLength() const
......
......@@ -61,7 +61,14 @@ class MainWorkflow : public QObject
qint64 m_length;
signals:
/**
* \brief Used to notify a change to the timeline cursor
*/
void frameChanged( qint64 currentFrame );
/**
* \brief Used to nofify a change to the PreviewWidget
*/
void positionChanged( float pos );
};
#endif // MAINWORKFLOW_H
......@@ -50,6 +50,7 @@ RenderPreviewWidget::RenderPreviewWidget( MainWorkflow* mainWorkflow, QWidget* r
connect( m_mediaPlayer, SIGNAL( playing() ), this, SLOT( __videoPlaying() ) );
connect( m_mediaPlayer, SIGNAL( paused() ), this, SLOT( __videoPaused() ) );
connect( m_mainWorkflow, SIGNAL( positionChanged( float ) ), this, SLOT( __positionChanged( float ) ) );
}
......@@ -114,7 +115,12 @@ void RenderPreviewWidget::__endReached()
void RenderPreviewWidget::__positionChanged()
{
qDebug() << "RenderPreviewWidget::__positionChanged: Unimplemented";
qFatal("This should never be used ! Get out of here !");
}
void RenderPreviewWidget::__positionChanged( float pos )
{
emit positionChanged( pos );
}
void RenderPreviewWidget::__videoPaused()
......
......@@ -60,6 +60,7 @@ class RenderPreviewWidget : public GenericPreviewWidget
public slots:
void __positionChanged();
void __positionChanged( float pos );
void __videoPaused();
void __videoPlaying();
void __endReached();
......
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