Make now-playing queue circular

custom
malcircuit 4 months ago
parent ad47a427af
commit 287c4bfb26
  1. 8
      src/tangara/audio/track_queue.cpp

@ -304,7 +304,10 @@ auto TrackQueue::next(Reason r) -> void {
position_ = shuffle_->current(); position_ = shuffle_->current();
} else { } else {
if (position_ + 1 < totalSize()) { 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) { if (position_ > 0) {
position_--; position_--;
} }
else {
position_ = totalSize();
}
} }
goTo(position_); goTo(position_);
} }

Loading…
Cancel
Save