From 39f7545cd5ef7a30bbd482f3579df7744c6b688d Mon Sep 17 00:00:00 2001 From: jacqueline Date: Fri, 7 Jul 2023 15:29:47 +1000 Subject: wire up the playing screen with some real data Includes implementing song duration calculation for CBR MP3 files --- src/audio/include/stream_info.hpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/audio/include/stream_info.hpp') diff --git a/src/audio/include/stream_info.hpp b/src/audio/include/stream_info.hpp index 4db3e5fd..69bf3c4b 100644 --- a/src/audio/include/stream_info.hpp +++ b/src/audio/include/stream_info.hpp @@ -30,13 +30,16 @@ struct StreamInfo { bool is_consumer_finished = true; - // - std::optional seek_to_seconds{}; + std::optional duration_seconds; + + std::optional seek_to_seconds{}; struct Encoded { // The codec that this stream is associated with. codecs::StreamType type; + std::optional duration_bytes; + bool operator==(const Encoded&) const = default; }; @@ -95,6 +98,8 @@ class OutputStream { bool prepare(const StreamInfo::Format& new_format); + void set_duration(std::size_t); + const StreamInfo& info() const; cpp::span data() const; -- cgit v1.2.3