#pragma once

#include <filesystem>
#include <optional>
#include <string>

#include "core/videoredo_project.hpp"

namespace smartcut::core {

struct VideoReDoBatchProfile {
  int id{8};
  std::string name{"Matroska MKV"};
  std::string output_mode{"Smart"};
  std::string file_type{"MKV"};
  std::string video_encoder{"Match"};
  int width{};
  int height{};
  int bitrate_kbps{};
  int max_bitrate_kbps{};
  std::string deinterlace{"None"};
  std::string frame_rate{"No Change"};
  std::string audio_encoder{"Auto"};
  int audio_bitrate_kbps{};
  std::string audio_sample_rate{"No Change"};
  std::string audio_channels{"Auto"};
};

struct VideoReDoBatchProject {
  std::string status{"New"};
  std::string type{"File"};
  std::string output_file;
  bool quick_stream_fix{};
  int dimension_width{};
  int dimension_height{};
  VideoReDoProject project;
  VideoReDoBatchProfile profile;
};

std::optional<VideoReDoBatchProject> read_videoredo_batch_project(
    const std::filesystem::path& path, std::string* error = nullptr);
bool write_videoredo_batch_project(const std::filesystem::path& path,
                                   const VideoReDoBatchProject& batch,
                                   std::string* error = nullptr);

}  // namespace smartcut::core
