[vlmc-devel] commit: ClipMetadataDisplayer: Clear displayed info when the clip is destroyed. ( Hugo Beauzée-Luyssen )

git at videolan.org git at videolan.org
Sun Jun 27 23:35:21 CEST 2010


vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Sun Jun 27 23:35:22 2010 +0200| [31a5f9e2f4f0dd58dd5920d06827e5f04253493a] | committer: Hugo Beauzée-Luyssen 

ClipMetadataDisplayer: Clear displayed info when the clip is destroyed.

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

 src/Gui/media/ClipMetadataDisplayer.cpp |   27 +++++++++++++++++++++++++++
 src/Gui/media/ClipMetadataDisplayer.h   |    2 ++
 2 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/src/Gui/media/ClipMetadataDisplayer.cpp b/src/Gui/media/ClipMetadataDisplayer.cpp
index 18a02e3..f817482 100644
--- a/src/Gui/media/ClipMetadataDisplayer.cpp
+++ b/src/Gui/media/ClipMetadataDisplayer.cpp
@@ -59,13 +59,40 @@ ClipMetadataDisplayer::metadataUpdated( const Media *media )
 }
 
 void
+ClipMetadataDisplayer::clear()
+{
+    m_ui->durationValueLabel->setText( "---" );
+    //Filename || title
+    m_ui->nameValueLabel->setText( "---" );
+    //Resolution
+    m_ui->resolutionValueLabel->setText( "---" );
+    //FPS
+    m_ui->fpsValueLabel->setText( "---" );
+    //nb tracks :
+    m_ui->nbVideoTracksValueLabel->setText( "---" );
+    m_ui->nbAudioTracksValueLabel->setText( "---" );
+    //Path:
+    m_ui->pathValueLabel->setText( "---" );
+}
+
+void
+ClipMetadataDisplayer::clipDestroyed( Clip* clip )
+{
+    if ( m_watchedClip == clip )
+        clear();
+}
+
+void
 ClipMetadataDisplayer::setWatchedClip( const Clip *clip )
 {
     if ( m_watchedMedia )
         disconnect( m_watchedMedia );
+    if ( m_watchedClip )
+        disconnect( m_watchedClip );
 
     m_watchedClip = clip;
     m_watchedMedia = clip->getMedia();
+    connect( m_watchedClip, SIGNAL( unloaded( Clip* ) ), this, SLOT( clipDestroyed( Clip* ) ) );
     if ( m_watchedMedia->isMetadataComputed() == true )
         metadataUpdated( m_watchedMedia );
     else
diff --git a/src/Gui/media/ClipMetadataDisplayer.h b/src/Gui/media/ClipMetadataDisplayer.h
index 71be732..4000971 100644
--- a/src/Gui/media/ClipMetadataDisplayer.h
+++ b/src/Gui/media/ClipMetadataDisplayer.h
@@ -39,6 +39,7 @@ class ClipMetadataDisplayer : public QWidget
         explicit ClipMetadataDisplayer( QWidget *parent = 0 );
 
         void                            setWatchedClip( const Clip *clip );
+        void                            clear();
 
     private:
         /**
@@ -53,6 +54,7 @@ class ClipMetadataDisplayer : public QWidget
 
     private slots:
         void                            metadataUpdated( const Media *media );
+        void                            clipDestroyed( Clip* clip );
 
 };
 



More information about the Vlmc-devel mailing list