[vlmc-devel] commit: ClipRenderer/PreviewWidget: Fixed regression introduced in previous commit (Hugo Beauzee-Luyssen )

git at videolan.org git at videolan.org
Wed Mar 10 23:43:45 CET 2010


vlmc | branch: master | Hugo Beauzee-Luyssen <beauze.h at gmail.com> | Wed Mar 10 23:39:43 2010 +0100| [3f933749ebf6e6eaccf4b775f9a8dbc7881c199b] | committer: Hugo Beauzee-Luyssen 

ClipRenderer/PreviewWidget: Fixed regression introduced in previous commit

Fixed some slots name at the same time.

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

 src/Gui/import/ImportController.cpp |    6 +++---
 src/Gui/import/ImportController.h   |    2 +-
 src/Renderer/ClipRenderer.cpp       |   11 ++++++++++-
 src/Renderer/ClipRenderer.h         |    1 +
 4 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/src/Gui/import/ImportController.cpp b/src/Gui/import/ImportController.cpp
index 973eb91..ef7e91f 100644
--- a/src/Gui/import/ImportController.cpp
+++ b/src/Gui/import/ImportController.cpp
@@ -86,11 +86,11 @@ ImportController::ImportController(QWidget *parent) :
     connect( m_ui->forwardButton, SIGNAL( clicked() ),
              this, SLOT( forwardButtonClicked() ) );
 
-    connect( m_mediaListView, SIGNAL( clipSelected( Clip* ) ),
+    connect( this, SIGNAL( clipSelected( Clip* ) ),
              qobject_cast<const ClipRenderer*>( m_preview->getGenericRenderer() ),
              SLOT( setClip( Clip* ) ) );
     connect( m_mediaListView, SIGNAL( clipSelected( Clip* ) ),
-             this, SLOT( mediaSelection( Clip* ) ) );
+             this, SLOT( clipSelection( Clip* ) ) );
     connect( m_mediaListView, SIGNAL( clipDeleted( const QUuid& ) ),
              qobject_cast<const ClipRenderer*>( m_preview->getGenericRenderer() ),
              SLOT( clipUnloaded( const QUuid& ) ) );
@@ -122,7 +122,7 @@ ImportController::changeEvent( QEvent *e )
 }
 
 void
-ImportController::mediaSelection( Clip* clip )
+ImportController::clipSelection( Clip* clip )
 {
     const QUuid& uuid = clip->uuid();
     if ( m_currentUuid == uuid )
diff --git a/src/Gui/import/ImportController.h b/src/Gui/import/ImportController.h
index 1740102..3b8b1b0 100644
--- a/src/Gui/import/ImportController.h
+++ b/src/Gui/import/ImportController.h
@@ -85,9 +85,9 @@ class ImportController : public QDialog
     public slots:
         void        accept();
         void        reject();
-        void        mediaSelection( Clip* clip );
 
     private slots:
+        void        clipSelection( Clip* clip );
         void        forwardButtonClicked();
         void        treeViewClicked( const QModelIndex& index );
         void        treeViewDoubleClicked( const QModelIndex& index );
diff --git a/src/Renderer/ClipRenderer.cpp b/src/Renderer/ClipRenderer.cpp
index 70cdd2f..d894f36 100644
--- a/src/Renderer/ClipRenderer.cpp
+++ b/src/Renderer/ClipRenderer.cpp
@@ -59,12 +59,20 @@ ClipRenderer::~ClipRenderer()
 void
 ClipRenderer::setClip( Clip* clip )
 {
-    if ( clip == NULL || clip->length() == 0 )
+    if ( clip == NULL )
     {
         m_selectedClip = NULL;
         return ;
     }
     m_selectedClip = clip;
+    if ( clip->length() == 0 )
+        return ;
+    updateInfos( clip );
+}
+
+void
+ClipRenderer::updateInfos( Clip* clip )
+{
     m_begin = clip->begin();
     m_end = clip->end();
     if ( m_isRendering == true )
@@ -78,6 +86,7 @@ ClipRenderer::startPreview()
 {
     if ( m_selectedClip == NULL )
         return ;
+    updateInfos( m_selectedClip );
 
     //If an old media is found, we delete it, and disconnect
     if ( m_vlcMedia != NULL )
diff --git a/src/Renderer/ClipRenderer.h b/src/Renderer/ClipRenderer.h
index ac1f015..e66c872 100644
--- a/src/Renderer/ClipRenderer.h
+++ b/src/Renderer/ClipRenderer.h
@@ -79,6 +79,7 @@ public slots:
     void                    clipUnloaded( const QUuid& uuid );
     void                    clipUnloaded( const Clip* clip );
     virtual void            previewWidgetCursorChanged( qint64 newFrame );
+    void                    updateInfos( Clip* clip );
 
     /**
      *  \brief      Triggered at every libvlc_MediaPlayerTimeChanged event.



More information about the Vlmc-devel mailing list