Add functionality to repeat current track

This new Loop mode keeps reproducing the current track, unless it is
changed using the player controls to go to the next/previous track.

As in other applications, this is set by using the "Repeat" button,
which now goes from "Off" -> "Repeat All" -> "Repeat One".
This commit is contained in:
Michael Manganiello
2023-06-20 23:23:38 -03:00
parent 5f83c2cd95
commit 196f7f2cff
2 changed files with 24 additions and 1 deletions
+5
View File
@@ -68,8 +68,13 @@ func (a *AuxControls) OnChangeLoopMode(f func()) {
func (a *AuxControls) SetLoopMode(mode string) {
if mode == "all" {
a.loop.Importance = widget.HighImportance
a.loop.Icon = theme.MediaReplayIcon()
} else if mode == "one" {
a.loop.Importance = widget.HighImportance
a.loop.Icon = theme.MediaReplayIcon() // TODO: This icon must be changed to the "Repeat" one with a 1.
} else {
a.loop.Importance = widget.MediumImportance
a.loop.Icon = theme.MediaReplayIcon()
}
a.loop.Refresh()
}