[vlmc-devel] commit: ClipMetadataDisplayer: Update the displayed fields according to the file type. ( Hugo Beauzée-Luyssen )

git at videolan.org git at videolan.org
Fri May 14 18:51:29 CEST 2010


vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Fri May 14 17:29:43 2010 +0200| [f92b974fd0cb10825c93a16b247309069a691cc5] | committer: Hugo Beauzée-Luyssen 

ClipMetadataDisplayer: Update the displayed fields according to the file type.

Right now, the FPS and resolution fields are hidden when an audio file
is displayed.

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

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

diff --git a/src/Gui/media/ClipMetadataDisplayer.cpp b/src/Gui/media/ClipMetadataDisplayer.cpp
index 3974ab7..985541e 100644
--- a/src/Gui/media/ClipMetadataDisplayer.cpp
+++ b/src/Gui/media/ClipMetadataDisplayer.cpp
@@ -43,6 +43,7 @@ ClipMetadataDisplayer::metadataUpdated( const Media *media )
     QTime   duration;
     duration = duration.addSecs( m_watchedClip->lengthSecond() );
 
+    updateInterface();
     //Duration
     m_ui->durationValueLabel->setText( duration.toString( "hh:mm:ss" ) );
     //Filename || title
@@ -73,3 +74,12 @@ ClipMetadataDisplayer::setWatchedClip( const Clip *clip )
                  this, SLOT( metadataUpdated( const Media*) ) );
     }
 }
+
+void
+ClipMetadataDisplayer::updateInterface()
+{
+    m_ui->fpsLabel->setVisible( m_watchedMedia->hasVideoTrack() );
+    m_ui->fpsValueLabel->setVisible( m_watchedMedia->hasVideoTrack() );
+    m_ui->resolutionLabel->setVisible( m_watchedMedia->hasVideoTrack() );
+    m_ui->resolutionValueLabel->setVisible( m_watchedMedia->hasVideoTrack() );
+}
diff --git a/src/Gui/media/ClipMetadataDisplayer.h b/src/Gui/media/ClipMetadataDisplayer.h
index c27ed3c..21ded0f 100644
--- a/src/Gui/media/ClipMetadataDisplayer.h
+++ b/src/Gui/media/ClipMetadataDisplayer.h
@@ -41,6 +41,12 @@ class ClipMetadataDisplayer : public QWidget
         void                            setWatchedClip( const Clip *clip );
 
     private:
+        /**
+         *  \brief      Will update the interface depending on the currently displayed
+         *              file type.
+         */
+        void                            updateInterface();
+    private:
         Ui::ClipMetadataDisplayer       *m_ui;
         const Clip                      *m_watchedClip;
         const Media                     *m_watchedMedia;



More information about the Vlmc-devel mailing list