[vlc-commits] Qt: make SeekPoints handle jump to chapter requests

Francois Cartegnie git at videolan.org
Mon Jul 11 23:14:23 CEST 2011


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sun Jul  3 22:06:07 2011 +0200| [0f762cdd6b08da606da8a9accfbd392a13402226] | committer: Francois Cartegnie

Qt: make SeekPoints handle jump to chapter requests

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

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

diff --git a/modules/gui/qt4/adapters/seekpoints.cpp b/modules/gui/qt4/adapters/seekpoints.cpp
index bf4037a..7bf5986 100644
--- a/modules/gui/qt4/adapters/seekpoints.cpp
+++ b/modules/gui/qt4/adapters/seekpoints.cpp
@@ -71,3 +71,13 @@ QList<SeekPoint> const SeekPoints::getPoints()
     return copy;
 }
 
+bool SeekPoints::jumpTo( int i_chapterindex )
+{
+    vlc_value_t val;
+    val.i_int = i_chapterindex;
+    input_thread_t *p_input_thread = playlist_CurrentInput( THEPL );
+    if( !p_input_thread ) return false;
+    bool b_succ = var_Set( p_input_thread, "chapter", val );
+    vlc_object_release( p_input_thread );
+    return ( b_succ == VLC_SUCCESS );
+}
diff --git a/modules/gui/qt4/adapters/seekpoints.hpp b/modules/gui/qt4/adapters/seekpoints.hpp
index 9ae1fba..6b31323 100644
--- a/modules/gui/qt4/adapters/seekpoints.hpp
+++ b/modules/gui/qt4/adapters/seekpoints.hpp
@@ -50,6 +50,7 @@ public:
     QList<SeekPoint> const getPoints();
     bool access() { return listMutex.tryLock( 100 ); }
     void release() { listMutex.unlock(); }
+    bool jumpTo( int );
 
 public slots:
     void update();



More information about the vlc-commits mailing list