Skip to content

C++17 API — Config, Plan & Permission Reports

Value types and side-effect-free inspection reports in namespace cspa.


class MixerConfig {
public:
MixerConfig() noexcept;
MixerConfig &set_clamp_f32(bool v) noexcept;
MixerConfig &set_silence_on_idle(bool v) noexcept;
MixerConfig &set_on_input_failure(OnInputFailure mode) noexcept;
const cspa_mixer_config_record &raw() const noexcept;
};
class OutputConverter {
public:
OutputConverter(
uint32_t rate_hz,
uint32_t channels,
SampleFormat sample_format = SampleFormat::F32,
ByteOrder byte_order = ByteOrder::Little,
DitherMode dither = DitherMode::Tpdf,
uint64_t seed = 0
) noexcept;
const cspa_output_converter_record &raw() const noexcept;
};
struct ProcessTreeRange {
ProcessTreeStrategy start_level = ProcessTreeStrategy::NativeKernelCapture;
bool has_fallback_limit = true;
ProcessTreeStrategy fallback_limit = ProcessTreeStrategy::SoftwareStreamMix;
cspa_process_tree_range_record to_raw() const noexcept;
};
struct PlanReport {
PlatformOs os = PlatformOs::Windows;
BackendId selected_backend = BackendId::None;
CombineMode combine_mode = CombineMode::Auto;
CombineResolution combine_resolution = CombineResolution::PassThrough;
InputConversionPolicy input_conversion = InputConversionPolicy::AutoWhenMixing;
bool uses_software_mixer = false;
bool uses_output_converter = false;
bool requires_discovery_subscription = false;
OverlapSemantics overlap_semantics = OverlapSemantics::SingleTarget;
bool allow_reroute = false;
PermissionPolicy permission_policy = PermissionPolicy::AutoRequest;
uint64_t duplicate_target_count = 0;
uint64_t estimated_active_streams = 0;
uint64_t estimated_pcm_bytes = 0;
std::vector<cspa_target_plan_record> target_plans;
};
struct PermissionReport {
PlatformOs os = PlatformOs::Windows;
bool is_granted = false;
bool has_denial = false;
bool requires_relaunch = false;
PermissionEntry entries[CSPA_PERMISSION_KIND_COUNT]{};
const PermissionEntry &microphone() const noexcept;
const PermissionEntry &system_audio() const noexcept;
const PermissionEntry &screen_recording() const noexcept;
static PermissionReport from_raw(const cspa_permission_report_record &raw) noexcept;
};
struct PermissionEntry {
PermissionKind kind = PermissionKind::Microphone;
PermissionState state = PermissionState::Unknown;
bool required = false;
bool can_prompt = false;
bool requires_relaunch = false;
bool is_granted() const noexcept;
};

inline Result<PermissionReport> check_permissions(
const std::vector<Target> &targets =;
inline Result<PermissionReport> request_permissions(
const std::vector<Target> &targets =;