45 hi_log_error(
"Could not get pin-count on device {}: {}", _device_name, e.
what());
55 hi_log_error(
"Could not get pin-name on device {}: {}", _device_name, e.
what());
64 if (is_streaming_pin(
pin_nr, direction)) {
75 hi_log_error(
"Could not get pin-category on device {}: {}", _device_name, e.
what());
85 hi_log_error(
"Could not get pin-communication on device {}: {}", _device_name, e.
what());
112 "Bad KSDATARANGE_AUDIO MinimumBitsPerSample == {} for device {}",
119 "Bad KSDATARANGE_AUDIO MaximumBitsPerSample == {} for device {}",
126 "Bad KSDATARANGE_AUDIO MinimumBitsPerSample == {}, MaximumBitsPerSample {} for device {}",
135 "Bad KSDATARANGE_AUDIO MaximumChannels == {} for device {}",
143 "Bad KSDATARANGE_AUDIO MinimumSampleFrequency == {}, MaximumSampleFrequency {} for device {}",
164 sample_format, num_channels, min_sample_rate, max_sample_rate, surround_mode::none};
169 sample_format, num_channels, min_sample_rate, max_sample_rate, surround_mode::none};
185 for (
auto pin_nr : find_streaming_pins(direction)) {
202 throw io_error(
"KSMULTIPLE_ITEM header corrupt");
206 for (
auto i = 0
_uz; i !=
header->Count; ++i) {
207 co_yield std::launder(
reinterpret_cast<T
const *
>(ptr));
225 for (
auto i = 0
_uz; i !=
header->Count; ++i) {
226 auto *item = std::launder(
reinterpret_cast<KSDATARANGE const *
>(ptr));
229 ptr += item->FormatSize;
255 if (
r_size !=
sizeof(T)) {
256 throw io_error(
"Unexpected return size");
273 throw io_error(
"Unexpected return size 0");
280 throw io_error(
"Unexpected return size");
283 auto r = std::make_unique<char[]>(
r_size);
289 throw io_error(
"Incomplete header read");
294 throw io_error(
"Incomplete read");
320 throw io_error(
"Expected even number of bytes in return value.");
324 hi_assert(
r_size == (r.size() + 1) *
sizeof(
wchar_t{}));
330 return hi::to_string(r);
345 hi_log_error(
"Could not get pin-interface property for {} pin_nr {}: {}", _device_name,
pin_nr, e.
what());
362 hi_log_error(
"Could not get pin-medium property for {} pin_nr {}: {}", _device_name,
pin_nr, e.
what());
370 if (
not is_streaming_interface(
pin_nr)) {
381 if (direction != audio_direction::input
and direction != audio_direction::bidirectional) {
386 if (direction != audio_direction::output
and direction != audio_direction::bidirectional) {
constexpr std::wstring to_wstring(std::u32string_view rhs) noexcept
Conversion from UTF-32 to wide-string (UTF-16/32).
Definition to_string.hpp:156
std::string get_last_error_message()
Get the OS error message from the last error received on this thread.
Definition exception_win32_impl.hpp:31
generator< audio_format_range > get_format_ranges(audio_direction direction) const noexcept
Get all the audio formats supported by this device.
Definition win32_device_interface.hpp:183