summaryrefslogtreecommitdiff
path: root/src/rhlibrary/payer_widget.go
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2016-01-15 01:36:13 (GMT)
committerChristian Pointner <equinox@helsinki.at>2016-01-15 01:36:13 (GMT)
commit28a85e445066a379cd6ec82b936e727f0508be70 (patch)
tree9845bb5f5fd9e5163bfb2819ac5ae0f748acbc3d /src/rhlibrary/payer_widget.go
parent11418af287bf6724b2465da76c1a6e82a043d610 (diff)
fixed name of new file
Diffstat (limited to 'src/rhlibrary/payer_widget.go')
-rw-r--r--src/rhlibrary/payer_widget.go95
1 files changed, 0 insertions, 95 deletions
diff --git a/src/rhlibrary/payer_widget.go b/src/rhlibrary/payer_widget.go
deleted file mode 100644
index 8e2d7e3..0000000
--- a/src/rhlibrary/payer_widget.go
+++ /dev/null
@@ -1,95 +0,0 @@
-//
-// rhlibrary
-//
-// The Radio Helsinki Rivendell Library
-//
-//
-// Copyright (C) 2016 Christian Pointner <equinox@helsinki.at>
-//
-// This file is part of rhlibrary.
-//
-// rhlibrary is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// any later version.
-//
-// rhlibrary is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with rhlibrary. If not, see <http://www.gnu.org/licenses/>.
-//
-
-package main
-
-import (
- "code.helsinki.at/rhrd-go/player"
- "github.com/gotk3/gotk3/gtk"
-)
-
-func addPlayButton(grid *gtk.Grid, p *player.PlayerChan) (err error) {
- var btn *gtk.Button
- if btn, err = gtk.ButtonNewFromIconName("media-playback-start", gtk.ICON_SIZE_DIALOG); err != nil {
- return
- }
- btn.Connect("clicked", func(_ *gtk.Button) {
- if err := p.Play(); err != nil {
- rhdl.Println(err) // TODO: feedback at GUI?
- }
- })
- grid.Add(btn)
- return
-}
-
-func addPauseButton(grid *gtk.Grid, p *player.PlayerChan) (err error) {
- var btn *gtk.Button
- if btn, err = gtk.ButtonNewFromIconName("media-playback-pause", gtk.ICON_SIZE_DIALOG); err != nil {
- return
- }
- btn.Connect("clicked", func(_ *gtk.Button) {
- if err := p.Pause(); err != nil {
- rhdl.Println(err) // TODO: feedback at GUI?
- }
- })
- grid.Add(btn)
- return
-}
-
-func addStopButton(grid *gtk.Grid, p *player.PlayerChan) (err error) {
- var btn *gtk.Button
- if btn, err = gtk.ButtonNewFromIconName("media-playback-stop", gtk.ICON_SIZE_DIALOG); err != nil {
- return
- }
- btn.Connect("clicked", func(_ *gtk.Button) {
- if err := p.Stop(); err != nil {
- rhdl.Println(err) // TODO: feedback at GUI?
- }
- })
- grid.Add(btn)
- return
-}
-
-func getPlayerWidget(p *player.PlayerChan) (gtk.IWidget, error) {
-
- var grid *gtk.Grid
- grid, err := gtk.GridNew()
- if err != nil {
- return nil, err
- }
- grid.SetOrientation(gtk.ORIENTATION_HORIZONTAL)
- grid.SetColumnSpacing(3)
-
- if err = addPlayButton(grid, p); err != nil {
- return nil, err
- }
- if err = addPauseButton(grid, p); err != nil {
- return nil, err
- }
- if err = addStopButton(grid, p); err != nil {
- return nil, err
- }
-
- return grid, nil
-}