header

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: 11 Imported by: 0

Documentation

Overview

Package header is the top bar that contains the logo, buttons, and the playlist name.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppControls

type AppControls struct {
	*gtk.Box
	OpenPlaylistButton *gtk.Button
}

func NewAppControls

func NewAppControls(parent ParentController) *AppControls

type Container

type Container struct {
	gtk.HeaderBar
	ParentController

	Left *AppControls
	Info *PlaylistInfo

	RightSide *gtk.Box
	Bitrate   *gtk.Label
	Right     *PlaylistControls
	// contains filtered or unexported fields
}

func NewContainer

func NewContainer(parent ParentController) *Container

func (*Container) PlaylistName

func (c *Container) PlaylistName() string

PlaylistName returns the current playlist, or an empty string if none.

func (*Container) RenamePlaylist

func (c *Container) RenamePlaylist(newName string)

RenamePlaylist calls the parent's RenamePlaylist with the current name.

func (*Container) Reset

func (c *Container) Reset()

func (*Container) SaveCurrentPlaylist

func (c *Container) SaveCurrentPlaylist()

func (*Container) SetBitrate

func (c *Container) SetBitrate(bits float64)

SetBitrate sets the bitrate to display. The indicator is empty if bits is less than 0.

func (*Container) SetPlaylist

func (c *Container) SetPlaylist(pl *state.Playlist)

func (*Container) SetUnsaved

func (c *Container) SetUnsaved(pl *state.Playlist)

SetUnsaved sets the header info to display the name as unchanged if the given playlist is indeed being displayed. It does nothing otherwise.

type ParentController

type ParentController interface {
	AddPlaylist(path string)
	// ParentPlaylistController methods.
	GoBack()
	HasPlaylist(name string) bool
	SavePlaylist(pl *state.Playlist)
	RenamePlaylist(pl *state.Playlist, newName string) bool
	SortSelectedTracks()
}

type ParentPlaylistController

type ParentPlaylistController interface {
	// RenamePlaylist renames the current playlist.
	RenamePlaylist(newName string)
	// HasPlaylist returns true if the playlist already exists with the given
	// name.
	HasPlaylist(name string) bool
	// PlaylistName gets the playlist name.
	PlaylistName() string
	// GoBack navigates the body leaflet to the left panel.
	GoBack()
	// SaveCurrentPlaylist saves the current playlist and marks the playlist
	// name as saved.
	SaveCurrentPlaylist()
	// SortSelectedTracks sorts the selected songs.
	SortSelectedTracks()
}

type PlaylistControls

type PlaylistControls struct {
	gtk.Revealer
	Hamburger *actions.MenuButton
	HamMenu   *actions.Menu
}

func NewPlaylistControls

func NewPlaylistControls(parent ParentPlaylistController) *PlaylistControls

type PlaylistInfo

type PlaylistInfo struct {
	gtk.Label // name
	Playlist  string
}

func NewPlaylistInfo

func NewPlaylistInfo() *PlaylistInfo

func (*PlaylistInfo) Reset

func (info *PlaylistInfo) Reset()

func (*PlaylistInfo) SetPlaylist

func (info *PlaylistInfo) SetPlaylist(pl *state.Playlist)

func (*PlaylistInfo) SetUnsaved

func (info *PlaylistInfo) SetUnsaved(unsaved bool)

Jump to

Keyboard shortcuts

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