/* * Copyright 2023 jacqueline * * SPDX-License-Identifier: GPL-3.0-only */ #include "audio/audio_source.hpp" #include "codec.hpp" #include "types.hpp" namespace audio { TaggedStream::TaggedStream(std::shared_ptr t, std::unique_ptr w, std::string filepath, uint32_t offset) : codecs::IStream(w->type()), tags_(t), wrapped_(std::move(w)), filepath_(filepath), offset_(offset) {} auto TaggedStream::tags() -> std::shared_ptr { return tags_; } auto TaggedStream::Read(std::span dest) -> ssize_t { return wrapped_->Read(dest); } auto TaggedStream::CanSeek() -> bool { return wrapped_->CanSeek(); } auto TaggedStream::SeekTo(int64_t destination, SeekFrom from) -> void { wrapped_->SeekTo(destination, from); } auto TaggedStream::CurrentPosition() -> int64_t { return wrapped_->CurrentPosition(); } auto TaggedStream::Size() -> std::optional { return wrapped_->Size(); } auto TaggedStream::Offset() -> uint32_t { return offset_; } auto TaggedStream::Filepath() -> std::string { return filepath_; } auto TaggedStream::SetPreambleFinished() -> void { wrapped_->SetPreambleFinished(); } } // namespace audio