diff options
| author | jacqueline <me@jacqueline.id.au> | 2024-05-02 19:12:26 +1000 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2024-05-02 19:12:26 +1000 |
| commit | 1573a8c4cde1cd9528b422b2dcc598e37ffe94a7 (patch) | |
| tree | d162822b8fd7054f81bace0c7a65ab4d5e6f93ef /src/audio/include/audio_source.hpp | |
| parent | a231fd1c8afedbeb14b0bc77d76bad61db986059 (diff) | |
| download | tangara-fw-1573a8c4cde1cd9528b422b2dcc598e37ffe94a7.tar.gz | |
WIP merge cyclically dependent components into one big component
Diffstat (limited to 'src/audio/include/audio_source.hpp')
| -rw-r--r-- | src/audio/include/audio_source.hpp | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/src/audio/include/audio_source.hpp b/src/audio/include/audio_source.hpp deleted file mode 100644 index f6a34300..00000000 --- a/src/audio/include/audio_source.hpp +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2023 jacqueline <me@jacqueline.id.au> - * - * SPDX-License-Identifier: GPL-3.0-only - */ - -#pragma once - -#include <memory> -#include "codec.hpp" -#include "track.hpp" -#include "types.hpp" - -namespace audio { - -class TaggedStream : public codecs::IStream { - public: - TaggedStream(std::shared_ptr<database::TrackTags>, - std::unique_ptr<codecs::IStream> wrapped, - std::string path, - uint32_t offset = 0 - ); - - auto tags() -> std::shared_ptr<database::TrackTags>; - - auto Read(std::span<std::byte> dest) -> ssize_t override; - - auto CanSeek() -> bool override; - - auto SeekTo(int64_t destination, SeekFrom from) -> void override; - - auto CurrentPosition() -> int64_t override; - - auto Size() -> std::optional<int64_t> override; - - auto Offset() -> uint32_t; - - auto Filepath() -> std::string; - - auto SetPreambleFinished() -> void override; - - private: - std::shared_ptr<database::TrackTags> tags_; - std::unique_ptr<codecs::IStream> wrapped_; - std::string filepath_; - int32_t offset_; -}; - -class IAudioSource { - public: - virtual ~IAudioSource() {} - - virtual auto HasNewStream() -> bool = 0; - virtual auto NextStream() -> std::shared_ptr<TaggedStream> = 0; -}; - -} // namespace audio |
