]> git.sesse.net Git - vlc/commitdiff
Qt: provide a way to jump forward and backward programatically without going through...
authorJean-Baptiste Kempf <jb@videolan.org>
Sun, 22 Feb 2009 16:27:53 +0000 (17:27 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Sun, 22 Feb 2009 21:17:55 +0000 (22:17 +0100)
modules/gui/qt4/input_manager.cpp
modules/gui/qt4/input_manager.hpp

index 9067b761d79ca87c0a487f41ad158fa85c657111..a38807ec7f2a5bfde19905af638c281898686a32 100644 (file)
@@ -791,6 +791,28 @@ void InputManager::setRate( int new_rate )
         var_SetInteger( p_input, "rate", new_rate );
 }
 
+void InputManager::jumpFwd()
+{
+    int i_interval = config_GetInt( p_input, "short-jump-size" );
+    if( i_interval > 0 )
+    {
+        vlc_value_t val;
+        val.i_time = (mtime_t)(i_interval) * 1000000L;
+        var_Set( p_input, "time-offset", val );
+    }
+}
+
+void InputManager::jumpBwd()
+{
+    int i_interval = config_GetInt( p_input, "short-jump-size" );
+    if( i_interval > 0 )
+    {
+        vlc_value_t val;
+        val.i_time = -1 *(mtime_t)(i_interval) * 1000000L;
+        var_Set( p_input, "time-offset", val );
+    }
+}
+
 void InputManager::setAtoB()
 {
     if( !timeA )
index 2560045f6bb09e52b33dffe38870a49f4cd4ea2b..19af8ac60106bfebb605632990f4da0ed0ceb1be 100644 (file)
@@ -147,6 +147,9 @@ public slots:
     void faster();
     void normalRate();
     void setRate( int );
+    /* Jumping */
+    void jumpFwd();
+    void jumpBwd();
     /* Menus */
     void sectionNext();
     void sectionPrev();