diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/rhlibrary/player_widget.go | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/src/rhlibrary/player_widget.go b/src/rhlibrary/player_widget.go index 33fa88d..7581b45 100644 --- a/src/rhlibrary/player_widget.go +++ b/src/rhlibrary/player_widget.go @@ -71,10 +71,36 @@ func addStopButton(grid *gtk.Grid, p *player.PlayerChan) (err error) { return } +func addMeter(grid *gtk.Grid, p *player.PlayerChan) (err error) { + var mgrid *gtk.Grid + if mgrid, err = gtk.GridNew(); err != nil { + return + } + mgrid.SetOrientation(gtk.ORIENTATION_VERTICAL) + mgrid.SetColumnSpacing(3) + + var left, right *gtk.LevelBar + if left, err = gtk.LevelBarNewForInterval(0, 30); err != nil { + return + } + if right, err = gtk.LevelBarNewForInterval(0, 30); err != nil { + return + } + left.SetMode(gtk.LEVEL_BAR_MODE_DISCRETE) + right.SetMode(gtk.LEVEL_BAR_MODE_DISCRETE) + left.SetValue(8) + right.SetValue(17) + mgrid.Add(left) + mgrid.Add(right) + + grid.Add(mgrid) + return +} + func getPlayerWidget(p *player.PlayerChan) (gtk.IWidget, error) { + var err error var grid *gtk.Grid - grid, err := gtk.GridNew() - if err != nil { + if grid, err = gtk.GridNew(); err != nil { return nil, err } grid.SetOrientation(gtk.ORIENTATION_HORIZONTAL) @@ -89,6 +115,14 @@ func getPlayerWidget(p *player.PlayerChan) (gtk.IWidget, error) { if err = addStopButton(grid, p); err != nil { return nil, err } + if err = addMeter(grid, p); err != nil { + return nil, err + } - return grid, nil + var frame *gtk.Frame + if frame, err = gtk.FrameNew("player"); err != nil { + return nil, err + } + frame.Add(grid) + return frame, nil } |