diff options
| author | malcircuit <sir.oslay@gmail.com> | 2024-12-16 10:43:47 -0600 |
|---|---|---|
| committer | malcircuit <sir.oslay@gmail.com> | 2024-12-16 10:43:47 -0600 |
| commit | 287c4bfb26a3fc6a94d7fd10c8d2b1a90ebe8db5 (patch) | |
| tree | ac8d2e47a7887c39b4af52ee823ba94cb4c29621 /src/tangara/audio | |
| parent | ad47a427af8ebaf56f5dc91646708fd4126f98ed (diff) | |
| download | tangara-fw-287c4bfb26a3fc6a94d7fd10c8d2b1a90ebe8db5.tar.gz | |
Make now-playing queue circular
Diffstat (limited to 'src/tangara/audio')
| -rw-r--r-- | src/tangara/audio/track_queue.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/tangara/audio/track_queue.cpp b/src/tangara/audio/track_queue.cpp index 05ac0b95..0af8bee0 100644 --- a/src/tangara/audio/track_queue.cpp +++ b/src/tangara/audio/track_queue.cpp @@ -304,7 +304,10 @@ auto TrackQueue::next(Reason r) -> void { position_ = shuffle_->current(); } else { if (position_ + 1 < totalSize()) { - position_++; + position_++; // Next track + } + else { + position_ = 0; // Go to beginning } } @@ -327,6 +330,9 @@ auto TrackQueue::previous() -> void { if (position_ > 0) { position_--; } + else { + position_ = totalSize(); + } } goTo(position_); } |
