summaryrefslogtreecommitdiff
path: root/src/tangara
diff options
context:
space:
mode:
authormalcircuit <sir.oslay@gmail.com>2024-12-16 10:43:47 -0600
committermalcircuit <sir.oslay@gmail.com>2024-12-16 10:43:47 -0600
commit287c4bfb26a3fc6a94d7fd10c8d2b1a90ebe8db5 (patch)
treeac8d2e47a7887c39b4af52ee823ba94cb4c29621 /src/tangara
parentad47a427af8ebaf56f5dc91646708fd4126f98ed (diff)
downloadtangara-fw-287c4bfb26a3fc6a94d7fd10c8d2b1a90ebe8db5.tar.gz
Make now-playing queue circular
Diffstat (limited to 'src/tangara')
-rw-r--r--src/tangara/audio/track_queue.cpp8
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_);
}