#pragma once

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

#include "core/device_discovery.h"

namespace aptt {

struct DirectSoundFormatProbeRequest {
  std::string stable_id;
  std::vector<FormatDescriptor> candidate_formats;
};

FormatDescriptor DirectSoundPcmCandidate(std::uint32_t sample_rate_hz,
                                         SampleType sample_type,
                                         std::uint32_t channel_count);
std::vector<FormatDescriptor> DirectSoundDefaultPcmCandidates();

std::string DirectSoundDefaultStableId();
std::string DirectSoundGuidStableIdFromText(std::string guid_text);
std::uint32_t DirectSoundProbeBufferBytes(const FormatDescriptor& descriptor);
std::string DirectSoundResultSymbol(std::int64_t result);
CapabilitySupport DirectSoundSupportFromHResult(std::int64_t result);

DeviceCapabilitySnapshot MakeDirectSoundDeviceSnapshot(
    std::string stable_id,
    std::string friendly_name,
    std::string driver_module,
    bool is_default);

CapabilityProbeRecord MakeDirectSoundFormatProbeRecord(
    const FormatDescriptor& requested,
    std::int64_t result);

DeviceCapabilitySnapshot ProbeDirectSoundDeviceFormats(
    const DirectSoundFormatProbeRequest& request);
DiscoverySnapshot EnumerateDirectSoundOutputDevices();

}  // namespace aptt
