song

package
v0.0.0-...-0cbbf0d Latest Latest
Warning

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

Go to latest
Published: May 5, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const NullID int = -1
View Source
const NullPosition int = -1

Variables

This section is empty.

Functions

This section is empty.

Types

type Song

type Song struct {
	ID         int
	Position   int
	Time       int
	Tags       Taglist
	StringTags StringTaglist
	SortTags   StringTaglist
}

Song represents a combined view of a song from both MPD and PMS' perspectives.

func New

func New() (s *Song)

func (*Song) AutoFill

func (s *Song) AutoFill()

AutoFill post-processes and caches song tags.

func (*Song) FillSortTags

func (s *Song) FillSortTags()

FillSortTags post-processes tags, and saves them as strings for sorting purposes later on.

func (*Song) HasOneOfTags

func (s *Song) HasOneOfTags(tags ...string) bool

HasOneOfTags returns true if the song contains at least one of the tags mentioned.

func (*Song) NullID

func (s *Song) NullID() bool

NullID returns true if the song's ID is not present.

func (*Song) NullPosition

func (s *Song) NullPosition() bool

NullPosition returns true if the song's osition is not present.

func (*Song) SetTags

func (s *Song) SetTags(tags mpd.Attrs)

func (*Song) TagKeys

func (s *Song) TagKeys() []string

TagKeys returns a string slice with all tag keys, sorted in alphabetical order.

type StringTaglist

type StringTaglist map[string]string

type Tag

type Tag []rune

type Taglist

type Taglist map[string]Tag

Jump to

Keyboard shortcuts

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