[vlmc-devel] WorkflowRenderer: Remove duplicated killRenderer method

Hugo Beauzée-Luyssen git at videolan.org
Mon Feb 24 18:24:02 CET 2014


vlmc | branch: ibackend | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Mon Feb 24 18:51:05 2014 +0200| [18e413af983bed945240533934b02ccb8bbc3560] | committer: Hugo Beauzée-Luyssen

WorkflowRenderer: Remove duplicated killRenderer method

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=18e413af983bed945240533934b02ccb8bbc3560
---

 src/Gui/MainWindow.cpp                 |    4 ++--
 src/Gui/WorkflowFileRendererDialog.cpp |   10 ++++++++--
 src/Gui/WorkflowFileRendererDialog.h   |    1 +
 src/Renderer/WorkflowFileRenderer.cpp  |    6 ------
 src/Renderer/WorkflowFileRenderer.h    |    2 --
 src/Renderer/WorkflowRenderer.cpp      |   12 +-----------
 src/Renderer/WorkflowRenderer.h        |    9 ---------
 7 files changed, 12 insertions(+), 32 deletions(-)

diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp
index d5d578b..d97efc0 100644
--- a/src/Gui/MainWindow.cpp
+++ b/src/Gui/MainWindow.cpp
@@ -682,7 +682,7 @@ MainWindow::on_actionRender_triggered()
 {
     if ( checkVideoLength() )
     {
-        m_renderer->killRenderer();
+        m_renderer->stop();
         //Setup dialog box for querying render parameters.
         renderVideoSettings( false );
     }
@@ -693,7 +693,7 @@ MainWindow::on_actionShare_On_Internet_triggered()
 {
     if ( checkVideoLength() )
     {
-        m_renderer->killRenderer();
+        m_renderer->stop();
 
         if( !renderVideoSettings( true ) )
             return;
diff --git a/src/Gui/WorkflowFileRendererDialog.cpp b/src/Gui/WorkflowFileRendererDialog.cpp
index cc64009..f0d09a8 100644
--- a/src/Gui/WorkflowFileRendererDialog.cpp
+++ b/src/Gui/WorkflowFileRendererDialog.cpp
@@ -34,8 +34,7 @@ WorkflowFileRendererDialog::WorkflowFileRendererDialog( WorkflowFileRenderer* re
         m_renderer( renderer )
 {
     m_ui.setupUi( this );
-    connect( m_ui.cancelButton, SIGNAL( clicked() ), m_renderer, SLOT( stop() ) );
-    connect( m_ui.cancelButton, SIGNAL( clicked() ), this, SLOT( close() ) );
+    connect( m_ui.cancelButton, SIGNAL( clicked() ), this, SLOT( cancel() ) );
     connect( m_renderer, SIGNAL( renderComplete() ), this, SLOT( accept() ) );
     connect( m_renderer, SIGNAL( frameChanged( qint64 ) ), this, SLOT( frameChanged( qint64 ) ) );
     connect( m_renderer, SIGNAL( imageUpdated( const uchar* ) ),
@@ -77,3 +76,10 @@ WorkflowFileRendererDialog::frameChanged( qint64 frame )
         setProgressBarValue( frame * 100 / totalFrames );
     }
 }
+
+void
+WorkflowFileRendererDialog::cancel()
+{
+    m_renderer->stop();
+    close();
+}
diff --git a/src/Gui/WorkflowFileRendererDialog.h b/src/Gui/WorkflowFileRendererDialog.h
index bfe8634..94d782f 100644
--- a/src/Gui/WorkflowFileRendererDialog.h
+++ b/src/Gui/WorkflowFileRendererDialog.h
@@ -48,6 +48,7 @@ public slots:
 
 private slots:
     void    frameChanged( qint64 );
+    void    cancel();
 
     friend class    WorkflowFileRenderer;
 };
diff --git a/src/Renderer/WorkflowFileRenderer.cpp b/src/Renderer/WorkflowFileRenderer.cpp
index 827f320..37ab988 100644
--- a/src/Renderer/WorkflowFileRenderer.cpp
+++ b/src/Renderer/WorkflowFileRenderer.cpp
@@ -68,12 +68,6 @@ WorkflowFileRenderer::run( const QString& outputFileName, quint32 width,
     m_sourceRenderer->start();
 }
 
-void
-WorkflowFileRenderer::stop()
-{
-    WorkflowRenderer::killRenderer();
-}
-
 float
 WorkflowFileRenderer::getFps() const
 {
diff --git a/src/Renderer/WorkflowFileRenderer.h b/src/Renderer/WorkflowFileRenderer.h
index 42fec87..6f17fd8 100644
--- a/src/Renderer/WorkflowFileRenderer.h
+++ b/src/Renderer/WorkflowFileRenderer.h
@@ -59,8 +59,6 @@ protected:
     virtual Backend::ISourceRenderer::MemoryInputUnlockCallback getUnlockCallback();
 
 private slots:
-    //FIXME: Why a slot here versus a method in parent class?!
-    void                        stop();
     void                        __frameChanged( qint64 frame,
                                                 Vlmc::FrameChangedReason reason );
 
diff --git a/src/Renderer/WorkflowRenderer.cpp b/src/Renderer/WorkflowRenderer.cpp
index a410450..32d6d71 100644
--- a/src/Renderer/WorkflowRenderer.cpp
+++ b/src/Renderer/WorkflowRenderer.cpp
@@ -74,7 +74,7 @@ WorkflowRenderer::initializeRenderer()
 
 WorkflowRenderer::~WorkflowRenderer()
 {
-    killRenderer();
+    stop();
 
     delete m_esHandler;
     delete m_silencedAudioBuffer;
@@ -278,16 +278,6 @@ WorkflowRenderer::internalPlayPause( bool forcePause )
 void
 WorkflowRenderer::stop()
 {
-    //Since we want permanent render (to have a permanent render update, we shouldn't
-    //stop, but pause
-//    togglePlayPause( true );
-//    m_mainWorkflow->setCurrentFrame( 0, MainWorkflow::Renderer );
-    killRenderer();
-}
-
-void
-WorkflowRenderer::killRenderer()
-{
     m_isRendering = false;
     m_paused = false;
     m_stopping = true;
diff --git a/src/Renderer/WorkflowRenderer.h b/src/Renderer/WorkflowRenderer.h
index 1c8bac8..5711b6d 100644
--- a/src/Renderer/WorkflowRenderer.h
+++ b/src/Renderer/WorkflowRenderer.h
@@ -137,15 +137,6 @@ class   WorkflowRenderer : public GenericRenderer
          */
         virtual float       getFps() const;
 
-        /**
-         *  \brief          Completely kill the renderer.
-         *
-         *  This will stop both mainworkflow and renderer thread.
-         *  This should only be used when destroying the renderer.
-         *  \sa             stop();
-         */
-        void                killRenderer();
-
         void                saveProject( QXmlStreamWriter &project ) const;
         void                loadProject( const QDomElement& project );
     private:



More information about the Vlmc-devel mailing list