sidebar

package
v0.0.0-...-e62810a Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2022 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const AlbumArtSize = 192

Variables

This section is empty.

Functions

func FetchAlbumArt

func FetchAlbumArt(ctx context.Context, track *state.Track, size int) *gdkpixbuf.Pixbuf

FetchAlbumArt fetches the track's album art into a pixbuf with the given size.

func FetchAlbumArtScaled

func FetchAlbumArtScaled(ctx context.Context, track *state.Track, size, scale int) *gdkpixbuf.Pixbuf

FetchAlbumArtScaled fetches the track's album art into a scaled Cairo Surface for HiDPI.

func MaxSize

func MaxSize(w, h, maxW, maxH int) (int, int)

MaxSize returns the maximum size that can fit within the given max width and height. Aspect ratio is preserved.

Types

type AlbumArt

type AlbumArt struct {
	*gtk.Revealer
	Path  string
	Image *gtk.Image
	// contains filtered or unexported fields
}

func NewAlbumArt

func NewAlbumArt() *AlbumArt

func (*AlbumArt) SetTrack

func (aa *AlbumArt) SetTrack(track *state.Track)

type Container

type Container struct {
	gtk.Box

	ListScroll   *gtk.ScrolledWindow
	PlaylistList *PlaylistList

	AlbumArt *AlbumArt
}

func NewContainer

func NewContainer(parent ParentController) *Container

type ParentController

type ParentController interface {
	SelectPlaylist(name string)
}

type Playlist

type Playlist struct {
	*gtk.ListBoxRow

	Name  string
	Total int
	// contains filtered or unexported fields
}

func NewPlaylist

func NewPlaylist(name string, total int) *Playlist

func (*Playlist) SetName

func (pl *Playlist) SetName(name string)

func (*Playlist) SetTotal

func (pl *Playlist) SetTotal(total int)

func (*Playlist) SetUnsaved

func (pl *Playlist) SetUnsaved(unsaved bool)

type PlaylistList

type PlaylistList struct {
	gtk.ListBox

	Playlists []*Playlist
	// contains filtered or unexported fields
}

func NewPlaylistList

func NewPlaylistList(parent ParentController) *PlaylistList

func (*PlaylistList) AddPlaylist

func (l *PlaylistList) AddPlaylist(pl *state.Playlist) *Playlist

func (*PlaylistList) Playlist

func (l *PlaylistList) Playlist(name string) *Playlist

func (*PlaylistList) SelectFirstPlaylist

func (l *PlaylistList) SelectFirstPlaylist() *Playlist

SelectFirstPlaylist selects the first playlist. It does nothing if there are no playlists.

func (*PlaylistList) SelectPlaylist

func (l *PlaylistList) SelectPlaylist(pl *Playlist)

SelectPlaylist selects the given playlist.

func (*PlaylistList) SetUnsaved

func (l *PlaylistList) SetUnsaved(pl *state.Playlist)

Jump to

Keyboard shortcuts

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