Use dcp::file_to_string().
[dcpomatic.git] / src / lib / encoder.h
index 64540195278ea0970f8b7e87d297fd937aa66e23..19c1120b360f789fd8af1ef76ccf85a97e494337 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2017 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #ifndef DCPOMATIC_ENCODER_H
 #define DCPOMATIC_ENCODER_H
 
+
+#include "player_text.h"
 #include "types.h"
-#include "player_subtitles.h"
-#include <boost/weak_ptr.hpp>
 #include <boost/signals2.hpp>
 
+
 class Film;
 class Encoder;
 class Player;
@@ -33,33 +35,35 @@ class Job;
 class PlayerVideo;
 class AudioBuffers;
 
-/** @class Encoder */
-class Encoder : public boost::noncopyable
+
+/** @class Encoder
+ *  @brief Parent class for something that can encode a film into some format
+ */
+class Encoder
 {
 public:
-       Encoder (boost::shared_ptr<const Film> film, boost::weak_ptr<Job> job);
+       Encoder (std::shared_ptr<const Film> film, std::weak_ptr<Job> job);
        virtual ~Encoder () {}
 
+       Encoder (Encoder const&) = delete;
+       Encoder& operator= (Encoder const&) = delete;
+
        virtual void go () = 0;
 
        /** @return the current frame rate over the last short while */
-       virtual float current_rate () const = 0;
+       virtual boost::optional<float> current_rate () const {
+               return {};
+       }
+
        /** @return the number of frames that are done */
        virtual Frame frames_done () const = 0;
        virtual bool finishing () const = 0;
 
 protected:
-       virtual void video (boost::shared_ptr<PlayerVideo>, DCPTime) = 0;
-       virtual void audio (boost::shared_ptr<AudioBuffers>, DCPTime) = 0;
-       virtual void subtitle (PlayerSubtitles, DCPTimePeriod) = 0;
-
-       boost::shared_ptr<const Film> _film;
-       boost::weak_ptr<Job> _job;
-       boost::shared_ptr<Player> _player;
-
-       boost::signals2::scoped_connection _player_video_connection;
-       boost::signals2::scoped_connection _player_audio_connection;
-       boost::signals2::scoped_connection _player_subtitle_connection;
+       std::shared_ptr<const Film> _film;
+       std::weak_ptr<Job> _job;
+       std::shared_ptr<Player> _player;
 };
 
+
 #endif