screens

package
v0.0.0-...-d3571fa Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTextIcon

func NewTextIcon(input string) image.Image

NewTextIcon creates a new image from the supplied string which can be rendered onto a button in a legible fashion.

func NewTextIconWithBackground

func NewTextIconWithBackground(input string, bg image.Image) image.Image

NewTextIconWithBackground creates a new image which overlays the supplied text string over the supplied image.

Types

type BluetoothSetting

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

BluetoothSetting displays discoveredBluetooth devices and allows connecting to them.

func NewBluetoothSetting

func NewBluetoothSetting(homeScreen *Home, bsc BluetoothSettingController) *BluetoothSetting

MediaPlayerSetting creates a new instance of the media player setting screen, configured with the provided setting controller.

func (*BluetoothSetting) Icon

func (bs *BluetoothSetting) Icon() image.Image

Icon returns the icon to display for this screen

func (*BluetoothSetting) KeyPressed

KeyPressed handles the logic of what to do when a given key is pressed.

func (*BluetoothSetting) Name

func (bs *BluetoothSetting) Name() string

Name is hardcoded to display as "bluetooth setting"

func (*BluetoothSetting) Show

func (bs *BluetoothSetting) Show() []image.Image

Show returns the image set which will be shown to the user.

type BluetoothSettingController

type BluetoothSettingController interface {
	GetDevices() []controllers.BluetoothDevice
	RefreshDevices(context.Context) error
	ConnectDevice(controllers.BluetoothDevice) error
}

BluetoothSettingController describes the functions which this screen will use to interact with the Bluetooth setting system.

type Home

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

Home is the first screen shown to the user, listing all othe other possible screens

func NewHome

func NewHome(hc HomeController) *Home

NewHome creates a home screen which allows navigation to the supplied screens.

func (*Home) Icon

func (hs *Home) Icon() image.Image

Icon returns the icon to display for this screen

func (*Home) KeyPressed

func (hs *Home) KeyPressed(ctx context.Context, id int, t deskpad.KeyPressType) (deskpad.KeyPressAction, error)

KeyPressed handles the logic of what to do when a given key is pressed.

func (*Home) Name

func (hs *Home) Name() string

Name is hardcoded to display as "home"

func (*Home) RegisterScreen

func (hs *Home) RegisterScreen(s deskpad.Screen)

RegisterScreen adds a screen to the Home view in the next available spot

func (*Home) Show

func (hs *Home) Show() []image.Image

Show returns the image set which will be shown to the user.

type HomeController

type HomeController interface {
	DisplayClock()
	DisplayTemperature()
	CurrentDisplay() controllers.HomeDisplay
}

HomeController is an interface which defines what the home screen might control.

type MediaPlayer

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

MediaPlayer displays a control interface to the user which allows control of their media.

func NewMediaPlayer

func NewMediaPlayer(homeScreen *Home, mpc MediaPlayerController) *MediaPlayer

NewMediaPlayer creates a new screen for handling music playback, configured with the provided media player controller.

func (*MediaPlayer) Icon

func (mps *MediaPlayer) Icon() image.Image

Icon returns the icon to display for this screen

func (*MediaPlayer) KeyPressed

KeyPressed handles the logic of what to do when a given key is pressed.

func (*MediaPlayer) Name

func (mps *MediaPlayer) Name() string

Name is hardcoded to display as "media player"

func (*MediaPlayer) SetPlaylistScreen

func (mps *MediaPlayer) SetPlaylistScreen(screen deskpad.Screen)

SetPlaylistScreen configures the screen navigated to when the 'Playlist' button is pressed

func (*MediaPlayer) SetSettingsScreen

func (mps *MediaPlayer) SetSettingsScreen(screen deskpad.Screen)

SetSettingsScreen configures the screen navigated to when the 'Settings' button is pressed

func (*MediaPlayer) Show

func (mps *MediaPlayer) Show() []image.Image

Show returns the image set which will be shown to the user.

type MediaPlayerController

type MediaPlayerController interface {
	Play()
	Pause()
	Next()
	Previous()
	FastForward()
	Rewind()
	VolumeUp()
	VolumeDown()
	Mute()
	Unmute()
	Shuffle(shuffle bool)

	IsPlaying() bool
	IsShuffle() bool
	IsMuted() bool
}

MediaPlayerController describes the functions which the screen will use to allow the user to interface with the media source.

type MediaPlayerSetting

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

MediaPlayerSetting displays configurable settings about the player to the user.

func NewMediaPlayerSetting

func NewMediaPlayerSetting(homeScreen *Home, mpsc MediaPlayerSettingController) *MediaPlayerSetting

MediaPlayerSetting creates a new instance of the media player setting screen, configured with the provided setting controller.

func (*MediaPlayerSetting) Icon

func (mpss *MediaPlayerSetting) Icon() image.Image

Icon returns the icon to display for this screen

func (*MediaPlayerSetting) KeyPressed

KeyPressed handles the logic of what to do when a given key is pressed.

func (*MediaPlayerSetting) Name

func (mpss *MediaPlayerSetting) Name() string

Name is hardcoded to display as "media player setting"

func (*MediaPlayerSetting) SetPlayerScreen

func (mpss *MediaPlayerSetting) SetPlayerScreen(screen deskpad.Screen)

SetPlayerScreen configures the screen navigated to when the 'Player' button is pressed

func (*MediaPlayerSetting) Show

func (mpss *MediaPlayerSetting) Show() []image.Image

Show returns the image set which will be shown to the user.

type MediaPlayerSettingController

type MediaPlayerSettingController interface {
	GetAudioOutputs() []ui.AudioOutput
	RefreshAudioOutputs(context.Context) error
	SelectAudioOutput(ctx context.Context, deviceID string)
}

MediaPlayerSettingController describes the functions which this screen will use to interact with the player setting source.

type MediaPlaylist

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

MediaPlaylist displays a number of different media playlists to the user.

func NewMediaPlaylist

func NewMediaPlaylist(homeScreen *Home, mpc MediaPlaylistController) *MediaPlaylist

NewMediaPlaylist creates a new instance of the playlist screen, configured with the provided playlist controller.

func (*MediaPlaylist) Icon

func (mps *MediaPlaylist) Icon() image.Image

Icon returns the icon to display for this screen

func (*MediaPlaylist) KeyPressed

KeyPressed handles the logic of what to do when a given key is pressed.

func (*MediaPlaylist) Name

func (mps *MediaPlaylist) Name() string

Name is hardcoded to display as "media playlist"

func (*MediaPlaylist) SetPlayerScreen

func (mps *MediaPlaylist) SetPlayerScreen(screen deskpad.Screen)

SetPlayerScreen configures the screen navigated to when the 'Player' button is pressed

func (*MediaPlaylist) Show

func (mps *MediaPlaylist) Show() []image.Image

Show returns the image set which will be shown to the user.

type MediaPlaylistController

type MediaPlaylistController interface {
	GetPlaylists(count int, offset int) []ui.MediaPlaylist
	StartPlaylist(ctx context.Context, id string)
}

MediaPlaylistController describes the functions which this screen will use to interact with the playlist data source.

type Scoreboard

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

Scoreboard displays the buttons for a 2 person scorekeeping system via a Timebox unit

func NewScoreboard

func NewScoreboard(homeScreen *Home, sc ScoreboardController) *Scoreboard

NewScoreboard creates a new instance of the Scoreboard. Game starts at 0

func (*Scoreboard) Icon

func (sbs *Scoreboard) Icon() image.Image

Icon returns the icon to display for this screen

func (*Scoreboard) KeyPressed

func (sbs *Scoreboard) KeyPressed(ctx context.Context, id int, t deskpad.KeyPressType) (deskpad.KeyPressAction, error)

KeyPressed handles the logic of what to do when a given key is pressed.

func (*Scoreboard) Name

func (sbs *Scoreboard) Name() string

Name is hardcoded to display as "scoreboard"

func (*Scoreboard) Show

func (sbs *Scoreboard) Show() []image.Image

Show returns the image set which will be shown to the user.

type ScoreboardController

type ScoreboardController interface {
	Display()

	IncrementRedScore()
	DecrementRedScore()
	ResetRedScore()

	IncrementBlueScore()
	DecrementBlueScore()
	ResetBlueScore()
}

Jump to

Keyboard shortcuts

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