Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pcm_capabilities.hpp File Reference

Turns what a PCM driver reports (rate range, channel range, period range) into the lists a DeviceInfo carries. More...

#include <algorithm>
#include <array>
#include <cstdint>
#include <iterator>
#include <optional>
#include <vector>

Go to the source code of this file.

Classes

struct  pulp::audio::PcmCapabilities
 What one direction (playback or capture) of a device can do. More...
struct  pulp::audio::PcmDeviceSummary
 The lists and channel counts a DeviceInfo carries for one device. More...

Namespaces

namespace  pulp
namespace  pulp::audio
namespace  pulp::audio::detail

Functions

const std::array< unsigned, 13 > & pulp::audio::standard_sample_rates ()
 Rates worth offering when a driver reports a continuous range.
std::vector< double > pulp::audio::sample_rates_from (const PcmCapabilities &caps)
 Sample rates the device supports, ascending.
std::vector< int > pulp::audio::buffer_sizes_from (const PcmCapabilities &caps, unsigned periods_per_buffer=2)
 Callback buffer sizes (frames), ascending: the powers of two inside the driver's period range such that periods_per_buffer periods still fit in the largest buffer.
template<typename T>
std::vector< T > pulp::audio::detail::intersect_sorted (const std::vector< T > &a, const std::vector< T > &b)
PcmDeviceSummary pulp::audio::summarize_pcm_capabilities (const std::optional< PcmCapabilities > &playback, const std::optional< PcmCapabilities > &capture)
 Summarise the probed directions.

Detailed Description

Turns what a PCM driver reports (rate range, channel range, period range) into the lists a DeviceInfo carries.

Deliberately free of the device header so it adds nothing to that header's include fan-out. The conversion is plain arithmetic on numbers, so it lives apart from any platform audio API and can be tested on every host.