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

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

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