import {
  defineVQTimeline,
  say,
  video,
  type VQSpeechEvent,
  type VQTimelineEvent,
  type VQTimelineInputEvent,
  type VQVideoEvent,
} from "../../lib/VQRemotionLib/timeline";
import type {CharacterId, VoicevoxVoice} from "./characters";

export {characters} from "./characters";
export type {CharacterDefinition, CharacterId, VoicevoxVoice} from "./characters";

export type SpeechEvent = VQSpeechEvent<CharacterId, VoicevoxVoice>;
export type VideoEvent = VQVideoEvent;
export type TimelineEvent = VQTimelineEvent<CharacterId, VoicevoxVoice>;
export type TimelineInputEvent = VQTimelineInputEvent<
  CharacterId,
  VoicevoxVoice
>;

export const PIZZA_KILN_BACKGROUND_VIDEO_PATH =
  "video/pizza-kiln-background.mp4";
export const PIZZA_KILN_BACKGROUND_VIDEO_FRAMES = 154;

export const timeline = defineVQTimeline([
  say(
    "pizza-kiln-sayo-001",
    "sayo",
    "小夜です。今日は、お手製の耐熱煉瓦ピザ窯を、全体ショットでご紹介します。"
  ),
  video("pizza-kiln-video-001", PIZZA_KILN_BACKGROUND_VIDEO_PATH, {
    placement: "blocking",
    playback: "once",
    durationFrames: PIZZA_KILN_BACKGROUND_VIDEO_FRAMES,
    muted: true,
    fit: "cover",
  }),
  say(
    "pizza-kiln-sayo-002",
    "sayo",
    "以上、小夜がお届けしました。ピザ窯の雰囲気、伝わっていたらうれしいです。"
  ),
] satisfies readonly TimelineInputEvent[]);
