[vlc-devel] commit: Qt4: connect TimeLabel to the inputStateChange to display the buffering status. (Jean-Baptiste Kempf )

git version control git at videolan.org
Fri Dec 19 15:55:39 CET 2008


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Fri Dec 19 15:53:58 2008 +0100| [657a734b69ac603cb80b980cf2257600c9175df7] | committer: Jean-Baptiste Kempf 

Qt4: connect TimeLabel to the inputStateChange to display the buffering status.

DOesn't show anything yet.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=657a734b69ac603cb80b980cf2257600c9175df7
---

 modules/gui/qt4/components/interface_widgets.cpp |   10 ++++++++++
 modules/gui/qt4/components/interface_widgets.hpp |    1 +
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/modules/gui/qt4/components/interface_widgets.cpp b/modules/gui/qt4/components/interface_widgets.cpp
index 336bbc9..87bc625 100644
--- a/modules/gui/qt4/components/interface_widgets.cpp
+++ b/modules/gui/qt4/components/interface_widgets.cpp
@@ -486,6 +486,8 @@ TimeLabel::TimeLabel( intf_thread_t *_p_intf  ) :QLabel(), p_intf( _p_intf )
    setToolTip( qtr( "Toggle between elapsed and remaining time" ) );
 
 
+   CONNECT( THEMIM->getIM(), statusChanged( int ),
+            this, setStatus( int ) );
    CONNECT( THEMIM->getIM(), positionUpdated( float, int, int ),
              this, setDisplayPosition( float, int, int ) );
 }
@@ -511,6 +513,14 @@ void TimeLabel::toggleTimeDisplay()
     b_remainingTime = !b_remainingTime;
 }
 
+void TimeLabel::setStatus( int i_status )
+{
+    msg_Warn( p_intf, "Status: %i", i_status );
+
+    if( i_status == OPENING_S )
+        setText( "Buffering" );
+}
+
 bool VolumeClickHandler::eventFilter( QObject *obj, QEvent *e )
 {
     if (e->type() == QEvent::MouseButtonPress  )
diff --git a/modules/gui/qt4/components/interface_widgets.hpp b/modules/gui/qt4/components/interface_widgets.hpp
index 13eecc9..99a2eb1 100644
--- a/modules/gui/qt4/components/interface_widgets.hpp
+++ b/modules/gui/qt4/components/interface_widgets.hpp
@@ -159,6 +159,7 @@ signals:
     void timeLabelDoubleClicked();
 private slots:
     void setDisplayPosition( float pos, int time, int length );
+    void setStatus( int i_status );
 };
 
 class SpeedLabel : public QLabel




More information about the vlc-devel mailing list