HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
win32_wave_device.hpp
1// Copyright Take Vos 2022.
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_direction.hpp"
8#include "win32_device_interface.hpp"
9#include "../generator.hpp"
10#include <string>
11
12namespace hi::inline v1 {
13
15public:
16 win32_wave_device(UINT id, audio_direction direction) : _id(id), _direction(direction)
17 {
18 hi_assert(_direction == audio_direction::input or _direction == audio_direction::output);
19 }
20
23 [[nodiscard]] std::string end_point_id() const;
24
30
31 [[nodiscard]] static UINT num_devices(audio_direction direction) noexcept;
32
33 [[nodiscard]] static generator<win32_wave_device> enumerate(audio_direction direction) noexcept;
34
35 [[nodiscard]] static win32_wave_device find_matching_end_point(audio_direction direction, std::string end_point_id);
36
37private:
38 UINT _id;
39 audio_direction _direction;
40
41 [[nodiscard]] std::wstring message_wstring(UINT message_id, UINT size_message_id) const;
42 [[nodiscard]] std::string message_string(UINT message_id, UINT size_message_id) const;
43};
44
45} // namespace hi::inline v1
#define hi_assert(expression,...)
Assert if expression is true.
Definition assert.hpp:199
DOXYGEN BUG.
Definition algorithm.hpp:13
Definition win32_device_interface.hpp:16
Definition win32_wave_device.hpp:14
std::string end_point_id() const
The end-point-id matching end-point ids of the modern Core Audio MMDevice API.
win32_device_interface open_device_interface() const
Open the audio device.
A return value for a generator-function.
Definition generator.hpp:29