7#include "../bigint.hpp"
8#include "audio_device_delegate.hpp"
9#include "audio_stream_config.hpp"
10#include "audio_channel.hpp"
11#include "audio_direction.hpp"
12#include "speaker_mapping.hpp"
13#include "audio_device_id.hpp"
14#include "../label.hpp"
21enum class audio_device_state { active, disabled, not_present, unplugged };
23[[nodiscard]]
constexpr char const *to_const_string(audio_device_state
const &rhs)
noexcept
26 case audio_device_state::active:
return "active";
27 case audio_device_state::disabled:
return "disabled";
28 case audio_device_state::not_present:
return "not_present";
29 case audio_device_state::unplugged:
return "unplugged";
30 default: tt_no_default();
36 return {to_const_string(rhs)};
41 return lhs << to_const_string(rhs);
75 [[nodiscard]] virtual audio_device_state
state() const noexcept = 0;
77 [[nodiscard]] virtual audio_direction direction() const noexcept = 0;
83 [[nodiscard]] virtual
bool exclusive() const noexcept = 0;
178template<
typename CharT>
179struct formatter<tt::audio_device_state, CharT> : formatter<char const *, CharT> {
180 auto format(tt::audio_device_state
const &t,
auto &fc)
182 return formatter<char const *, CharT>::format(tt::to_const_string(t), fc);
A set of audio channels which can be rendered and/or captures at the same time.
Definition audio_device.hpp:52
virtual bool exclusive() const noexcept=0
Check if the device is in exclusive mode.
virtual audio_device_state state() const noexcept=0
Get the current state of the audio device.
virtual void set_exclusive(bool exclusive) noexcept=0
Set the device in exclusive or shared mode.
virtual void set_input_speaker_mapping(tt::speaker_mapping speaker_mapping) noexcept=0
Set the input speaker mapping.
virtual double sample_rate() const noexcept=0
Get the currently configured sample rate.
virtual std::vector< tt::speaker_mapping > available_input_speaker_mappings() const noexcept=0
Speaker mapping that are available in the current configuration.
virtual tt::speaker_mapping input_speaker_mapping() const noexcept=0
Get the currently configured input speaker mapping.
virtual void set_sample_rate(double sample_rate) noexcept=0
Set the sample rate.
virtual tt::speaker_mapping output_speaker_mapping() const noexcept=0
Get the currently configured output speaker mapping.
virtual std::string name() const noexcept=0
Get a user friendly name of the audio device.
virtual std::vector< tt::speaker_mapping > available_output_speaker_mappings() const noexcept=0
Speaker mapping that are available in the current configuration.
virtual void set_output_speaker_mapping(tt::speaker_mapping speaker_mapping) noexcept=0
Set the output speaker mapping.
audio_device_id id
The nonephemeral unique id that for an audio device on the system.
Definition audio_device.hpp:59
Definition audio_device_delegate.hpp:11
Definition audio_device_id.hpp:14
A label consisting of localizable text and an icon.
Definition label.hpp:27