summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2016-01-28 17:50:15 (GMT)
committerChristian Pointner <equinox@helsinki.at>2016-01-28 17:50:15 (GMT)
commit5b6f68fef3348ba2ddb31f280128b60d632a8ce8 (patch)
treece8aa4b0647b74ecb49e8c31115c7b58d6549e79 /src
parentc61300457230b968e626a64997a1d554122bb326 (diff)
added gui support for seeking
Diffstat (limited to 'src')
-rw-r--r--src/rhlibrary/player_widget.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/rhlibrary/player_widget.go b/src/rhlibrary/player_widget.go
index 5dd3b97..e2de85c 100644
--- a/src/rhlibrary/player_widget.go
+++ b/src/rhlibrary/player_widget.go
@@ -114,6 +114,13 @@ func addScrubber(grid *gtk.Grid, p *player.PlayerChan) (err error) {
scale.SetRange(0, 1)
scale.SetValue(0)
+ scale.Connect("change-value", func(s *gtk.Scale) {
+ pos := s.GetValue()
+ if err := p.Seek(pos); err != nil {
+ rhdl.Println(err) // TODO: feedback at GUI?
+ }
+ })
+
p.AddUpdateHandler(func(length time.Duration, pos time.Duration, meter player.Meter, userdata interface{}) bool {
glib.IdleAdd(func() { scale.SetValue(float64(pos) / float64(length)) })
return true