track

package
v0.0.0-...-4489971 Latest Latest
Warning

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

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

Documentation

Overview

Package track provides Track, an implementation of the statefulsort interface that represents a music track on an album.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Length

func Length(s string) time.Duration

Length parses a string representing a duration. It can be used to simplify initialization of a new track.

func NewStatefulTracks

func NewStatefulTracks(tracks []*Track) statefulsort.StatefulSort

NewStatefulTracks takes a slice of track pointers as an argument and returns a statefulsort for these tracks.

func PrintTracks

func PrintTracks(s statefulsort.StatefulSort)

PrintTracks prints the tracks as they are currently sorted as a table.

Types

type Track

type Track struct {
	Title  string
	Artist string
	Album  string
	Year   int
	Length time.Duration
}

Track describes a music track on an album.

func GetTracks

func GetTracks(s statefulsort.StatefulSort) []*Track

GetTracks returns the track pointer slice for the statefulsort supplied as the argument.

Jump to

Keyboard shortcuts

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