Add Loop functionality to player controls

Adding the Loop functionality, along with the Player changes to support
it, and a button to the player controls.

`Player` now has a `loopMode` attribute, which determines whether it
should loop. At the moment, only the following modes are supported:

* `LoopNone`: Disables loop.
* `LoopAll`: Enables loop for the entire playlist queue.

This has been designed as an enum, to support other modes in the future
(e.g. loop for the current track only).

It depends on the `loop` functionality provided by MPV (using the
[`loop-playlist` option](https://mpv.io/manual/master/#options-loop-playlist)),
so no custom logic is needed to reset the currently playing index.
This commit is contained in:
Michael Manganiello
2023-06-18 22:43:03 -03:00
parent 1f272829c7
commit 2ab19f65e1
4 changed files with 102 additions and 10 deletions
+4 -4
View File
@@ -1,7 +1,7 @@
<img src="res/appicon-128.png" alt="Supersonic logo" title="Supersonic" align="left" height="60px"/>
<a href='https://flathub.org/apps/details/io.github.dweymouth.supersonic'><img height="50px" align="right" alt='Download on Flathub' src='https://flathub.org/assets/badges/flathub-badge-en.png'/></a></div>
<a href='https://ko-fi.com/dweymouth' target='_blank'><img height='40' align='right' src='https://az743702.vo.msecnd.net/cdn/kofi3.png?v=0' border='0' alt='Buy Me a Coffee at ko-fi.com'/>
<a href='https://ko-fi.com/dweymouth' target='_blank'><img height='40' align='right' src='https://az743702.vo.msecnd.net/cdn/kofi3.png?v=0' border='0' alt='Buy Me a Coffee at ko-fi.com'/>
# Supersonic
[![License](https://img.shields.io/github/license/dweymouth/supersonic)](https://github.com/dweymouth/supersonic/blob/main/LICENSE)
@@ -40,7 +40,7 @@ Screenshots of Supersonic running against the Navidrome [demo server](https://ww
* [x] Set/unset favorite and browse by favorite albums, artists, and songs
* [x] Set and view track rating (0-5 stars)
* [x] View and edit play queue (add and remove tracks; reorder support coming soon)
* [x] Shuffle and repeat playback modes (partial; shuffle album, playlist, artist radio, random songs)
* [x] Shuffle and repeat playback modes (partial; shuffle album, playlist, artist radio, random songs; repeat all)
* [ ] Browse by folders (planned)
* [ ] Download songs, albums or playlists (planned)
* [ ] Cast to uPnP/DLNA devices (likely planned)
@@ -86,7 +86,7 @@ Supersonic is available in the AUR and can be built either manually with `makepk
### Build with an AUR helper
* Invoke your favorite AUR helper to automatically build the package
- ``yay -S supersonic-desktop``
- ``yay -S supersonic-desktop``
## Build instructions (Mac OS)