Files
beatglow/status.go
T
2026-10-29 17:28:51 +01:00

47 lines
839 B
Go

package bragi
import (
"fmt"
"image"
"time"
)
// Status represents the current status of the audio player.
type Status struct {
Audio string
Bitrate int
Elapsed time.Duration
ElapsedPercentage float64
Err string
Volume int
Track *Track
source Source
}
func (s *Status) Source() Source {
return s.source
}
// Track represents an audio track.
type Track struct {
Artist string
Title string
Album string
Label string
Date time.Time
Track int
Disc int
Duration time.Duration
Format string
Genre []string
Path string
Image image.Image
}
func (t *Track) String() string {
if t == nil {
return "nil"
}
return fmt.Sprintf("%s - %s (%d on %s, %s)", t.Artist, t.Title, t.Track, t.Album, t.Duration)
}