export type SoundSpec = {
  name: string;
  url?: string;
  volume?: number;
  states?: Map<string | number, SoundSpec>;
};

export const MovingSound: SoundSpec = {
  name: "moving",
  states: new Map([
    [1, { name: "moving_1", url: "/assets/sound/move_1.wav" }],
    [2, { name: "moving_2", url: "/assets/sound/move_2.wav" }],
  ]),
};

export const LambdaTransformSound: SoundSpec = {
  name: "lambdaTransform",
  url: "/assets/sound/lambda_transform.wav",
  volume: 0.3,
};

export const LambdaSave: SoundSpec = {
  name: "lambdaSave",
  url: "/assets/sound/lambda_save.wav",
};

export const Failure: SoundSpec = {
  name: "failure",
  url: "/assets/sound/failure.wav",
  volume: 0.5,
};

export const ModalOpen: SoundSpec = {
  name: "modalOpen",
  url: "/assets/sound/modal_open.wav",
  volume: 0.5,
};

export const ModalClose: SoundSpec = {
  name: "modalClose",
  url: "/assets/sound/modal_close.wav",
  volume: 0.5,
};

export const KeyOpen: SoundSpec = {
  name: "keyOpen",
  url: "/assets/sound/keyopen.wav",
};

export const Music: SoundSpec = {
  name: "music",
  states: new Map([
    [
      "hope",
      { name: "hope", url: "/assets/sound/music/hope.mp3", volume: 0.5 },
    ],
    ["jul", { name: "jul", url: "/assets/sound/music/jul.mp3", volume: 0.5 }],
    [
      "reverie",
      { name: "reverie", url: "/assets/sound/music/reverie.mp3", volume: 0.5 },
    ],
    [
      "moonlight",
      {
        name: "moonlight",
        url: "/assets/sound/music/moonlight.mp3",
        volume: 0.5,
      },
    ],
    [
      "home",
      {
        name: "home",
        url: "/assets/sound/music/home.mp3",
        volume: 0.5,
      },
    ],
  ]),
};

export const SOUND_SPECS: SoundSpec[] = [
  MovingSound,
  LambdaTransformSound,
  LambdaSave,
  Failure,
  ModalOpen,
  ModalClose,
  KeyOpen,
  Music,
];
