HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
audio_system_aggregate.hpp
1// Copyright Take Vos 2020.
2// Distributed under the Boost Software License, Version 1.0.
3// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
4
5#include "audio_system.hpp"
6#include "../algorithm.hpp"
7#include <algorithm>
8
9namespace tt {
10
12public:
13 using super = audio_system;
14
16
17 [[nodiscard]] std::vector<audio_device *> devices() noexcept override
18 {
20 for (auto &child : _children) {
21 auto tmp = child->devices();
22 std::move(tmp.begin(), tmp.end(), std::back_inserter(r));
23 }
24 return r;
25 }
26
27 template<typename T, typename... Args>
28 audio_system &make_audio_system(Args &&...args)
29 {
30 auto new_audio_system = std::make_unique<T>(_event_queue, _aggregate_delegate, std::forward<Args>(args)...);
31 auto new_audio_system_ptr = new_audio_system.get();
32
33 new_audio_system->init();
34 _children.push_back(std::move(new_audio_system));
35
36 if (auto delegate = _delegate.lock()) {
37 delegate->audio_device_list_changed(*this);
38 }
39 return *new_audio_system_ptr;
40 }
41
42private:
44
48
49 friend class audio_system_aggregate_delegate;
50};
51
52} // namespace tt
Definition audio_system.hpp:20
Definition audio_system_aggregate.hpp:11
std::vector< audio_device * > devices() noexcept override
The devices that are part of the audio system.
Definition audio_system_aggregate.hpp:17
Definition event_queue.hpp:40
T back_inserter(T... args)
T move(T... args)