[gnome-music] Allow to move through a song with the player scale



commit 02b08d657861e01a172772affa63030d33c645a1
Author: CÃsar GarcÃa Tapia <cesar garcia tapia openshine com>
Date:   Tue Oct 30 16:45:47 2012 +0100

    Allow to move through a song with the player scale

 src/music-player.vala |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/music-player.vala b/src/music-player.vala
index d42fc54..3d0dcda 100644
--- a/src/music-player.vala
+++ b/src/music-player.vala
@@ -168,6 +168,7 @@ private class Music.Player: GLib.Object {
         progress_scale.set_draw_value (false);
         set_duration (1);
         progress_scale.sensitive = false;
+        progress_scale.change_value.connect (on_progress_scale_change_value);
         toolbar_center.pack_start (progress_scale);
 
         song_playback_time_lbl = new Gtk.Label ("00:00");
@@ -288,4 +289,9 @@ private class Music.Player: GLib.Object {
 
         return true;
     }
+
+    private bool on_progress_scale_change_value (Gtk.ScrollType scroll, double new_value) {
+        playbin.seek_simple (Gst.Format.TIME, Gst.SeekFlags.FLUSH|Gst.SeekFlags.KEY_UNIT, (int64)new_value);
+        return false;
+    }
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]