playlist

package
v0.0.0-...-e62810a Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2022 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(fileExt string, r PlaylistReader, w PlaylistWriter)

func ResetQueue

func ResetQueue(queue []int)

ResetQueue resets the queue to the usual incremental order.

func ShuffleQueue

func ShuffleQueue(queue []int)

ShuffleQueue shuffles the given list of track indices.

func SupportedExtensions

func SupportedExtensions() []string

func TitleFromPath

func TitleFromPath(path string) string

TitleFromPath grabs the file basename from the given path, which could be used as a title placeholder.

Types

type FixableError

type FixableError interface {
	error
	Fix(playlist *Playlist)
}

FixableError is returned from PlaylistWriter if the error can be fixed automatically.

type Playlist

type Playlist struct {
	Name   string
	Path   string
	Tracks []Track
}

func ParseFile

func ParseFile(path string) (*Playlist, error)

func (*Playlist) Save

func (pl *Playlist) Save(done func(error))

Save saves the playlist. The function must not be called in another goroutine. The done callback may be called in a goroutine.

type PlaylistReader

type PlaylistReader func(path string) (*Playlist, error)

type PlaylistWriter

type PlaylistWriter func(pl *Playlist, done func(error)) error

type Track

type Track struct {
	Title  string
	Artist string
	Album  string
	Genre  string
	Date   string

	Filepath string `json:",omitempty"`

	Number  int
	Length  time.Duration
	Bitrate int

	// Unprobeable is true if the Track cannot be probed.
	Unprobeable bool `json:"unprobeable,omitempty"`
}

func (*Track) ForceProbe

func (t *Track) ForceProbe() error

func (Track) IsProbed

func (t Track) IsProbed() bool

IsProbed returns true if the track is probed.

func (*Track) Probe

func (t *Track) Probe() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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