[vlmc-devel] ClipRenderer: Remove the notion of endReached. Stopped is enough here

Hugo Beauzée-Luyssen git at videolan.org
Sun Feb 16 01:34:58 CET 2014


vlmc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Sun Feb 16 02:11:50 2014 +0200| [3d9ffd593b6b1deed0dbac13211c4cfa0daeeb18] | committer: Hugo Beauzée-Luyssen

ClipRenderer: Remove the notion of endReached. Stopped is enough here

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

 src/Renderer/ClipRenderer.cpp     |   15 +++------------
 src/Renderer/ClipRenderer.h       |    1 -
 src/Renderer/GenericRenderer.h    |    4 ----
 src/Renderer/WorkflowRenderer.cpp |    1 -
 src/Renderer/WorkflowRenderer.h   |    2 +-
 5 files changed, 4 insertions(+), 19 deletions(-)

diff --git a/src/Renderer/ClipRenderer.cpp b/src/Renderer/ClipRenderer.cpp
index 054015b..4be6f69 100644
--- a/src/Renderer/ClipRenderer.cpp
+++ b/src/Renderer/ClipRenderer.cpp
@@ -46,7 +46,6 @@ ClipRenderer::ClipRenderer() :
     connect( m_mediaPlayer,     SIGNAL( playing() ),            this,   SIGNAL( playing() ) );
     connect( m_mediaPlayer,     SIGNAL( volumeChanged() ),      this,   SIGNAL( volumeChanged() ) );
     connect( m_mediaPlayer,     SIGNAL( timeChanged( qint64 ) ),this,   SLOT( __timeChanged( qint64 ) ) );
-    connect( m_mediaPlayer,     SIGNAL( endReached() ),         this,   SLOT( __endReached() ) );
 }
 
 ClipRenderer::~ClipRenderer()
@@ -256,6 +255,9 @@ ClipRenderer::previewWidgetCursorChanged( qint64 newFrame )
 void
 ClipRenderer::__videoStopped()
 {
+    m_isRendering = false;
+    if ( m_mediaChanged == true )
+        m_clipLoaded = false;
     emit frameChanged( 0, Vlmc::Renderer );
     emit stopped();
 }
@@ -268,19 +270,8 @@ ClipRenderer::__timeChanged( qint64 time )
         fps = m_selectedClip->getMedia()->fps();
     qint64 f = qRound64( (qreal)time / 1000.0 * fps );
     if ( f >= m_end )
-    {
-        __endReached();
         return ;
-    }
     f = f - m_begin;
     emit frameChanged( f, Vlmc::Renderer );
 }
 
-void
-ClipRenderer::__endReached()
-{
-    m_mediaPlayer->stop();
-    m_isRendering = false;
-    if ( m_mediaChanged == true )
-        m_clipLoaded = false;
-}
diff --git a/src/Renderer/ClipRenderer.h b/src/Renderer/ClipRenderer.h
index 889bb81..93ef359 100644
--- a/src/Renderer/ClipRenderer.h
+++ b/src/Renderer/ClipRenderer.h
@@ -90,7 +90,6 @@ public slots:
      *  \sa         frameChanged();
      */
     void                    __timeChanged( qint64 time );
-    void                    __endReached();
     void                    __videoStopped();
 };
 
diff --git a/src/Renderer/GenericRenderer.h b/src/Renderer/GenericRenderer.h
index ec85f01..7016719 100644
--- a/src/Renderer/GenericRenderer.h
+++ b/src/Renderer/GenericRenderer.h
@@ -186,10 +186,6 @@ protected:
 
 public slots:
     /**
-     *  \brief      This SLOT has to be called when the render ends.
-     */
-    virtual void                    __endReached() = 0;
-    /**
      *  \brief      This SLOT will be called when the time cursor has changed.
      *
      *  This mainly means that the current rendered frame should change.
diff --git a/src/Renderer/WorkflowRenderer.cpp b/src/Renderer/WorkflowRenderer.cpp
index 8834b4b..738c781 100644
--- a/src/Renderer/WorkflowRenderer.cpp
+++ b/src/Renderer/WorkflowRenderer.cpp
@@ -452,7 +452,6 @@ WorkflowRenderer::loadProject( const QDomElement &project )
 void
 WorkflowRenderer::__endReached()
 {
-    //FIXME: Is this necessary?!
     stop();
 }
 
diff --git a/src/Renderer/WorkflowRenderer.h b/src/Renderer/WorkflowRenderer.h
index 99e95ea..9307e2f 100644
--- a/src/Renderer/WorkflowRenderer.h
+++ b/src/Renderer/WorkflowRenderer.h
@@ -317,7 +317,7 @@ class   WorkflowRenderer : public GenericRenderer
          *  \brief          Called when the workflow end is reached.
          *  \sa             stop();
          */
-        void                __endReached();
+        virtual void        __endReached();
 
     private slots:
         /**



More information about the Vlmc-devel mailing list