ui

package
v0.0.0-...-ca95078 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2024 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AlbumImageWidth  = 256
	AlbumImageHeight = 256
	TrackImageWidth  = 48
	TrackImageHeight = 48

	VolumePageLevel = 5
)

Variables

This section is empty.

Functions

func Sanitize

func Sanitize(s string) string

func ShowAboutDialog

func ShowAboutDialog(parent *gtk.Window, about string) error

func ShowControlsDialog

func ShowControlsDialog(window gtk.IWindow, controls *Controls, listener ControlsListener) error

func ShowSettingsDialog

func ShowSettingsDialog(window gtk.IWindow, settings *Settings) (bool, error)

Types

type ConfigAdapter

type ConfigAdapter interface {
	Get(key string, defvalue interface{}) interface{}
	Set(key string, value interface{})
	Save() error
}

type Controller

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

func NewController

func NewController(application *gtk.Application, config ConfigAdapter,
	version string, build string) (*Controller, error)

func (*Controller) AboutPress

func (ctl *Controller) AboutPress()

func (*Controller) AudioInputSelect

func (ctl *Controller) AudioInputSelect(index int)

func (*Controller) AudioOutputSelect

func (ctl *Controller) AudioOutputSelect(index int)

func (*Controller) BalanceSelect

func (ctl *Controller) BalanceSelect(value float64)

func (*Controller) ControlsPress

func (ctl *Controller) ControlsPress()

func (*Controller) DeviceSelect

func (ctl *Controller) DeviceSelect(index int)

func (*Controller) EqualizerSelect

func (ctl *Controller) EqualizerSelect(name string)

func (*Controller) FadeEffectsSelect

func (ctl *Controller) FadeEffectsSelect(on bool)

func (*Controller) FixedVolumeSelect

func (ctl *Controller) FixedVolumeSelect(on bool)

func (*Controller) GetLoopStatus

func (ctl *Controller) GetLoopStatus() mpris.LoopStatus

func (*Controller) GetMetadata

func (ctl *Controller) GetMetadata() *mpris.Metadata

func (*Controller) GetPosition

func (ctl *Controller) GetPosition() time.Duration

func (*Controller) GetShuffle

func (ctl *Controller) GetShuffle() bool

func (*Controller) GetVolume

func (ctl *Controller) GetVolume() int

func (*Controller) LoopPress

func (ctl *Controller) LoopPress()

func (*Controller) MutePress

func (ctl *Controller) MutePress()

func (*Controller) Next

func (ctl *Controller) Next()

func (*Controller) NextPress

func (ctl *Controller) NextPress()

func (*Controller) Pause

func (ctl *Controller) Pause()

func (*Controller) Play

func (ctl *Controller) Play()

func (*Controller) PlayListSelect

func (ctl *Controller) PlayListSelect(index int)

func (*Controller) PlayPausePress

func (ctl *Controller) PlayPausePress()

func (*Controller) PlaybackStatus

func (ctl *Controller) PlaybackStatus() mpris.PlaybackStatus

func (*Controller) Previous

func (ctl *Controller) Previous()

func (*Controller) PreviousPress

func (ctl *Controller) PreviousPress()

func (*Controller) RefreshPress

func (ctl *Controller) RefreshPress()

func (*Controller) Seek

func (ctl *Controller) Seek(offset time.Duration)

func (*Controller) SeekSelect

func (ctl *Controller) SeekSelect(position float64)

///////////////////////////////////////////////////////////////////////////// ViewListener Interface (called from main thread) /////////////////////////////////////////////////////////////////////////////

func (*Controller) SetLoopStatus

func (ctl *Controller) SetLoopStatus(status mpris.LoopStatus)

func (*Controller) SetPosition

func (ctl *Controller) SetPosition(position time.Duration)

func (*Controller) SetShuffle

func (ctl *Controller) SetShuffle(shuffle bool)

func (*Controller) SetVolume

func (ctl *Controller) SetVolume(level int)

func (*Controller) SettingsPress

func (ctl *Controller) SettingsPress()

func (*Controller) ShufflePress

func (ctl *Controller) ShufflePress()

func (*Controller) TrackSelect

func (ctl *Controller) TrackSelect(index int)

func (*Controller) VolumeSelect

func (ctl *Controller) VolumeSelect(level int)

func (*Controller) WindowHidden

func (ctl *Controller) WindowHidden(flag bool)

type Controls

type Controls struct {
	AudioOutput     int
	AudioOutputList []string
	AudioInput      int
	AudioInputList  []string
	Balance         float64
	FadeEffects     bool
	FixedVolume     bool
}

type ControlsListener

type ControlsListener interface {
	AudioOutputSelect(index int)
	AudioInputSelect(index int)
	BalanceSelect(value float64)
	FadeEffectsSelect(on bool)
	FixedVolumeSelect(on bool)
}

type Device

type Device struct {
	Name string `yaml:"Name"`
	Url  string `yaml:"Url"`
}

type LoopState

type LoopState uint
const (
	LoopNone LoopState = iota
	LoopOne
	LoopAll
)

type PixbufRequest

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

type PlayerState

type PlayerState uint
const (
	PlayerUnavailable PlayerState = iota
	PlayerPlaying
	PlayerPaused
)

type RunReq

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

type ScaleExt

type ScaleExt struct {
	*gtk.Scale
}

func ScaleExtNew

func ScaleExtNew(orientaion gtk.Orientation, adjustment *gtk.Adjustment) (*ScaleExt, error)

func (*ScaleExt) SetHasOrigin

func (scale *ScaleExt) SetHasOrigin(hasOrigin bool)

type Settings

type Settings struct {
	SendNotifications bool
	MprisSupport      bool
	ShowStatusIcon    bool
	HideOnClose       bool
	HideOnStart       bool
}

type View

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

func NewView

func NewView(application *gtk.Application, listener ViewListener) (*View, error)

func (*View) AddDevice

func (view *View) AddDevice(name string)

func (*View) AddPlayList

func (view *View) AddPlayList(name string)

func (*View) AddTrack

func (view *View) AddTrack(title string, artist string) error

func (*View) ClearDevices

func (view *View) ClearDevices()

func (*View) ClearEqualizers

func (view *View) ClearEqualizers()

func (*View) ClearPlayLists

func (view *View) ClearPlayLists()

func (*View) ClearTracks

func (view *View) ClearTracks()

func (*View) GetWindow

func (view *View) GetWindow() *gtk.Window

func (*View) Hide

func (view *View) Hide()

func (*View) HideOnDelete

func (view *View) HideOnDelete(enable bool)

func (*View) SetAlbumArt

func (view *View) SetAlbumArt(album *gdk.Pixbuf)

func (*View) SetDevice

func (view *View) SetDevice(index int)

func (*View) SetEqualizerOn

func (view *View) SetEqualizerOn(on bool)

func (*View) SetEqualizers

func (view *View) SetEqualizers(names []string, selected string) error

func (*View) SetInfo

func (view *View) SetInfo(quality string, rate int, format string, bitrate int)

func (*View) SetLoopState

func (view *View) SetLoopState(state LoopState)

func (*View) SetMute

func (view *View) SetMute(mute bool)

func (*View) SetPlayList

func (view *View) SetPlayList(index int)

func (*View) SetPlayerState

func (view *View) SetPlayerState(state PlayerState)

func (*View) SetPlaying

func (view *View) SetPlaying(title string, artist string, album string)

func (*View) SetSeek

func (view *View) SetSeek(used time.Duration, total time.Duration)

func (*View) SetShuffle

func (view *View) SetShuffle(on bool)

func (*View) SetStatus

func (view *View) SetStatus(status string)

func (*View) SetTrack

func (view *View) SetTrack(index int)

func (*View) SetTrackAlbumArt

func (view *View) SetTrackAlbumArt(index int, album *gdk.Pixbuf) error

func (*View) SetVolume

func (view *View) SetVolume(level int)

func (*View) ShowStatusIcon

func (view *View) ShowStatusIcon(enable bool)

type ViewListener

type ViewListener interface {
	SeekSelect(position float64)
	ShufflePress()
	PreviousPress()
	PlayPausePress()
	NextPress()
	LoopPress()
	VolumeSelect(level int)
	PlayListSelect(index int)
	TrackSelect(index int)
	WindowHidden(flag bool)
	MutePress()
	SettingsPress()
	DeviceSelect(index int)
	RefreshPress()
	AboutPress()
	EqualizerSelect(name string)
	ControlsPress()
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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