Commit 74289f71 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

The timeline tracker doesn't move anymore when rendering to a file.

parent 6bd4055e
......@@ -24,6 +24,7 @@
#include <QThread>
#include "RenderPreviewWidget.h"
#include "Timeline.h"
RenderPreviewWidget::RenderPreviewWidget( MainWorkflow* mainWorkflow, QWidget* renderWidget ) :
GenericPreviewWidget( renderWidget ),
......@@ -91,6 +92,9 @@ void RenderPreviewWidget::unlock( void* datas )
void RenderPreviewWidget::stopPreview()
{
disconnect( m_mainWorkflow, SIGNAL( frameChanged(qint64) ),
Timeline::getInstance()->tracksView()->tracksCursor(), SLOT( updateCursorPos( qint64 ) ) );
//FIXME: shouldn't this call MainWorkflow::stop() ??!!
m_mediaPlayer->stop();
m_isRendering = false;
......@@ -99,6 +103,8 @@ void RenderPreviewWidget::stopPreview()
void RenderPreviewWidget::startPreview( Media* )
{
connect( m_mainWorkflow, SIGNAL( frameChanged(qint64) ),
Timeline::getInstance()->tracksView()->tracksCursor(), SLOT( updateCursorPos( qint64 ) ) );
m_mainWorkflow->startRender();
m_mediaPlayer->play();
m_isRendering = true;
......
......@@ -27,9 +27,13 @@
#include "TracksView.h"
#include "TracksScene.h"
Timeline* Timeline::m_instance = NULL;
Timeline::Timeline( QWidget *parent ) :
QWidget( parent ), m_scale( 1.0 )
{
Q_ASSERT( m_instance == NULL );
m_instance = this;
m_ui.setupUi( this );
m_mainWorkflow = new MainWorkflow( this, 5 );
......@@ -55,7 +59,6 @@ Timeline::Timeline( QWidget *parent ) :
setDuration( 0 );
connect( m_tracksView->horizontalScrollBar(), SIGNAL( valueChanged( int ) ), m_tracksRuler, SLOT( moveRuler( int ) ) );
connect( m_tracksView, SIGNAL( durationChanged(int) ), this, SLOT( setDuration(int) ) );
connect( m_mainWorkflow, SIGNAL( frameChanged(qint64) ), m_tracksView->tracksCursor(), SLOT( updateCursorPos( qint64 ) ) );
}
void Timeline::changeEvent( QEvent *e )
......
......@@ -38,6 +38,7 @@ public:
TracksView* tracksView() { return m_tracksView; }
TracksScene* tracksScene() { return m_tracksScene; }
MainWorkflow* getMainWorkflow() { return m_mainWorkflow; }
static Timeline* getInstance() { return m_instance; }
public slots:
void changeZoom( int factor );
......@@ -53,6 +54,7 @@ private:
TracksRuler* m_tracksRuler;
double m_scale;
MainWorkflow* m_mainWorkflow;
static Timeline* m_instance;
};
#endif // TIMELINE_H
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