radioman

package
v0.0.0-...-d942c81 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Playlist

type Playlist struct {
	Name             string    `json:"name"`
	Path             string    `json:"path"`
	CreationDate     time.Time `json:"creation_date"`
	ModificationDate time.Time `json:"modification_date"`
	Status           string    `json:"status"`
	Stats            struct {
		Tracks int `json:"tracks"`
	} `json:"stats"`
	Tracks map[string]*Track `json:"-"`
}

func (*Playlist) AutoUpdate

func (p *Playlist) AutoUpdate() error

func (*Playlist) GetRandomTrack

func (p *Playlist) GetRandomTrack() (*Track, error)

func (*Playlist) GetTrackByPath

func (p *Playlist) GetTrackByPath(path string) (*Track, error)

func (*Playlist) NewLocalTrack

func (p *Playlist) NewLocalTrack(path string) (*Track, error)

type Radio

type Radio struct {
	Name             string    `json:"name"`
	DefaultPlaylist  *Playlist `json:"default_playlist"`
	CreationDate     time.Time `json:"creation_date"`
	ModificationDate time.Time `json:"modification_date"`
	Stats            struct {
		Playlists int `json:"playlists"`
		Tracks    int `json:"tracks"`
	} `json:"stats"`
	Playlists []*Playlist        `json:"-"`
	Telnet    *liquidsoap.Telnet `json:"-"`
}

func NewRadio

func NewRadio(name string) *Radio

func (*Radio) GetNextSong

func (r *Radio) GetNextSong() (*Track, error)

func (*Radio) GetPlaylistByName

func (r *Radio) GetPlaylistByName(name string) (*Playlist, error)

func (*Radio) GetTrackByHash

func (r *Radio) GetTrackByHash(hash string) (*Track, error)

func (*Radio) Init

func (r *Radio) Init() error

func (*Radio) InitTelnet

func (r *Radio) InitTelnet() error

func (*Radio) NewDirectoryPlaylist

func (r *Radio) NewDirectoryPlaylist(name string, path string) (*Playlist, error)

func (*Radio) NewPlaylist

func (r *Radio) NewPlaylist(name string) (*Playlist, error)

func (*Radio) PlayTrack

func (r *Radio) PlayTrack(track *Track) error

func (*Radio) SkipSong

func (r *Radio) SkipSong() error

func (*Radio) StdPopulate

func (r *Radio) StdPopulate() error

func (*Radio) UpdatePlaylistsRoutine

func (r *Radio) UpdatePlaylistsRoutine()

type Track

type Track struct {
	Hash             string      `json:"hash"`
	Status           string      `json:"status"`
	Title            string      `json:"title"`
	RelPath          string      `json:"relative_path"`
	Path             string      `json:"path"`
	FileName         string      `json:"file_name"`
	FileSize         int64       `json:"file_size"`
	FileModTime      time.Time   `json:"file_modification_time"`
	CreationDate     time.Time   `json:"creation_date"`
	ModificationDate time.Time   `json:"modification_date"`
	Playlists        []*Playlist `json:"playlists"`
	Tag              struct {
		Length   time.Duration `json:"length"`
		Title    string        `json:"title"`
		Artist   string        `json:"artist"`
		Album    string        `json:"album"`
		Genre    string        `json:"genre"`
		Bitrate  int           `json:"bitrate"`
		Year     int           `json:"year"`
		Channels int           `json:"channels"`
	} `json:"tag"`
}

func NewTrack

func NewTrack(path string) (*Track, error)

func (*Track) IsValid

func (t *Track) IsValid() bool

Jump to

Keyboard shortcuts

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