#include "core/audio_types.h"

namespace aptt {

const char* ToString(BackendApi backend) {
  switch (backend) {
    case BackendApi::kNull:
      return "Null";
    case BackendApi::kMme:
      return "MME";
    case BackendApi::kDirectSound:
      return "DirectSound";
    case BackendApi::kWasapiShared:
      return "WASAPI Shared";
    case BackendApi::kWasapiExclusive:
      return "WASAPI Exclusive";
    case BackendApi::kAsio:
      return "ASIO";
    case BackendApi::kKernelStreaming:
      return "Kernel Streaming";
  }
  return "Unknown";
}

const char* ToString(SignalMode signal_mode) {
  switch (signal_mode) {
    case SignalMode::kPcm:
      return "PCM";
    case SignalMode::kDop:
      return "DoP";
    case SignalMode::kAsioNativeDsd:
      return "ASIO Native DSD";
  }
  return "Unknown";
}

const char* ToString(SampleType sample_type) {
  switch (sample_type) {
    case SampleType::kInt16:
      return "int16";
    case SampleType::kInt24Packed:
      return "int24-packed";
    case SampleType::kInt24In32:
      return "int24-in-32";
    case SampleType::kInt32:
      return "int32";
    case SampleType::kFloat32:
      return "float32";
    case SampleType::kFloat64:
      return "float64";
    case SampleType::kDsd1BitLsbFirst:
      return "dsd1-lsb-first";
    case SampleType::kDsd1BitMsbFirst:
      return "dsd1-msb-first";
    case SampleType::kDsd8Bit:
      return "dsd8";
  }
  return "unknown";
}

const char* ToString(HoldMode hold_mode) {
  switch (hold_mode) {
    case HoldMode::kKeepWarmAfterStop:
      return "keep-warm-after-stop";
    case HoldMode::kHoldInitialized:
      return "hold-initialized";
    case HoldMode::kReleaseAfterDrain:
      return "release-after-drain";
    case HoldMode::kImmediateRelease:
      return "immediate-release";
  }
  return "unknown";
}

}  // namespace aptt
