Documentation ¶
Index ¶
- func NewTextIcon(input string) image.Image
- func NewTextIconWithBackground(input string, bg image.Image) image.Image
- type BluetoothSetting
- type BluetoothSettingController
- type Home
- type HomeController
- type MediaPlayer
- func (mps *MediaPlayer) Icon() image.Image
- func (mps *MediaPlayer) KeyPressed(ctx context.Context, id int, t deskpad.KeyPressType) (deskpad.KeyPressAction, error)
- func (mps *MediaPlayer) Name() string
- func (mps *MediaPlayer) SetPlaylistScreen(screen deskpad.Screen)
- func (mps *MediaPlayer) SetSettingsScreen(screen deskpad.Screen)
- func (mps *MediaPlayer) Show() []image.Image
- type MediaPlayerController
- type MediaPlayerSetting
- func (mpss *MediaPlayerSetting) Icon() image.Image
- func (mpss *MediaPlayerSetting) KeyPressed(ctx context.Context, id int, t deskpad.KeyPressType) (deskpad.KeyPressAction, error)
- func (mpss *MediaPlayerSetting) Name() string
- func (mpss *MediaPlayerSetting) SetPlayerScreen(screen deskpad.Screen)
- func (mpss *MediaPlayerSetting) Show() []image.Image
- type MediaPlayerSettingController
- type MediaPlaylist
- func (mps *MediaPlaylist) Icon() image.Image
- func (mps *MediaPlaylist) KeyPressed(ctx context.Context, id int, t deskpad.KeyPressType) (deskpad.KeyPressAction, error)
- func (mps *MediaPlaylist) Name() string
- func (mps *MediaPlaylist) SetPlayerScreen(screen deskpad.Screen)
- func (mps *MediaPlaylist) Show() []image.Image
- type MediaPlaylistController
- type Scoreboard
- type ScoreboardController
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTextIcon ¶
NewTextIcon creates a new image from the supplied string which can be rendered onto a button in a legible fashion.
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 ¶
func (bs *BluetoothSetting) 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 (*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) 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) RegisterScreen ¶
RegisterScreen adds a screen to the Home view in the next available spot
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 ¶
func (mps *MediaPlayer) 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 (*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 ¶
func (mpss *MediaPlayerSetting) 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 (*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 ¶
func (mps *MediaPlaylist) 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 (*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() }