HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
audio_device_state.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 "../utility/utility.hpp"
8#include "../macros.hpp"
9#include <format>
10#include <string_view>
11
12hi_export_module(hikogui.audio.audio_device_state);
13
14namespace hi { inline namespace v1 {
15
16hi_export enum class audio_device_state { uninitialized, active, disabled, not_present, unplugged };
17
18// clang-format off
19hi_export constexpr auto audio_device_state_metadata = enum_metadata{
20 audio_device_state::uninitialized, "uninitialized",
21 audio_device_state::active, "active",
22 audio_device_state::disabled, "disabled",
23 audio_device_state::not_present, "not_present",
24 audio_device_state::unplugged, "unplugged",
25};
26// clang-format on
27
28hi_export [[nodiscard]] constexpr std::string_view to_string(audio_device_state const& rhs) noexcept
29{
30 return audio_device_state_metadata[rhs];
31}
32
33}} // namespace hi::inline v1
34
35template<typename CharT>
36struct std::formatter<hi::audio_device_state, CharT> : std::formatter<std::string_view, CharT> {
37 auto format(hi::audio_device_state const& t, auto& fc) const
38 {
39 return std::formatter<std::string_view, CharT>::format(hi::audio_device_state_metadata[t], fc);
40 }
41};
DOXYGEN BUG.
Definition algorithm.hpp:16
geometry/margins.hpp
Definition lookahead_iterator.hpp:5
constexpr Out narrow_cast(In const &rhs) noexcept
Cast numeric values without loss of precision.
Definition cast.hpp:377
T to_string(T... args)