summaryrefslogtreecommitdiff
path: root/src/tangara/ui/ui_fsm.cpp
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2024-08-28 13:01:31 +1000
committercooljqln <cooljqln@noreply.codeberg.org>2024-08-28 04:07:21 +0000
commit9145722b08b9c648e41d6b36f83bebbd106efc1e (patch)
treea5a806fa5c4bf8b3f33992760b728bef594bf544 /src/tangara/ui/ui_fsm.cpp
parent71aafc171192e2af987e273395d1d8783a3f7475 (diff)
downloadtangara-fw-9145722b08b9c648e41d6b36f83bebbd106efc1e.tar.gz
Don't show n+1/n when we run out of queue
Diffstat (limited to 'src/tangara/ui/ui_fsm.cpp')
-rw-r--r--src/tangara/ui/ui_fsm.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/tangara/ui/ui_fsm.cpp b/src/tangara/ui/ui_fsm.cpp
index 7da07215..a20eb0ef 100644
--- a/src/tangara/ui/ui_fsm.cpp
+++ b/src/tangara/ui/ui_fsm.cpp
@@ -436,6 +436,9 @@ void UiState::react(const audio::QueueUpdate& update) {
if (queue_size > 0) {
current_pos++;
}
+ if (current_pos > queue_size) {
+ current_pos = queue_size;
+ }
sQueuePosition.setDirect(current_pos);
sQueueRandom.setDirect(queue.random());
sQueueRepeat.setDirect(queue.repeat());