shared

package
v0.0.36 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	NotStarted = iota
	Running
	Finished
)
View Source
const (
	Downloading = iota
	Searching
)
View Source
const (
	PinkTheme   = "pink"
	BlueTheme   = "blue"
	PurpleTheme = "purple"
)
View Source
const (
	HashPrefixLength = 5
)
View Source
const Version = "v0.0.36"

Version do not edit this file manually, this file is updated by the deploy script scripts/deploy.sh

Variables

This section is empty.

Functions

func DurationToString

func DurationToString(d time.Duration) string

func GetMp3Duration

func GetMp3Duration(path string) (time.Duration, error)

helper function to get mp3 duration

func StringToDuration

func StringToDuration(s string) (time.Duration, error)

function converts 00:00:00 to time.Duration

Types

type AddToPlayListArgs

type AddToPlayListArgs struct {
	PlayListName string
	Query        string
}

type IntOrString

type IntOrString struct {
	IntVal int
	StrVal string
	IsInt  bool
}

type NameHash added in v0.0.30

type NameHash struct {
	Name string
	Hash string
}

type PState

type PState uint
const (
	Playing PState = iota
	Paused
	Stopped
)

type PlayListPlayMusicArgs

type PlayListPlayMusicArgs struct {
	PlayListName string
	IndexOrName  IntOrString
}

type RemoveMusicFromPlayListArgs

type RemoveMusicFromPlayListArgs struct {
	PlayListName string
	IndexOrName  IntOrString
}

type SearchResult

type SearchResult struct {
	Title       string
	Destination string
	Type        string
	Duration    time.Duration
}

type Status

type Status struct {
	CurrMusicIndex    int
	CurrMusicPosition time.Duration
	CurrMusicDuration time.Duration
	PlayerState       PState
	MusicQueue        []string
	Volume            uint8
	Tasks             map[string]Task // key: target, value: task
}

func (Status) String

func (s Status) String() string

type Task

type Task struct {
	Type  int // download, search
	Error string
}

Jump to

Keyboard shortcuts

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