7#include "pcm_format.hpp"
8#include "speaker_mapping.hpp"
9#include "../macros.hpp"
13hi_export_module(hikogui.audio.audio_stream_format);
15namespace hi {
inline namespace v1 {
17hi_export
constexpr auto common_sample_rates =
std::array{
42 uint32_t sample_rate = 0;
43 uint16_t num_channels = 0;
44 hi::speaker_mapping speaker_mapping = hi::speaker_mapping::none;
55 uint16_t num_channels,
56 hi::speaker_mapping speaker_mapping = hi::speaker_mapping::none)
noexcept :
57 format(format), sample_rate(sample_rate), num_channels(num_channels), speaker_mapping(speaker_mapping)
61 [[
nodiscard]]
constexpr bool empty()
const noexcept
63 return format.empty();
66 constexpr explicit operator bool()
const noexcept
71 [[
nodiscard]]
constexpr bool holds_invariant()
const noexcept
73 if (popcount(speaker_mapping) != 0
and num_channels != popcount(speaker_mapping)) {
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
The format of a stream of audio.
Definition audio_stream_format.hpp:40
Definition pcm_format.hpp:18