Documentation
¶
Index ¶
- Variables
- func BoldLabel(th *material.Theme, size float32, txt string, col color.NRGBA) material.LabelStyle
- func CenteredLabel(th *material.Theme, size float32, txt string, col color.NRGBA) material.LabelStyle
- func DimLabel(th *material.Theme, size float32, txt string) material.LabelStyle
- func LabelStyle(th *material.Theme, size float32, txt string, col color.NRGBA) material.LabelStyle
- func LayoutDivider(gtx layout.Context) layout.Dimensions
- func LayoutVerticalDivider(gtx layout.Context) layout.Dimensions
- func NewTheme() *material.Theme
- type App
- type Header
- type NowPlaying
- type Player
- type PlayerBar
- type TrackList
- type TrackMeta
Constants ¶
This section is empty.
Variables ¶
var ( ColorBg = color.NRGBA{R: 14, G: 14, B: 18, A: 255} // #0e0e12 main background ColorSidebar = color.NRGBA{R: 17, G: 17, B: 22, A: 255} // #111116 sidebar background ColorSurface = color.NRGBA{R: 26, G: 26, B: 34, A: 255} // #1a1a22 hover/card states ColorAccent = color.NRGBA{R: 184, G: 160, B: 240, A: 255} // #b8a0f0 purple accent ColorText = color.NRGBA{R: 224, G: 224, B: 224, A: 255} // rgba(255,255,255,0.88) ColorTextDim = color.NRGBA{R: 97, G: 97, B: 97, A: 255} // rgba(255,255,255,0.38) ColorDivider = color.NRGBA{R: 255, G: 255, B: 255, A: 15} // rgba(255,255,255,0.06) ColorBar = color.NRGBA{R: 255, G: 255, B: 255, A: 26} // rgba(255,255,255,0.1) ColorWhite = color.NRGBA{R: 255, G: 255, B: 255, A: 255} // pure white for play btn ColorDark = color.NRGBA{R: 14, G: 14, B: 18, A: 255} // dark icon on white btn )
Functions ¶
func BoldLabel ¶
BoldLabel returns a font-weighted text label.
params:
th: material theme instance
size: text scale in SP
txt: literal string to render
col: NRGBA text color
returns:
material.LabelStyle
func CenteredLabel ¶
func CenteredLabel(th *material.Theme, size float32, txt string, col color.NRGBA) material.LabelStyle
CenteredLabel returns a label configured to align its text in the center.
params:
th: material theme instance
size: text scale in SP
txt: literal string to render
col: NRGBA text color
returns:
material.LabelStyle
func DimLabel ¶
DimLabel returns a dimly lit text label, suited for subtexts.
params:
th: material theme instance
size: text scale in SP
txt: literal string to render
returns:
material.LabelStyle
func LabelStyle ¶
LabelStyle returns a basic configured text label.
params:
th: material theme instance
size: text scale in SP
txt: literal string to render
col: NRGBA text color
returns:
material.LabelStyle
func LayoutDivider ¶
func LayoutDivider(gtx layout.Context) layout.Dimensions
LayoutDivider draws a thin horizontal line separator.
params:
gtx: layout context
returns:
layout.Dimensions
func LayoutVerticalDivider ¶
func LayoutVerticalDivider(gtx layout.Context) layout.Dimensions
LayoutVerticalDivider draws a layout line separating vertical panels.
params:
gtx: layout context
returns:
layout.Dimensions
Types ¶
type App ¶
type App struct {
EnableRPC bool
// contains filtered or unexported fields
}
type Header ¶
type Header struct {
// contains filtered or unexported fields
}
Header represents the application header bar with volume control and window frame buttons.
func NewHeader ¶
NewHeader initializes a new Header instance with the given player and window.
params:
player: pointer to the Player instance
w: window interface for system actions
returns:
*Header
func (*Header) Layout ¶
Layout renders the header bar with volume control and window controls.
params:
gtx: layout context
th: material theme for styling
returns:
layout.Dimensions
func (*Header) SetMaximized ¶
SetMaximized updates the maximized state of the window header.
params:
m: true if window is maximized, false otherwise
type NowPlaying ¶
type NowPlaying struct {
// contains filtered or unexported fields
}
func NewNowPlaying ¶
func NewNowPlaying(player *Player) *NowPlaying
NewNowPlaying creates a new NowPlaying component instance.
params:
player: pointer to the active Player
returns:
*NowPlaying
func (*NowPlaying) ClearLyrics ¶
func (np *NowPlaying) ClearLyrics(path string)
ClearLyrics safely empties the stored lyrics if no data is found.
params:
path: track path to clear lyrics for
func (*NowPlaying) Layout ¶
func (np *NowPlaying) Layout(gtx layout.Context, th *material.Theme) layout.Dimensions
Layout renders the NowPlaying component, including album art and inline lyrics.
params:
gtx: layout context
th: material theme
returns:
layout.Dimensions
func (*NowPlaying) SetLoading ¶
func (np *NowPlaying) SetLoading(path string)
SetLoading indicates that lyrics for the given path are currently being loaded.
params:
path: file path of the currently loading track
type Player ¶
type Player struct {
Engine *stelleengine.StelleEngine
Queue []TrackMeta
Current int
Volume int
MusicDir string
OnUpdate func()
OnTrackChange func(track TrackMeta)
// contains filtered or unexported fields
}
func NewPlayer ¶
func NewPlayer(engine *stelleengine.StelleEngine, volume int) *Player
NewPlayer creates an instance of Player and initializes its fields.
params:
engine: Audio engine reference
volume: Initial volume level (0-100)
returns:
*Player
func (*Player) CurrentTrack ¶
CurrentTrack returns the metadata for the currently active track.
returns:
*TrackMeta: pointer to the track data, or nil if invalid index
func (*Player) LoadFolder ¶
LoadFolder scans a local directory for audio files and populates the Queue. Delegates metadata resolution to the shared MetaResolver package, then generates Gio-specific image thumbnails from the raw cover bytes.
params:
folder: Path to directory
returns:
error: Returns on decoding errors or missing paths
func (*Player) Next ¶
func (p *Player) Next()
Next advances playback to the next track in the queue, wrapping around.
func (*Player) PlayTrack ¶
PlayTrack seeks to the specified track index and begins playback. It also lazy-loads the track's cover art and clears previous covers to save RAM.
params:
index: The queue index to play
func (*Player) Prev ¶
func (p *Player) Prev()
Prev reverses playback to the previous track in the queue, wrapping around.
func (*Player) SetVolume ¶
SetVolume changes the playback volume.
params:
volume: Target volume level (0-100)
func (*Player) TogglePause ¶
func (p *Player) TogglePause()
TogglePause switches between playing and paused state.
type PlayerBar ¶
type PlayerBar struct {
// contains filtered or unexported fields
}
func NewPlayerBar ¶
NewPlayerBar initializes a new PlayerBar component.
params:
player: active Player instance
returns:
*PlayerBar
type TrackList ¶
type TrackList struct {
// contains filtered or unexported fields
}
func NewTrackList ¶
NewTrackList initializes a new TrackList component.
params:
player: pointer to the initialized Player instance
returns:
*TrackList