From 7c6fd654f50e6665efa4226c6b927f9762734182 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Sat, 1 Apr 2023 13:22:21 +1100 Subject: New pipeline building, still needs proper control --- src/audio/pipeline.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/audio/pipeline.cpp') 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 #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(input)); return subtrees_.back().get(); } @@ -21,15 +22,15 @@ auto Pipeline::NumInputs() const -> std::size_t { auto Pipeline::InStreams( std::vector>* regions, - std::vector* out) -> void { + std::vector* 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* region) - -> MutableStream { + -> RawStream { return {&output_info_, region->Map(output_buffer_)}; } @@ -42,8 +43,9 @@ auto Pipeline::GetIterationOrder() -> std::vector { 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; -- cgit v1.2.3