HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
audio_device.hpp
1// Copyright Take Vos 2019-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 "../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 "audio_device_state.hpp"
13#include "speaker_mapping.hpp"
14#include "../label.hpp"
15#include "../enum_metadata.hpp"
16#include "../loop.hpp"
17#include <string>
18#include <memory>
19#include <ostream>
20
21namespace hi::inline v1 {
22
32public:
33 audio_device() noexcept = default;
34 virtual ~audio_device() = default;
35
38 [[nodiscard]] std::string const& id() const noexcept
39 {
40 return _id;
41 }
42
47 [[nodiscard]] std::string name() const noexcept
48 {
49 hi_axiom(loop::main().on_thread());
50 return _name;
51 }
52
57 [[nodiscard]] virtual label label() const noexcept = 0;
58
63 virtual void update_state() noexcept = 0;
64
67 [[nodiscard]] virtual audio_device_state state() const noexcept = 0;
68
69 [[nodiscard]] virtual audio_direction direction() const noexcept = 0;
70
75 [[nodiscard]] virtual bool exclusive() const noexcept = 0;
76
91 virtual void set_exclusive(bool exclusive) noexcept = 0;
92
98 [[nodiscard]] virtual double sample_rate() const noexcept = 0;
99
103 virtual void set_sample_rate(double sample_rate) noexcept = 0;
104
109 [[nodiscard]] virtual hi::speaker_mapping input_speaker_mapping() const noexcept = 0;
110
115 virtual void set_input_speaker_mapping(hi::speaker_mapping speaker_mapping) noexcept = 0;
116
121 [[nodiscard]] virtual std::vector<hi::speaker_mapping> available_input_speaker_mappings() const noexcept = 0;
122
127 [[nodiscard]] virtual hi::speaker_mapping output_speaker_mapping() const noexcept = 0;
128
133 virtual void set_output_speaker_mapping(hi::speaker_mapping speaker_mapping) noexcept = 0;
134
139 [[nodiscard]] virtual std::vector<hi::speaker_mapping> available_output_speaker_mappings() const noexcept = 0;
140
155 // virtual void start_stream(std::string id, std::string name) = 0;
156
160 // virtual void stop_stream() noexcept = 0;
161
162protected:
163 std::string _id;
164 std::string _name;
165};
166
167} // namespace hi::inline v1
Functionality for labels, text and icons.
STL namespace.
DOXYGEN BUG.
Definition algorithm.hpp:15
The HikoGUI namespace.
Definition ascii.hpp:19
A set of audio channels which can be rendered and/or captures at the same time.
Definition audio_device.hpp:31
std::string name() const noexcept
Get a user friendly name of the audio device.
Definition audio_device.hpp:47
std::string const & id() const noexcept
The nonephemeral unique id that for an audio device on the system.
Definition audio_device.hpp:38
virtual label label() const noexcept=0
Get a user friendly label of the audio device.
A label consisting of localizable text and an icon.
Definition label.hpp:124