diff options
| author | ailurux <ailuruxx@gmail.com> | 2025-01-07 00:00:00 +0000 |
|---|---|---|
| committer | cooljqln <cooljqln@noreply.codeberg.org> | 2025-01-07 00:00:00 +0000 |
| commit | 829d033a448107f1bc610cf735ce9f7222de564b (patch) | |
| tree | 25efd26b3cd5d3a3f8e1c9486e2c2da0dce74d0f /src/tangara/audio/stream_cues.cpp | |
| parent | 4ad5f1b63761f042734d1cc1eab2649186092ee5 (diff) | |
| download | tangara-fw-829d033a448107f1bc610cf735ce9f7222de564b.tar.gz | |
Improvements to the queue for shuffling/playing all (#170)
Queue now has a separate 'ready' property to indicate it's ready to be used, which is independent from whether it's still loading tracks in. This also improves the response time for shuffling all tracks (we will initially pick a random track in the first 100 tracks whilst the rest of the tracks are loading). This should also fix issues where one song will start playing and then repeat itself when the queue finishes loading, and hopefully solve #160 as well (though I couldn't actually repro this myself).
Co-authored-by: jacqueline <me@jacqueline.id.au>
Reviewed-on: https://codeberg.org/cool-tech-zone/tangara-fw/pulls/170
Reviewed-by: cooljqln <cooljqln@noreply.codeberg.org>
Co-authored-by: ailurux <ailuruxx@gmail.com>
Co-committed-by: ailurux <ailuruxx@gmail.com>
Diffstat (limited to 'src/tangara/audio/stream_cues.cpp')
| -rw-r--r-- | src/tangara/audio/stream_cues.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/tangara/audio/stream_cues.cpp b/src/tangara/audio/stream_cues.cpp index 6a9a7674..611138c6 100644 --- a/src/tangara/audio/stream_cues.cpp +++ b/src/tangara/audio/stream_cues.cpp @@ -43,6 +43,11 @@ auto StreamCues::addCue(std::shared_ptr<TrackInfo> track, uint32_t sample) } } +auto StreamCues::clear() -> void { + upcoming_.clear(); + current_ = {}; +} + auto StreamCues::current() -> std::pair<std::shared_ptr<TrackInfo>, uint32_t> { if (!current_) { return {}; |
