Commit 1cb88058 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen
Browse files

Refactoring is functionnal, minus some bugs that was hidden and uncorrected for a long time :)

parent f79d8339
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include "FileBrowser.h" #include "FileBrowser.h"
#include "PreviewWidget.h" #include "PreviewWidget.h"
#include "WorkflowRenderer.h" #include "WorkflowRenderer.h"
#include "ClipRenderer.h"
MainWindow::MainWindow( QWidget *parent ) : MainWindow::MainWindow( QWidget *parent ) :
QMainWindow( parent ), m_renderer( NULL ) QMainWindow( parent ), m_renderer( NULL )
...@@ -145,12 +146,17 @@ void MainWindow::m_initializeDockWidgets( void ) ...@@ -145,12 +146,17 @@ void MainWindow::m_initializeDockWidgets( void )
setupLibrary(); setupLibrary();
dockManager->addDockedWidget( new PreviewWidget( new WorkflowRenderer( m_timeline->getMainWorkflow() ), this ), dockManager->addDockedWidget( new PreviewWidget( new ClipRenderer, this ),
tr( "Preview" ), tr( "Clip Preview" ),
Qt::AllDockWidgetAreas, Qt::AllDockWidgetAreas,
QDockWidget::AllDockWidgetFeatures, QDockWidget::AllDockWidgetFeatures,
Qt::TopDockWidgetArea ); Qt::TopDockWidgetArea );
dockManager->addDockedWidget( new PreviewWidget( new WorkflowRenderer( m_timeline->getMainWorkflow() ), this ),
tr( "Project Preview" ),
Qt::AllDockWidgetAreas,
QDockWidget::AllDockWidgetFeatures,
Qt::TopDockWidgetArea );
m_metaDataManager = MetaDataManager::getInstance(); m_metaDataManager = MetaDataManager::getInstance();
} }
......
...@@ -29,6 +29,11 @@ ClipRenderer::ClipRenderer() : ...@@ -29,6 +29,11 @@ ClipRenderer::ClipRenderer() :
m_clipLoaded( false ), m_clipLoaded( false ),
m_vlcMedia( NULL ) m_vlcMedia( NULL )
{ {
connect( m_mediaPlayer, SIGNAL( stopped() ), this, SLOT( __videoStopped() ) );
connect( m_mediaPlayer, SIGNAL( paused() ), this, SLOT( __videoPaused() ) );
connect( m_mediaPlayer, SIGNAL( playing() ), this, SLOT( __videoPlaying() ) );
connect( m_mediaPlayer, SIGNAL( positionChanged() ), this, SLOT( __positionChanged() ) );
connect( m_mediaPlayer, SIGNAL( endReached() ), this, SLOT( __endReached() ) );
} }
ClipRenderer::~ClipRenderer() ClipRenderer::~ClipRenderer()
...@@ -37,18 +42,13 @@ ClipRenderer::~ClipRenderer() ...@@ -37,18 +42,13 @@ ClipRenderer::~ClipRenderer()
void ClipRenderer::startPreview( Media* media ) void ClipRenderer::startPreview( Media* media )
{ {
//If an old media is found, we delete it, and disconnect
if ( m_vlcMedia != NULL ) if ( m_vlcMedia != NULL )
delete m_vlcMedia; delete m_vlcMedia;
m_vlcMedia = new LibVLCpp::Media( media->getFileInfo()->absoluteFilePath() ); m_vlcMedia = new LibVLCpp::Media( media->getFileInfo()->absoluteFilePath() );
m_mediaPlayer->setMedia( m_vlcMedia ); m_mediaPlayer->setMedia( m_vlcMedia );
connect( m_mediaPlayer, SIGNAL( stopped() ), this, SLOT( __videoStopped() ) );
connect( m_mediaPlayer, SIGNAL( paused() ), this, SLOT( __videoPaused() ) );
connect( m_mediaPlayer, SIGNAL( playing() ), this, SLOT( __videoPlaying() ) );
connect( m_mediaPlayer, SIGNAL( positionChanged() ), this, SLOT( __positionChanged() ) );
connect( m_mediaPlayer, SIGNAL( endReached() ), this, SLOT( __endReached() ) );
m_mediaPlayer->play(); m_mediaPlayer->play();
m_clipLoaded = true; m_clipLoaded = true;
m_isRendering = true; m_isRendering = true;
...@@ -69,11 +69,6 @@ void ClipRenderer::stop() ...@@ -69,11 +69,6 @@ void ClipRenderer::stop()
m_isRendering = false; m_isRendering = false;
m_mediaPlayer->stop(); m_mediaPlayer->stop();
m_paused = false; m_paused = false;
disconnect( m_mediaPlayer, SIGNAL( stopped() ), this, SLOT( __videoStopped() ) );
disconnect( m_mediaPlayer, SIGNAL( paused() ), this, SLOT( __videoPaused() ) );
disconnect( m_mediaPlayer, SIGNAL( playing() ), this, SLOT( __videoPlaying() ) );
disconnect( m_mediaPlayer, SIGNAL( positionChanged() ), this, SLOT( __positionChanged() ) );
disconnect( m_mediaPlayer, SIGNAL( endReached() ), this, SLOT( __endReached() ) );
} }
} }
......
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