gio

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: MIT Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

func BoldLabel(th *material.Theme, size float32, txt string, col color.NRGBA) material.LabelStyle

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

func DimLabel(th *material.Theme, size float32, txt string) material.LabelStyle

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

func LabelStyle(th *material.Theme, size float32, txt string, col color.NRGBA) material.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

func NewTheme

func NewTheme() *material.Theme

NewTheme creates and structures the material design colors and font defaults.

returns:
      *material.Theme

Types

type App

type App struct {
	EnableRPC bool
	// contains filtered or unexported fields
}

func NewApp

func NewApp(player *Player) *App

NewApp initializes a new OngoPlayer application window.

params:
      player: pointer to the initialized Player instance
returns:
      *App

func (*App) Run

func (a *App) Run() error

Run starts the main application event loop.

returns:
      error: any error encountered during execution
type Header struct {
	// contains filtered or unexported fields
}

Header represents the application header bar with volume control and window frame buttons.

func NewHeader

func NewHeader(player *Player, w interface{ Perform(system.Action) }) *Header

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

func (h *Header) Layout(gtx layout.Context, th *material.Theme) layout.Dimensions

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

func (h *Header) SetMaximized(m bool)

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

func (*NowPlaying) SetLyrics

func (np *NowPlaying) SetLyrics(lines []lyrics.Line, path string) bool

SetLyrics applies the loaded lyrics.

params:
      lines: parsed LRC lines
      path: file path this belongs to (avoids race conditions)
returns:
      bool: true if applied successfully, false if track changed

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

func (p *Player) CurrentTrack() *TrackMeta

CurrentTrack returns the metadata for the currently active track.

returns:
      *TrackMeta: pointer to the track data, or nil if invalid index

func (*Player) LoadFolder

func (p *Player) LoadFolder(folder string) error

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

func (p *Player) PlayTrack(index int)

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

func (p *Player) SetVolume(volume int)

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

func NewPlayerBar(player *Player) *PlayerBar

NewPlayerBar initializes a new PlayerBar component.

params:
      player: active Player instance
returns:
      *PlayerBar

func (*PlayerBar) Layout

func (pb *PlayerBar) Layout(gtx layout.Context, th *material.Theme) layout.Dimensions

Layout renders the player bar controls and progress slider.

params:
      gtx: layout context
      th: material theme
returns:
      layout.Dimensions

type TrackList

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

func NewTrackList

func NewTrackList(player *Player) *TrackList

NewTrackList initializes a new TrackList component.

params:
      player: pointer to the initialized Player instance
returns:
      *TrackList

func (*TrackList) Layout

func (tl *TrackList) Layout(gtx layout.Context, th *material.Theme) layout.Dimensions

Layout renders the tracklist UI.

params:
      gtx: layout context
      th: material theme
returns:
      layout.Dimensions

type TrackMeta

type TrackMeta struct {
	MetaResolver.TrackMeta
	Thumb image.Image // 48px sidebar thumbnail
	Cover image.Image // 256px main panel art
}

Jump to

Keyboard shortcuts

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