HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
audio_stream_format.hpp
1// Copyright Take Vos 2020.
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_sample_format.hpp"
8#include "speaker_mapping.hpp"
9#include <bit>
10
11namespace tt {
12
16 audio_sample_format sample_format;
17 double sample_rate;
18 tt::speaker_mapping speaker_mapping;
19
20 constexpr audio_stream_format() noexcept :
21 sample_format(), sample_rate(0.0f), speaker_mapping(tt::speaker_mapping::none) {}
22
23 constexpr audio_stream_format(audio_stream_format const &) noexcept = default;
24 constexpr audio_stream_format(audio_stream_format &&) noexcept = default;
25 constexpr audio_stream_format &operator=(audio_stream_format const &) noexcept = default;
26 constexpr audio_stream_format &operator=(audio_stream_format &&) noexcept = default;
27
28 [[nodiscard]] constexpr audio_stream_format(
29 audio_sample_format sample_format,
30 double sample_rate,
31 tt::speaker_mapping speaker_mapping) noexcept :
32 sample_format(sample_format),
33 sample_rate(sample_rate),
34 speaker_mapping(speaker_mapping)
35 {
36 }
37
38 constexpr explicit operator bool () const noexcept
39 {
40 return static_cast<bool>(sample_format);
41 }
42};
43
44} // namespace tt
Audio sample format.
Definition audio_sample_format.hpp:29
The format of a stream of audio.
Definition audio_stream_format.hpp:15