Documentation ¶
Index ¶
- Constants
- type AudioController
- type AudioPlayer
- type BeepAudioPlayer
- type BeepController
- func (c *BeepController) Done() chan (bool)
- func (c *BeepController) PauseToggle() bool
- func (c *BeepController) Paused() bool
- func (c *BeepController) PlayState() (PlayState, error)
- func (c *BeepController) SeekBackward() error
- func (c *BeepController) SeekForward() error
- func (c *BeepController) SpeedDown()
- func (c *BeepController) SpeedUp()
- func (c *BeepController) Stop()
- func (c *BeepController) VolumeDown()
- func (c *BeepController) VolumeUp()
- type MockAudioController
- func (p *MockAudioController) PauseToggle() bool
- func (p *MockAudioController) Paused() bool
- func (p *MockAudioController) PlayState() (PlayState, error)
- func (p *MockAudioController) SeekBackward() error
- func (p *MockAudioController) SeekForward() error
- func (p *MockAudioController) SpeedDown()
- func (p *MockAudioController) SpeedUp()
- func (p *MockAudioController) Stop()
- func (p *MockAudioController) VolumeDown()
- func (p *MockAudioController) VolumeUp()
- type MockAudioPlayer
- type PlayState
Constants ¶
const (
// SeekSecs is the amount of seconds to skip forward or backward
SeekSecs = 5
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AudioController ¶
type AudioController interface { Paused() bool PauseToggle() bool PlayState() (PlayState, error) SeekForward() error SeekBackward() error SpeedUp() SpeedDown() Stop() VolumeUp() VolumeDown() }
AudioController will control playing audio
type AudioPlayer ¶
type AudioPlayer interface {
Play(library.Track, bool) (AudioController, error)
}
AudioPlayer is an interface for playing audio tracks.
type BeepAudioPlayer ¶
type BeepAudioPlayer struct{}
BeepAudioPlayer is an audio player implementation that uses beep
func (*BeepAudioPlayer) Play ¶
func (bmp *BeepAudioPlayer) Play(track library.Track, repeat bool) (AudioController, error)
Play a track and return a controller that lets you perform changes to a running track.
type BeepController ¶
type BeepController struct {
// contains filtered or unexported fields
}
BeepController manages playing audio.
TODO: make this an interface. this is fine for now since we're only using beep our audio player.
func (*BeepController) Done ¶
func (c *BeepController) Done() chan (bool)
Done returns a done channel
func (*BeepController) PauseToggle ¶
func (c *BeepController) PauseToggle() bool
PauseToggle pauses/unpauses audio. Returns true if currently paused, false if unpaused.
func (*BeepController) Paused ¶
func (c *BeepController) Paused() bool
Paused returns current pause state
func (*BeepController) PlayState ¶
func (c *BeepController) PlayState() (PlayState, error)
PlayState returns the current state of playing audio.
func (*BeepController) SeekBackward ¶
func (c *BeepController) SeekBackward() error
SeekBackward moves progress backward
func (*BeepController) SeekForward ¶
func (c *BeepController) SeekForward() error
SeekForward moves progress forward
func (*BeepController) VolumeDown ¶
func (c *BeepController) VolumeDown()
VolumeDown the playing track
type MockAudioController ¶
type MockAudioController struct{}
func (*MockAudioController) PauseToggle ¶
func (p *MockAudioController) PauseToggle() bool
func (*MockAudioController) Paused ¶
func (p *MockAudioController) Paused() bool
func (*MockAudioController) PlayState ¶
func (p *MockAudioController) PlayState() (PlayState, error)
func (*MockAudioController) SeekBackward ¶
func (p *MockAudioController) SeekBackward() error
func (*MockAudioController) SeekForward ¶
func (p *MockAudioController) SeekForward() error
func (*MockAudioController) SpeedDown ¶
func (p *MockAudioController) SpeedDown()
func (*MockAudioController) SpeedUp ¶
func (p *MockAudioController) SpeedUp()
func (*MockAudioController) Stop ¶
func (p *MockAudioController) Stop()
func (*MockAudioController) VolumeDown ¶
func (p *MockAudioController) VolumeDown()
func (*MockAudioController) VolumeUp ¶
func (p *MockAudioController) VolumeUp()
type MockAudioPlayer ¶
type MockAudioPlayer struct{}
MockAudioPlayer is an audio player implementation that uses beep
func (*MockAudioPlayer) Play ¶
func (bmp *MockAudioPlayer) Play(track library.Track, repeat bool) (*MockAudioController, error)
Play a track and return a controller that lets you perform changes to a running track.