[vlc-commits] qt: update seek capability when changed

Thomas Guillem git at videolan.org
Fri Jul 13 09:35:51 CEST 2018


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Jul 13 09:34:20 2018 +0200| [e3294f209a74fcb7fc64c9afd16bf68b9fc4a8ff] | committer: Thomas Guillem

qt: update seek capability when changed

And not only when a title or chapter event is sent.

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

 modules/gui/qt/input_manager.cpp | 11 +++++++++++
 modules/gui/qt/input_manager.hpp |  2 ++
 2 files changed, 13 insertions(+)

diff --git a/modules/gui/qt/input_manager.cpp b/modules/gui/qt/input_manager.cpp
index 426a0dc7aa..98e3f81f22 100644
--- a/modules/gui/qt/input_manager.cpp
+++ b/modules/gui/qt/input_manager.cpp
@@ -230,6 +230,9 @@ void InputManager::customEvent( QEvent *event )
     /* Actions */
     switch( i_type )
     {
+    case IMEvent::CapabilitiesChanged:
+        UpdateCapabilities();
+        break;
     case IMEvent::PositionUpdate:
         UpdatePosition();
         break;
@@ -340,6 +343,9 @@ static int InputEvent( vlc_object_t *, const char *,
     case INPUT_EVENT_RATE:
         event = new IMEvent( IMEvent::ItemRateChanged );
         break;
+    case INPUT_EVENT_CAPABILITIES:
+        event = new IMEvent( IMEvent::CapabilitiesChanged );
+        break;
     case INPUT_EVENT_POSITION:
     //case INPUT_EVENT_LENGTH:
         event = new IMEvent( IMEvent::PositionUpdate );
@@ -476,6 +482,11 @@ void InputManager::UpdateNavigation()
         emit inputCanSeek( false );
 }
 
+void InputManager::UpdateCapabilities()
+{
+    emit inputCanSeek( var_GetBool( p_input, "can-seek" ) );
+}
+
 void InputManager::UpdateStatus()
 {
     /* Update playing status */
diff --git a/modules/gui/qt/input_manager.hpp b/modules/gui/qt/input_manager.hpp
index 5c3f2b3dff..305891124c 100644
--- a/modules/gui/qt/input_manager.hpp
+++ b/modules/gui/qt/input_manager.hpp
@@ -68,6 +68,7 @@ public:
         RandomChanged,
         LoopOrRepeatChanged, /* 20 */
         EPGEvent,
+        CapabilitiesChanged,
     /*    SignalChanged, */
 
         FullscreenControlToggle = QEvent::User + IMEventTypeOffset + 50,
@@ -167,6 +168,7 @@ private:
     void UpdateName();
     void UpdateStatus();
     void UpdateNavigation();
+    void UpdateCapabilities();
     void UpdatePosition();
     void UpdateTeletext();
     void UpdateArt();



More information about the vlc-commits mailing list