Commit fb7ea75e authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Stop any preview before rendering to a file.

parent 4ba45a6c
......@@ -68,7 +68,7 @@
#include "VLCInstance.h"
MainWindow::MainWindow( QWidget *parent ) :
QMainWindow( parent ), m_renderer( NULL )
QMainWindow( parent ), m_fileRenderer( NULL )
{
m_ui.setupUi( this );
......@@ -142,8 +142,8 @@ MainWindow::~MainWindow()
s.setValue( "CleanQuit", true );
s.sync();
if ( m_renderer )
delete m_renderer;
if ( m_fileRenderer )
delete m_fileRenderer;
LibVLCpp::Instance::destroyInstance();
}
......@@ -270,9 +270,9 @@ void MainWindow::createStatusBar()
void MainWindow::initializeDockWidgets( void )
{
WorkflowRenderer* workflowRenderer = new WorkflowRenderer();
workflowRenderer->initializeRenderer();
m_timeline = new Timeline( workflowRenderer, this );
m_renderer = new WorkflowRenderer();
m_renderer->initializeRenderer();
m_timeline = new Timeline( m_renderer, this );
m_timeline->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
m_timeline->show();
setCentralWidget( m_timeline );
......@@ -288,7 +288,7 @@ void MainWindow::initializeDockWidgets( void )
KeyboardShortcutHelper* clipShortcut = new KeyboardShortcutHelper( "Launch media preview", this );
connect( clipShortcut, SIGNAL( activated() ), m_clipPreview, SLOT( on_pushButtonPlay_clicked() ) );
m_projectPreview = new PreviewWidget( workflowRenderer, this );
m_projectPreview = new PreviewWidget( m_renderer, this );
dockManager->addDockedWidget( m_projectPreview,
tr( "Project Preview" ),
Qt::AllDockWidgetAreas,
......@@ -378,11 +378,12 @@ void MainWindow::on_actionRender_triggered()
return ;
else
{
if ( m_renderer )
delete m_renderer;
m_renderer = new WorkflowFileRenderer( outputFileName );
m_renderer->initializeRenderer();
m_renderer->run();
m_renderer->stop();
if ( m_fileRenderer )
delete m_fileRenderer;
m_fileRenderer = new WorkflowFileRenderer( outputFileName );
m_fileRenderer->initializeRenderer();
m_fileRenderer->run();
}
}
......
......@@ -37,6 +37,7 @@ class Settings;
class ProjectWizard;
class ImportController;
class WorkflowFileRenderer;
class WorkflowRenderer;
class MainWindow : public QMainWindow
{
......@@ -80,7 +81,8 @@ private:
Timeline* m_timeline;
PreviewWidget* m_clipPreview;
PreviewWidget* m_projectPreview;
WorkflowFileRenderer* m_renderer;
WorkflowFileRenderer* m_fileRenderer;
WorkflowRenderer *m_renderer;
Settings* m_globalPreferences;
Settings* m_DefaultProjectPreferences;
Settings* m_projectPreferences;
......@@ -113,8 +115,8 @@ private slots:
void canRedoChanged( bool canRedo );
signals:
void translateDockWidgetTitle();
void toolChanged( ToolButtons );
void translateDockWidgetTitle();
void toolChanged( ToolButtons );
};
......
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