playout

package
v0.20.1 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: AGPL-3.0 Imports: 24 Imported by: 0

Documentation

Overview

Package playout is a command line music/podcast/radio player with a text and visual view. There's support for ListenBrainz and ASCII art covers. See the player package for supported platforms, media and formats.

Index

Constants

View Source
const (
	UserAgent = "Playout/" + takeout.Version + " (" + takeout.Contact + ")"

	TokenAccess       = "accesstoken"
	TokenRefresh      = "refreshtoken"
	TokenMedia        = "mediatoken"
	TokenCode         = "codetoken"
	TokenListenBrainz = "lbztoken"

	EnableListenBrainz  = "enableListenBrainz"
	EnableTrackActivity = "enableTrackActivity"

	Code     = "code"
	Endpoint = "endpoint"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type PlayOptions

type PlayOptions struct {
	Query   string
	Radio   string
	Repeat  bool
	Shuffle bool
	Simple  bool
	Stream  string
	Visual  bool
	Best    bool
}

type Playout

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

func NewPlayout

func NewPlayout(config *viper.Viper, tokens *viper.Viper) *Playout

func (*Playout) AccessToken

func (p *Playout) AccessToken() string

func (*Playout) Code

func (p *Playout) Code() string

func (*Playout) CodeToken

func (p *Playout) CodeToken() string

func (*Playout) Endpoint

func (p *Playout) Endpoint() string

func (*Playout) ListenBrainzToken added in v0.11.4

func (p *Playout) ListenBrainzToken() string

func (*Playout) MediaToken

func (p *Playout) MediaToken() string

func (*Playout) Play

func (playout *Playout) Play(options PlayOptions) error

func (*Playout) RefreshToken

func (p *Playout) RefreshToken() string

func (*Playout) Transport added in v0.14.0

func (p *Playout) Transport() http.RoundTripper

func (*Playout) UpdateAccessCode

func (p *Playout) UpdateAccessCode(code, access string) error

func (*Playout) UpdateAccessToken

func (p *Playout) UpdateAccessToken(value string)

func (*Playout) UpdateListenBrainzToken added in v0.11.4

func (p *Playout) UpdateListenBrainzToken(value string) error

func (*Playout) UpdateTokens

func (p *Playout) UpdateTokens(access, refresh, media string) error

func (*Playout) UseListenBrainz added in v0.13.0

func (p *Playout) UseListenBrainz() bool

func (*Playout) UseTrackActivity added in v0.13.0

func (p *Playout) UseTrackActivity() bool

func (*Playout) UserAgent

func (p *Playout) UserAgent() string

type SimpleView

type SimpleView struct {
}

func (SimpleView) OnError

func (SimpleView) OnError(p *player.Player, err error)

func (SimpleView) OnStart

func (SimpleView) OnStart(p *player.Player)

func (SimpleView) OnStop

func (SimpleView) OnStop()

func (SimpleView) OnTrack

func (SimpleView) OnTrack(p *player.Player)

type Viewer

type Viewer interface {
	OnStart(*player.Player)
	OnTrack(*player.Player)
	OnError(*player.Player, error)
	OnStop()
}

func NewSimpleView

func NewSimpleView() Viewer

func NewVisualView

func NewVisualView() Viewer

type VisualView

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

func (*VisualView) OnError

func (v *VisualView) OnError(p *player.Player, err error)

func (*VisualView) OnStart

func (v *VisualView) OnStart(p *player.Player)

func (*VisualView) OnStop

func (v *VisualView) OnStop()

func (*VisualView) OnTrack

func (v *VisualView) OnTrack(p *player.Player)

Jump to

Keyboard shortcuts

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