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 (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 */
/*
- Copyright (C) 2013-2020 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2013-2021 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
*/
+
#ifndef DCPOMATIC_PLAYER_VIDEO_H
#define DCPOMATIC_PLAYER_VIDEO_H
+
#include "types.h"
#include "position.h"
#include "dcpomatic_time.h"
#include <libavutil/pixfmt.h>
}
#include <boost/thread/mutex.hpp>
-#include <boost/noncopyable.hpp>
+
class Image;
class ImageProxy;
class Film;
class Socket;
+
/** Everything needed to describe a video frame coming out of the player, but with the
* bits still their raw form. We may want to combine the bits on a remote machine,
* or maybe not even bother to combine them at all.
*/
-class PlayerVideo : public boost::noncopyable
+class PlayerVideo
{
public:
PlayerVideo (
PlayerVideo (std::shared_ptr<cxml::Node>, std::shared_ptr<Socket>);
+ PlayerVideo (PlayerVideo const&) = delete;
+ PlayerVideo& operator= (PlayerVideo const&) = delete;
+
std::shared_ptr<PlayerVideo> shallow_copy () const;
void set_text (PositionImage);
mutable bool _error;
};
+
#endif
/*
- Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
*/
+
#include "server.h"
#include "dcpomatic_socket.h"
+
#include "i18n.h"
+
+using std::make_shared;
using std::shared_ptr;
+
Server::Server (int port, int timeout)
: _terminate (false)
, _acceptor (_io_service, boost::asio::ip::tcp::endpoint (boost::asio::ip::tcp::v4(), port))
}
+
Server::~Server ()
{
{
stop ();
}
+
void
Server::run ()
{
_io_service.run ();
}
+
void
Server::start_accept ()
{
}
}
- shared_ptr<Socket> socket (new Socket(_timeout));
+ auto socket = make_shared<Socket>(_timeout);
_acceptor.async_accept (socket->socket (), boost::bind (&Server::handle_accept, this, socket, boost::asio::placeholders::error));
}
+
void
Server::handle_accept (shared_ptr<Socket> socket, boost::system::error_code const & error)
{
start_accept ();
}
+
void
Server::stop ()
{
/*
- Copyright (C) 2015 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2015-2021 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
*/
+
#ifndef DCPOMATIC_SERVER_H
#define DCPOMATIC_SERVER_H
+
#include <boost/thread.hpp>
#include <boost/asio.hpp>
#include <boost/thread/condition.hpp>
-#include <boost/noncopyable.hpp>
#include <string>
+
class Socket;
-class Server : public boost::noncopyable
+
+class Server
{
public:
explicit Server (int port, int timeout = 30);
virtual ~Server ();
+ Server (Server const&) = delete;
+ Server& operator= (Server const&) = delete;
+
virtual void run ();
void stop ();
int _timeout;
};
+
#endif
/*
- Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
*/
+
#include "signal_manager.h"
+
/** Global SignalManager instance */
-SignalManager* signal_manager = 0;
+SignalManager* signal_manager = nullptr;
/*
- Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
*/
+
#ifndef DCPOMATIC_SIGNAL_MANAGER_H
#define DCPOMATIC_SIGNAL_MANAGER_H
+
#include "exception_store.h"
#include <boost/asio.hpp>
#include <boost/thread.hpp>
#include <boost/noncopyable.hpp>
+
class Signaller;
+
/** A class to allow signals to be emitted from non-UI threads and handled
* by a UI thread.
*/
-class SignalManager : public boost::noncopyable, public ExceptionStore
+class SignalManager : public ExceptionStore
{
public:
/** Create a SignalManager. Must be called from the UI thread */
virtual ~SignalManager () {}
+ SignalManager (Signaller const&) = delete;
+ SignalManager& operator= (Signaller const&) = delete;
+
/* Do something next time the UI is idle */
template <typename T>
void when_idle (T f) {
boost::thread::id _ui_thread;
};
+
extern SignalManager* signal_manager;
+
#endif