diff options
| author | jacqueline <me@jacqueline.id.au> | 2023-07-07 15:29:47 +1000 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2023-07-07 15:29:47 +1000 |
| commit | 39f7545cd5ef7a30bbd482f3579df7744c6b688d (patch) | |
| tree | a760a50cc17365fbcd69eb89ca627ad7feb8c0b6 /src/audio/include/stream_info.hpp | |
| parent | 2f16d230025c3173cfbecc58b38d6a52b6b0f5f2 (diff) | |
| download | tangara-fw-39f7545cd5ef7a30bbd482f3579df7744c6b688d.tar.gz | |
wire up the playing screen with some real data
Includes implementing song duration calculation for CBR MP3 files
Diffstat (limited to 'src/audio/include/stream_info.hpp')
| -rw-r--r-- | src/audio/include/stream_info.hpp | 9 |
1 files changed, 7 insertions, 2 deletions
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<uint32_t> seek_to_seconds{}; + std::optional<std::uint32_t> duration_seconds; + + std::optional<std::uint32_t> seek_to_seconds{}; struct Encoded { // The codec that this stream is associated with. codecs::StreamType type; + std::optional<std::size_t> 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<std::byte> data() const; |
