/*
- 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;
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:
- boost::shared_ptr<const Film> _film;
- boost::weak_ptr<Job> _job;
- boost::shared_ptr<Player> _player;
+ std::shared_ptr<const Film> _film;
+ std::weak_ptr<Job> _job;
+ std::shared_ptr<Player> _player;
};
+
#endif