#pragma once

#include <cstdint>
#include <string>
#include <vector>

#include "core/device_discovery.h"

namespace aptt {

struct WasapiFormatProbeRequest {
  std::string endpoint_id;
  std::vector<FormatDescriptor> candidate_formats;
  bool exclusive_mode = false;
  bool include_mix_format_candidate = true;
};

FormatDescriptor WasapiDefaultPcmCandidate();
std::vector<FormatDescriptor> WasapiDefaultPcmCandidates();
FormatDescriptor WasapiPcmCandidate(std::uint32_t sample_rate_hz,
                                    SampleType sample_type,
                                    std::uint32_t channel_count);
FormatDescriptor WasapiDopCarrierCandidate(std::uint32_t dsd_rate_multiplier,
                                           std::uint32_t channel_count);
std::vector<FormatDescriptor> WasapiDefaultDopCarrierCandidates(
    std::uint32_t channel_count);

CapabilitySupport ClassifyWasapiFormatSupportResult(
    std::int32_t raw_hresult,
    bool closest_match_returned);

DeviceCapabilitySnapshot ProbeWasapiEndpointFormats(
    const WasapiFormatProbeRequest& request);

}  // namespace aptt
