diff options
author | Christian Pointner <equinox@helsinki.at> | 2016-01-28 17:50:15 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2016-01-28 17:50:15 (GMT) |
commit | 5b6f68fef3348ba2ddb31f280128b60d632a8ce8 (patch) | |
tree | ce8aa4b0647b74ecb49e8c31115c7b58d6549e79 /src/rhlibrary | |
parent | c61300457230b968e626a64997a1d554122bb326 (diff) |
added gui support for seeking
Diffstat (limited to 'src/rhlibrary')
-rw-r--r-- | src/rhlibrary/player_widget.go | 7 |
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 |