controls

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CleanScaleCSS = css.PrepareClass("clean-scale", `
	.clean-scale {
		margin: -2px 0px;
	}
	.clean-scale trough,
	.clean-scale highlight {
		border-radius: 9999px;
	}
	.clean-scale slider {
		padding:    1px;
		background: none;
		transition: linear 75ms background;
	}
	.clean-scale:hover slider {
		/* Shitty hack to limit background size. Thanks, GTK. */
		background: radial-gradient(
			circle,
			@theme_selected_bg_color 0%,
			@theme_selected_bg_color 25%,
			transparent 30%,
			transparent
		);
	}
`)

Functions

This section is empty.

Types

type Buttons

type Buttons struct {
	gtk.Box
	Shuffle *gtk.ToggleButton
	Prev    *gtk.Button
	Play    *PlayPause // Pause
	Next    *gtk.Button
	Repeat  *Repeat
}

func NewButtons

func NewButtons(parent ParentController) *Buttons

func (*Buttons) SetRepeat

func (b *Buttons) SetRepeat(mode state.RepeatMode, callback bool)

SetRepeat sets Repeat's mode. It does NOT trigger a callback to the parent.

func (*Buttons) SetShuffle

func (b *Buttons) SetShuffle(shuffle bool)

SetShuffle controls the shuffle button's state and triggers the callback.

type Container

type Container struct {
	gtk.Box
	Buttons *Buttons
	Seek    *Seek
}

func NewContainer

func NewContainer(parent ParentController) *Container

type ParentController

type ParentController interface {
	Previous()
	Next()
	Seek(position float64)
	SetPlay(playing bool)
	SetRepeat(repeatMode state.RepeatMode)
	SetShuffle(shuffle bool)
}

type PlayPause

type PlayPause struct {
	gtk.Button
	// contains filtered or unexported fields
}

func NewPlayPause

func NewPlayPause(parent ParentController) *PlayPause

func (*PlayPause) IsPlaying

func (pp *PlayPause) IsPlaying() bool

func (*PlayPause) SetPlaying

func (pp *PlayPause) SetPlaying(playing bool)

type Repeat

type Repeat struct {
	gtk.ToggleButton
	// contains filtered or unexported fields
}

func NewRepeat

func NewRepeat(parent ParentController) *Repeat

func (*Repeat) SetRepeat

func (r *Repeat) SetRepeat(mode state.RepeatMode, callback bool)

type Seek

type Seek struct {
	gtk.Box
	Position  *gtk.Label
	SeekBar   *gtk.Scale
	TotalTime *gtk.Label
	// contains filtered or unexported fields
}

func NewSeek

func NewSeek(parent ParentController) *Seek

func (*Seek) UpdatePosition

func (s *Seek) UpdatePosition(pos, total float64)

Jump to

Keyboard shortcuts

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