lyrics

package
v0.0.0-...-06561dd Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package lyrics provides a way to work with both synced and plain lyrics

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Instrumental

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

func (*Instrumental) Current

func (i *Instrumental) Current() (Lyric, bool)

func (*Instrumental) GetSong

func (i *Instrumental) GetSong() model.Song

func (*Instrumental) Next

func (i *Instrumental) Next() (Lyric, bool)

func (*Instrumental) Previous

func (i *Instrumental) Previous(amount int) []Lyric

func (*Instrumental) Progress

func (i *Instrumental) Progress() float64

func (*Instrumental) Upcoming

func (i *Instrumental) Upcoming(amount int) []Lyric

type LRC

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

func (*LRC) Current

func (l *LRC) Current() (Lyric, bool)

func (*LRC) GetSong

func (l *LRC) GetSong() model.Song

func (*LRC) Next

func (l *LRC) Next() (Lyric, bool)

func (*LRC) Previous

func (l *LRC) Previous(amount int) []Lyric

func (*LRC) Progress

func (l *LRC) Progress() float64

func (*LRC) Upcoming

func (l *LRC) Upcoming(amount int) []Lyric

type Lyric

type Lyric struct {
	Text     string
	Duration time.Duration
}

Lyric represents a single lyric line.

type Lyrics

type Lyrics interface {
	GetSong() model.Song    // GetSong returns the song associated to the lyrics
	Previous(int) []Lyric   // Previous returns the previous 'int amount' of lyrics without affecting the current lyric
	Current() (Lyric, bool) // Current provides the current lyric and a bool indicating if there is one
	Next() (Lyric, bool)    // Next returns the next lyric and a bool if there are any
	Upcoming(int) []Lyric   // Upcoming returns the next `int amount` of lyrics without affecting the current lyric
	Progress() float64      // Progress returns the fraction of lyrics that have been used
}

Lyrics is the common interface for different lyric types

func New

func New(song model.Song) Lyrics

New returns a new object that implements the Lyrics interface

type Missing

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

func (*Missing) Current

func (m *Missing) Current() (Lyric, bool)

func (*Missing) GetSong

func (m *Missing) GetSong() model.Song

func (*Missing) Next

func (m *Missing) Next() (Lyric, bool)

func (*Missing) Previous

func (m *Missing) Previous(_ int) []Lyric

func (*Missing) Progress

func (m *Missing) Progress() float64

func (*Missing) Upcoming

func (m *Missing) Upcoming(_ int) []Lyric

type Plain

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

func (*Plain) Current

func (p *Plain) Current() (Lyric, bool)

func (*Plain) GetSong

func (p *Plain) GetSong() model.Song

func (*Plain) Next

func (p *Plain) Next() (Lyric, bool)

func (*Plain) Previous

func (p *Plain) Previous(_ int) []Lyric

func (*Plain) Progress

func (p *Plain) Progress() float64

func (*Plain) Upcoming

func (p *Plain) Upcoming(_ int) []Lyric

Jump to

Keyboard shortcuts

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