HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
audio_system_win32.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#pragma once
6
7#include "audio_system.hpp"
8#include "audio_system_delegate.hpp"
9#include "audio_device_id.hpp"
10#include "../wfree_fifo.hpp"
11#include <memory>
12
13struct IMMDeviceEnumerator;
14
15namespace tt {
16
17class audio_system_win32_notification_client;
18
19class audio_system_win32;
20
22 virtual void handle_event(audio_system_win32 *self) noexcept = 0;
23};
24
26public:
27 using super = audio_system;
28
31
32 void init() noexcept override;
33
34 [[nodiscard]] std::vector<audio_device *> devices() noexcept override
35 {
37 r.reserve(std::size(_devices));
38 for (ttlet &device : _devices) {
39 r.push_back(device.get());
40 }
41 return r;
42 }
43
44 void update_device_list() noexcept;
45
46private:
56 std::vector<std::shared_ptr<audio_device>> _devices;
57
58 IMMDeviceEnumerator *_device_enumerator;
59 audio_system_win32_notification_client *_notification_client;
60
61 void default_device_changed(tt::audio_device_id const &device_id) noexcept;
62 void device_added(tt::audio_device_id const &device_id) noexcept;
63 void device_removed(tt::audio_device_id const &device_id) noexcept;
64 void device_state_changed(tt::audio_device_id const &device_id) noexcept;
65 void device_property_value_changed(tt::audio_device_id const &device_id) noexcept;
66
67 friend audio_system_win32_notification_client;
68};
69
70} // namespace tt
STL namespace.
A set of audio channels which can be rendered and/or captures at the same time.
Definition audio_device.hpp:52
Definition audio_device_id.hpp:14
Definition audio_system.hpp:20
Definition audio_system_win32.hpp:21
Definition audio_system_win32.hpp:25
std::vector< audio_device * > devices() noexcept override
The devices that are part of the audio system.
Definition audio_system_win32.hpp:34
Definition event_queue.hpp:40
T reserve(T... args)