7#include "audio_device.hpp"
8#include "../utility/utility.hpp"
9#include "../macros.hpp"
15hi_export_module(hikogui.audio.audio_system);
17hi_export
namespace hi {
inline namespace v1 {
51 return _notifier.subscribe(std::forward<Func>(
func), flags);
54 auto operator co_await()
const noexcept
56 return _notifier.operator
co_await();
60 notifier<
void()> _notifier;
67template<
typename Context>
68concept audio_device_filter = std::convertible_to<Context, audio_device_state>
or std::convertible_to<Context, audio_direction>;
70[[
nodiscard]]
constexpr bool match_audio_device(audio_device
const &device)
noexcept
78 if constexpr (std::convertible_to<FirstFilter, audio_device_state>) {
82 }
else if constexpr (std::convertible_to<FirstFilter, audio_direction>) {
87 hi_static_no_default();
90 return match_audio_device(device, std::forward<Filters>(
filters)...);
100template<audio_device_filter...
Filters>
104 if (match_audio_device(device, std::forward<Filters>(
filters)...)) {
DOXYGEN BUG.
Definition algorithm_misc.hpp:20
The HikoGUI namespace.
Definition recursive_iterator.hpp:15
generator< audio_device & > audio_devices(Filters &&...filters) noexcept
Get audio devices matching the filter arguments.
Definition audio_system.hpp:101
constexpr Out narrow_cast(In const &rhs) noexcept
Cast numeric values without loss of precision.
Definition cast.hpp:378
A set of audio channels which can be rendered and/or captures at the same time.
Definition audio_device.hpp:34
Definition audio_system.hpp:22
static audio_system & global() noexcept
Create an audio system object specific for the current operating system.
Definition audio_system_win32.hpp:230
callback< void()> subscribe(Func &&func, callback_flags flags=callback_flags::synchronous) noexcept
Subscribe a function to be called when the device list changes.
Definition audio_system.hpp:49
virtual generator< audio_device & > devices() noexcept=0
The devices that are part of the audio system.
Definition callback.hpp:77
Definition audio_system.hpp:68
True if T is a forwarded type of Forward.
Definition concepts.hpp:136