diff options
| author | jacqueline <me@jacqueline.id.au> | 2023-04-01 13:22:21 +1100 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2023-04-19 10:29:38 +1000 |
| commit | 7c6fd654f50e6665efa4226c6b927f9762734182 (patch) | |
| tree | 58ccb69068c550e9c2223c1b510cfa525690b731 /src/audio/pipeline.cpp | |
| parent | 3817ec0c77b8d44e54b35ea9f76e7bb4666c6c08 (diff) | |
| download | tangara-fw-7c6fd654f50e6665efa4226c6b927f9762734182.tar.gz | |
New pipeline building, still needs proper control
Diffstat (limited to 'src/audio/pipeline.cpp')
| -rw-r--r-- | src/audio/pipeline.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/audio/pipeline.cpp b/src/audio/pipeline.cpp index f42e6853..8af8f215 100644 --- a/src/audio/pipeline.cpp +++ b/src/audio/pipeline.cpp @@ -1,4 +1,5 @@ #include "pipeline.hpp" +#include <memory> #include "stream_info.hpp" namespace audio { @@ -7,7 +8,7 @@ Pipeline::Pipeline(IAudioElement* output) : root_(output), subtrees_() {} Pipeline::~Pipeline() {} auto Pipeline::AddInput(IAudioElement* input) -> Pipeline* { - subtrees_.emplace_back(input); + subtrees_.push_back(std::make_unique<Pipeline>(input)); return subtrees_.back().get(); } @@ -21,15 +22,15 @@ auto Pipeline::NumInputs() const -> std::size_t { auto Pipeline::InStreams( std::vector<MappableRegion<kPipelineBufferSize>>* regions, - std::vector<MutableStream>* out) -> void { + std::vector<RawStream>* out) -> void { for (int i = 0; i < subtrees_.size(); i++) { - MutableStream s = subtrees_[i]->OutStream(®ions->at(i)); + RawStream s = subtrees_[i]->OutStream(®ions->at(i)); out->push_back(s); } } auto Pipeline::OutStream(MappableRegion<kPipelineBufferSize>* region) - -> MutableStream { + -> RawStream { return {&output_info_, region->Map(output_buffer_)}; } @@ -42,8 +43,9 @@ auto Pipeline::GetIterationOrder() -> std::vector<Pipeline*> { to_search.pop_back(); found.push_back(current); - to_search.insert(to_search.end(), current->subtrees_.begin(), - current->subtrees_.end()); + for (const auto& i : current->subtrees_) { + to_search.push_back(i.get()); + } } return found; |
