#pragma once

#include <cstdint>

#include "core/preview_sync.hpp"

namespace smartcut::worker {

class PlaybackSession {
 public:
  PlaybackSession(core::RationalTimebase audio_timebase, core::RationalTimebase video_timebase, std::int64_t tolerance_ticks)
      : synchronizer_(audio_timebase, video_timebase, tolerance_ticks) {}
  core::SyncAction sync_step(std::int64_t audio_pts, std::int64_t video_pts) { return synchronizer_.update(audio_pts, video_pts); }
  std::int64_t drift_ticks() const { return synchronizer_.drift_ticks(); }
 private:
  core::PreviewSynchronizer synchronizer_;
};

}  // namespace smartcut::worker
