#pragma once

#include <string>
#include <vector>
#include <unordered_set>

#include "core/project_model.hpp"

namespace smartcut::core {

struct RenderOperation { std::string kind; std::string source_uuid; std::size_t video_stream{}; std::size_t audio_stream{static_cast<std::size_t>(-1)}; std::uint64_t first_frame{}; std::uint64_t end_frame{}; std::string reason; std::string audio_policy; std::string stream_type; int audio_time_base_num{}; int audio_time_base_den{}; };
class RenderPlan {
 public:
  static RenderPlan from_project(const Project& project);
  const std::vector<RenderOperation>& operations() const { return operations_; }
  void add_operation(RenderOperation operation) { operations_.push_back(std::move(operation)); }
  void add_source_fingerprint(std::string source_uuid) { source_fingerprints_.push_back(std::move(source_uuid)); }
  std::string to_json() const;
  std::string explain_text() const;
  const std::vector<std::string>& source_fingerprints() const { return source_fingerprints_; }
 private:
  std::vector<RenderOperation> operations_;
  std::vector<std::string> source_fingerprints_;
};

}  // namespace smartcut::core
