diff --git a/backend/playbackmanager.go b/backend/playbackmanager.go index c2b4c14..d5d1463 100644 --- a/backend/playbackmanager.go +++ b/backend/playbackmanager.go @@ -18,6 +18,9 @@ const ( ReplayGainTrack = string(player.ReplayGainTrack) ) +// A high-level Subsonic-aware playback backend. +// Manages loading tracks into the Player queue, +// sending callbacks on play time updates and track changes. type PlaybackManager struct { ctx context.Context cancelPollPos context.CancelFunc diff --git a/backend/servermanager.go b/backend/servermanager.go index 216207b..38e372c 100644 --- a/backend/servermanager.go +++ b/backend/servermanager.go @@ -85,10 +85,12 @@ func (s *ServerManager) Logout() { } } +// Sets a callback that is invoked when a server is connected to. func (s *ServerManager) OnServerConnected(cb func()) { s.onServerConnected = append(s.onServerConnected, cb) } +// Sets a callback that is invoked when the user logs out of a server. func (s *ServerManager) OnLogout(cb func()) { s.onLogout = append(s.onLogout, cb) } diff --git a/backend/updatechecker.go b/backend/updatechecker.go index 21e8236..b3cceb1 100644 --- a/backend/updatechecker.go +++ b/backend/updatechecker.go @@ -9,6 +9,8 @@ import ( "time" ) +// A component to check for updates from the +// Github releases/latest URL. type UpdateChecker struct { OnUpdatedVersionFound func() @@ -26,6 +28,8 @@ func NewUpdateChecker(appVersionTag, latestReleaseURL string, lastCheckedTag *st } } +// Start automatically polling for updates in the background. +// Quits when the given ctx's Done channel returns a value. func (u *UpdateChecker) Start(ctx context.Context, interval time.Duration) { go func() { u.checkForUpdate() // check once at startup diff --git a/ui/widgets/auxcontrols.go b/ui/widgets/auxcontrols.go index 41ebc0a..10b738e 100644 --- a/ui/widgets/auxcontrols.go +++ b/ui/widgets/auxcontrols.go @@ -8,6 +8,8 @@ import ( "fyne.io/fyne/v2/widget" ) +// The "aux" controls for playback, positioned to the right +// of the BottomPanel. Currently only volume control. type AuxControls struct { widget.BaseWidget diff --git a/ui/widgets/imageplaceholder.go b/ui/widgets/imageplaceholder.go index 6fafe5b..693886f 100644 --- a/ui/widgets/imageplaceholder.go +++ b/ui/widgets/imageplaceholder.go @@ -11,6 +11,9 @@ import ( "fyne.io/fyne/v2/widget" ) +// A widget that can display an image or else +// a placeholder with a rectangular border frame +// and an icon positioned in the center of the frame. type ImagePlaceholder struct { widget.BaseWidget container *fyne.Container diff --git a/ui/widgets/listrowbase.go b/ui/widgets/listrowbase.go index 3c09f98..d220dba 100644 --- a/ui/widgets/listrowbase.go +++ b/ui/widgets/listrowbase.go @@ -14,6 +14,7 @@ var _ fyne.Tappable = (*ListRowBase)(nil) var _ fyne.Widget = (*ListRowBase)(nil) var _ fyne.Focusable = (*ListRowBase)(nil) +// Base type used for all list rows in widgets such as Tracklist, etc. type ListRowBase struct { widget.BaseWidget diff --git a/ui/widgets/nowplayingcard.go b/ui/widgets/nowplayingcard.go index 8c6fb43..d9a366a 100644 --- a/ui/widgets/nowplayingcard.go +++ b/ui/widgets/nowplayingcard.go @@ -10,6 +10,8 @@ import ( "fyne.io/fyne/v2/widget" ) +// Shows the current album art, track name, artist name, and album name +// for the currently playing track. Placed into the left side of the BottomPanel. type NowPlayingCard struct { widget.BaseWidget diff --git a/ui/widgets/textrestrictedentry.go b/ui/widgets/textrestrictedentry.go index 9f8c83a..c76989e 100644 --- a/ui/widgets/textrestrictedentry.go +++ b/ui/widgets/textrestrictedentry.go @@ -8,6 +8,8 @@ import ( "fyne.io/fyne/v2/widget" ) +// A widget.Entry that allows restrictions on the text +// that can be typed into it, based on a charAllowed callback. type TextRestrictedEntry struct { widget.Entry diff --git a/ui/widgets/togglebuttongroup.go b/ui/widgets/togglebuttongroup.go index bf81d0e..7550a57 100644 --- a/ui/widgets/togglebuttongroup.go +++ b/ui/widgets/togglebuttongroup.go @@ -8,6 +8,9 @@ import ( "fyne.io/fyne/v2/widget" ) +// Lays out multiple buttons horizontally with no padding, +// and uses button.Importance to highlight exactly one which is "active". +// Similar to a segmented control in other UI toolkits. type ToggleButtonGroup struct { widget.BaseWidget diff --git a/ui/widgets/toggletext.go b/ui/widgets/toggletext.go index 95d46e2..90eac48 100644 --- a/ui/widgets/toggletext.go +++ b/ui/widgets/toggletext.go @@ -6,6 +6,9 @@ import ( "fyne.io/fyne/v2/widget" ) +// Similar to widgets.ToggleButtonGroup, but using text. +// The "active" label is bolded non-interactive text, +// while all the others are hyperlinks. type ToggleText struct { widget.BaseWidget