gui

package
v0.0.0-...-7c8f249 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 7, 2014 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ACTION_PLAY      = iota
	ACTION_PAUSE     = iota
	ACTION_PLAYPAUSE = iota
	ACTION_NEXT      = iota
	ACTION_PREVIOUS  = iota
	ACTION_QUIT      = iota
)

Player actions that can be performed from the GUI

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action int

An action type label

type ActionHandler

type ActionHandler func([]interface{})

Handlers for fired actions from the GUI

type GUI

type GUI struct {
	// contains filtered or unexported fields
}

func NewGUI

func NewGUI(buttonKeyMap map[int]Action) *GUI

Constructs and initializes a new GUI instance Args:

buttonKeyMap: a mapping between button key values and GUI actions

func (*GUI) Quit

func (this *GUI) Quit()

Shuts down the GUI

func (*GUI) RegisterActionHandler

func (this *GUI) RegisterActionHandler(action_type Action, handler ActionHandler)

Registers an action handler to be executed when a specific action is fired

func (*GUI) Run

func (this *GUI) Run()

Initiates the GUI

func (*GUI) UpdateCurrentSong

func (this *GUI) UpdateCurrentSong(current_song *mpdinfo.CurrentSong)

Updates the GUI with the currently-playing song information

func (*GUI) UpdateCurrentStatus

func (this *GUI) UpdateCurrentStatus(current_status *mpdinfo.Status)

Updates the GUI with the current MPD status

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL