player

package
v0.0.0-...-1c5219f Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2018 License: BSD-2-Clause Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Player

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

Player manages the streaming of an AudioAddict music channel

func NewPlayer

func NewPlayer(account *api.Account) *Player

NewPlayer creates a new Player instance.

func (*Player) Channel

func (p *Player) Channel() *api.Channel

Channel returns the current channel being played

func (*Player) Close

func (p *Player) Close()

Close stops the player and closes it. Player instance can never be used again after calling Close().

func (*Player) Play

func (p *Player) Play() bool

Play starts the player

func (*Player) PlayStop

func (p *Player) PlayStop() bool

PlayStop starts the player when it was stopped, and stops the player when it was started. When playback has stopped or there is no player attached, false is returned. Otherwise the boolean indicates if the player playing after this call.

func (*Player) SetChannel

func (p *Player) SetChannel(c *api.Channel)

SetChannel sets the channel on the player

func (*Player) SetErrorHandler

func (p *Player) SetErrorHandler(handler func(error))

func (*Player) SetPlayerPlayingHandler

func (p *Player) SetPlayerPlayingHandler(handler func())

func (*Player) SetPlayerStoppedHandler

func (p *Player) SetPlayerStoppedHandler(handler func())

func (*Player) SetPlayerTitleChangedHandler

func (p *Player) SetPlayerTitleChangedHandler(handler func())

func (*Player) SetVolume

func (p *Player) SetVolume(v int)

SetVolume changes the volume in the player. v should be a value between 0 and 100 (inclusive)

func (*Player) Stop

func (p *Player) Stop()

Stop stops the player. There is no pause since we're working with streams.

func (*Player) Volume

func (p *Player) Volume() int

Volume returns the current player volume between 0 and 100.

Jump to

Keyboard shortcuts

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