You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
1.3 KiB
56 lines
1.3 KiB
1 year ago
|
/*
|
||
|
* Copyright 2023 jacqueline <me@jacqueline.id.au>
|
||
|
*
|
||
|
* SPDX-License-Identifier: GPL-3.0-only
|
||
|
*/
|
||
|
|
||
|
#include "audio_source.hpp"
|
||
|
#include "codec.hpp"
|
||
|
#include "types.hpp"
|
||
|
|
||
|
namespace audio {
|
||
|
|
||
|
TaggedStream::TaggedStream(std::shared_ptr<database::TrackTags> t,
|
||
1 year ago
|
std::unique_ptr<codecs::IStream> w,
|
||
1 year ago
|
std::string filepath,
|
||
1 year ago
|
uint32_t offset)
|
||
1 year ago
|
: codecs::IStream(w->type()), tags_(t), wrapped_(std::move(w)), filepath_(filepath), offset_(offset) {}
|
||
1 year ago
|
|
||
|
auto TaggedStream::tags() -> std::shared_ptr<database::TrackTags> {
|
||
|
return tags_;
|
||
|
}
|
||
|
|
||
1 year ago
|
auto TaggedStream::Read(std::span<std::byte> dest) -> ssize_t {
|
||
1 year ago
|
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();
|
||
|
}
|
||
|
|
||
1 year ago
|
auto TaggedStream::Size() -> std::optional<int64_t> {
|
||
|
return wrapped_->Size();
|
||
|
}
|
||
|
|
||
1 year ago
|
auto TaggedStream::Offset() -> uint32_t {
|
||
|
return offset_;
|
||
|
}
|
||
|
|
||
1 year ago
|
auto TaggedStream::Filepath() -> std::string {
|
||
|
return filepath_;
|
||
|
}
|
||
|
|
||
1 year ago
|
auto TaggedStream::SetPreambleFinished() -> void {
|
||
|
wrapped_->SetPreambleFinished();
|
||
|
}
|
||
|
|
||
|
} // namespace audio
|