context

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2025 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppContext

type AppContext struct {
	AudioStream        io.ReadCloser
	ChannelList        []components.ChannelItem
	CurrentChannel     *components.ChannelItem
	DifmToken          string
	FavoriteList       []components.FavoriteItem
	Network            *components.Network
	HighlightedChannel *components.ChannelItem
	IsPlaying          bool
	Player             *pulse.PlaybackStream
	ShowStatus         bool // The status pane will be visible when true
	StatusChannel      chan components.StatusMessage
	View               *views.ViewContext
}

AppContext is a shared context to be shared across the application AudioStream - The raw audio stream from which audio is streamed by the player CurrentChannel - The ChannelItem representing the currently playing on the network DfmToken - The token used to authenticate to the network IsPlaying - Is there audio playing? Netowrk - the network to connect to View - The view context Status - Gets and sets current application status messages

func CreateAppContext

func CreateAppContext(view *views.ViewContext) *AppContext

CreateAppContext creates the application context

func (*AppContext) SetStatusMessage

func (c *AppContext) SetStatusMessage(msg string)

SetStatusMessage sets the application's status message for five seconds.

func (*AppContext) SetStatusMessageTimed

func (c *AppContext) SetStatusMessageTimed(msg string, d time.Duration)

SetStatusMessageTimed sets the application's status message for a fixed period of time.

Jump to

Keyboard shortcuts

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