[vlmc-devel] ClipRenderer: Cleanup

Hugo Beauzée-Luyssen git at videolan.org
Sat Mar 1 14:24:52 CET 2014


vlmc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Sat Mar  1 14:20:28 2014 +0100| [7f4dbb7dfab623cc2c8d66899da08410a36235da] | committer: Hugo Beauzée-Luyssen

ClipRenderer: Cleanup

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

 src/Renderer/ClipRenderer.cpp |   25 +++++++++++++++++++------
 src/Renderer/ClipRenderer.h   |    6 ++++--
 2 files changed, 23 insertions(+), 8 deletions(-)

diff --git a/src/Renderer/ClipRenderer.cpp b/src/Renderer/ClipRenderer.cpp
index bb37156..e64bc02 100644
--- a/src/Renderer/ClipRenderer.cpp
+++ b/src/Renderer/ClipRenderer.cpp
@@ -93,11 +93,13 @@ ClipRenderer::startPreview()
     m_sourceRenderer = m_selectedClip->getMedia()->source()->createRenderer( m_eventWatcher );
     m_sourceRenderer->setOutputWidget( (void *) static_cast< RenderWidget* >( m_renderWidget )->id() );
 
-    connect( m_eventWatcher, SIGNAL( stopped() ), this, SLOT( __videoStopped() ) );
+    connect( m_eventWatcher, SIGNAL( stopped() ), this, SLOT( videoStopped() ) );
     connect( m_eventWatcher, SIGNAL( paused() ),  this, SIGNAL( paused() ) );
+    connect( m_eventWatcher, SIGNAL( paused() ), this, SLOT( videoPaused() ) );
     connect( m_eventWatcher, SIGNAL( playing() ), this, SIGNAL( playing() ) );
+    connect( m_eventWatcher, SIGNAL( playing() ), this, SLOT( videoPlaying() ) );
     connect( m_eventWatcher, SIGNAL( volumeChanged() ), this, SIGNAL( volumeChanged() ) );
-    connect( m_eventWatcher, SIGNAL( timeChanged( qint64 ) ), this, SLOT( __timeChanged( qint64 ) ) );
+    connect( m_eventWatcher, SIGNAL( timeChanged( qint64 ) ), this, SLOT( timeChanged( qint64 ) ) );
 
     m_sourceRenderer->start();
     m_sourceRenderer->setPosition( (float)m_begin / (float)m_selectedClip->getMedia()->source()->nbFrames() );
@@ -112,9 +114,7 @@ ClipRenderer::stop()
 {
     if ( m_clipLoaded == true && m_isRendering == true )
     {
-        m_isRendering = false;
         m_sourceRenderer->stop();
-        m_paused = false;
         if ( m_mediaChanged == true )
             m_clipLoaded = false;
     }
@@ -245,16 +245,29 @@ ClipRenderer::previewWidgetCursorChanged( qint64 newFrame )
 /////////////////////////////////////////////////////////////////////
 
 void
-ClipRenderer::__videoStopped()
+ClipRenderer::videoStopped()
 {
     m_isRendering = false;
+    m_paused = false;
     if ( m_mediaChanged == true )
         m_clipLoaded = false;
     emit frameChanged( 0, Vlmc::Renderer );
 }
 
 void
-ClipRenderer::__timeChanged( qint64 time )
+ClipRenderer::videoPaused()
+{
+    m_paused = !m_paused;
+}
+
+void
+ClipRenderer::videoPlaying()
+{
+    m_isRendering = true;
+}
+
+void
+ClipRenderer::timeChanged( qint64 time )
 {
     float fps = m_selectedClip->getMedia()->source()->fps();
     qint64 f = qRound64( (qreal)time / 1000.0 * fps );
diff --git a/src/Renderer/ClipRenderer.h b/src/Renderer/ClipRenderer.h
index 75acdfa..4a82333 100644
--- a/src/Renderer/ClipRenderer.h
+++ b/src/Renderer/ClipRenderer.h
@@ -83,8 +83,10 @@ public slots:
      *  \warning    The frame number computed may be unaccurate.
      *  \sa         frameChanged();
      */
-    void                    __timeChanged( qint64 time );
-    void                    __videoStopped();
+    void                    timeChanged( qint64 time );
+    void                    videoStopped();
+    void                    videoPaused();
+    void                    videoPlaying();
 };
 
 #endif // CLIPRENDERER_H



More information about the Vlmc-devel mailing list