#include "encoder_factory.h"
#include "config.h"
-using namespace std;
-using namespace boost;
+using std::string;
+using boost::shared_ptr;
/** @param f Film to compare.
* @param o Options.
#include <iostream>
#include <boost/shared_ptr.hpp>
-#include <sigc++/bind.h>
#include "ab_transcoder.h"
#include "film.h"
#include "decoder.h"
* for the right half (to facilitate A/B comparisons of settings)
*/
-using namespace std;
-using namespace boost;
+using std::string;
+using boost::shared_ptr;
/** @param a Film to use for the left half of the screen.
* @param b Film to use for the right half of the screen.
_da = decoder_factory (_film_a, o, j);
_db = decoder_factory (_film_b, o, j);
- _da->Video.connect (sigc::bind (sigc::mem_fun (*this, &ABTranscoder::process_video), 0));
- _db->Video.connect (sigc::bind (sigc::mem_fun (*this, &ABTranscoder::process_video), 1));
- _da->Audio.connect (sigc::mem_fun (*e, &Encoder::process_audio));
+ _da->Video.connect (bind (&ABTranscoder::process_video, this, _1, _2, _3, 0));
+ _db->Video.connect (bind (&ABTranscoder::process_video, this, _1, _2, _3, 1));
+ _da->Audio.connect (bind (&Encoder::process_audio, e, _1));
}
ABTranscoder::~ABTranscoder ()
#include "transcode_job.h"
#include "film.h"
-using namespace std;
-using namespace boost;
+using std::string;
+using std::stringstream;
+using std::ifstream;
+using boost::shared_ptr;
CheckHashesJob::CheckHashesJob (shared_ptr<Film> f, shared_ptr<const Options> o, shared_ptr<Job> req)
: Job (f, req)
string const j2k_file = _opt->frame_out_path (i, false);
string const hash_file = j2k_file + ".md5";
- if (!filesystem::exists (j2k_file)) {
+ if (!boost::filesystem::exists (j2k_file)) {
_film->log()->log (String::compose ("Frame %1 has a missing J2K file.", i));
- filesystem::remove (hash_file);
+ boost::filesystem::remove (hash_file);
++_bad;
- } else if (!filesystem::exists (hash_file)) {
+ } else if (!boost::filesystem::exists (hash_file)) {
_film->log()->log (String::compose ("Frame %1 has a missing hash file.", i));
- filesystem::remove (j2k_file);
+ boost::filesystem::remove (j2k_file);
++_bad;
} else {
ifstream ref (hash_file.c_str ());
ref >> hash;
if (hash != md5_digest (j2k_file)) {
_film->log()->log (String::compose ("Frame %1 has wrong hash; deleting.", i));
- filesystem::remove (j2k_file);
- filesystem::remove (hash_file);
+ boost::filesystem::remove (j2k_file);
+ boost::filesystem::remove (hash_file);
++_bad;
}
}
#include "filter.h"
#include "sound_processor.h"
-using namespace std;
-using namespace boost;
+using std::vector;
+using std::ifstream;
+using std::string;
+using std::ofstream;
+using boost::shared_ptr;
Config* Config::_instance = 0;
string
Config::file () const
{
- filesystem::path p;
+ boost::filesystem::path p;
p /= g_get_user_config_dir ();
p /= ".dvdomatic";
return p.string ();
#include <vector>
#include <boost/shared_ptr.hpp>
-#include <sigc++/signal.h>
+#include <boost/signals2.hpp>
class ServerDescription;
class Screen;
void write () const;
- sigc::signal0<void> Changed;
+ boost::signals2::signal<void()> Changed;
static Config* instance ();
#include "cross.h"
#include "film.h"
-using namespace std;
-using namespace boost;
+using std::string;
+using std::list;
+using std::stringstream;
+using boost::shared_ptr;
/** @param f Film to write DVD data into.
*/
CopyFromDVDJob::run ()
{
/* Remove any old DVD rips */
- filesystem::remove_all (_film->dir ("dvd"));
+ boost::filesystem::remove_all (_film->dir ("dvd"));
string const dvd = find_dvd ();
if (dvd.empty ()) {
string largest_file;
uintmax_t largest_size = 0;
- for (filesystem::directory_iterator i = filesystem::directory_iterator (dvd_dir); i != filesystem::directory_iterator(); ++i) {
- uintmax_t const s = filesystem::file_size (*i);
+ for (boost::filesystem::directory_iterator i = boost::filesystem::directory_iterator (dvd_dir); i != boost::filesystem::directory_iterator(); ++i) {
+ uintmax_t const s = boost::filesystem::file_size (*i);
if (s > largest_size) {
#if BOOST_FILESYSTEM_VERSION == 3
- largest_file = filesystem::path(*i).generic_string();
+ largest_file = boost::filesystem::path(*i).generic_string();
#else
largest_file = i->string ();
#endif
#include "log.h"
#include "subtitle.h"
-using namespace std;
-using namespace boost;
+using std::string;
+using std::stringstream;
+using std::ofstream;
+using boost::shared_ptr;
/** Construct a DCP video frame.
* @param input Input image.
shared_ptr<EncodedData>
DCPVideoFrame::encode_remotely (ServerDescription const * serv)
{
- asio::io_service io_service;
- asio::ip::tcp::resolver resolver (io_service);
- asio::ip::tcp::resolver::query query (serv->host_name(), boost::lexical_cast<string> (Config::instance()->server_port ()));
- asio::ip::tcp::resolver::iterator endpoint_iterator = resolver.resolve (query);
+ boost::asio::io_service io_service;
+ boost::asio::ip::tcp::resolver resolver (io_service);
+ boost::asio::ip::tcp::resolver::query query (serv->host_name(), boost::lexical_cast<string> (Config::instance()->server_port ()));
+ boost::asio::ip::tcp::resolver::iterator endpoint_iterator = resolver.resolve (query);
shared_ptr<Socket> socket (new Socket);
string const real_j2k = opt->frame_out_path (frame, false);
/* Rename the file from foo.j2c.tmp to foo.j2c now that it is complete */
- filesystem::rename (tmp_j2k, real_j2k);
+ boost::filesystem::rename (tmp_j2k, real_j2k);
/* Write a file containing the hash */
string const hash = real_j2k + ".md5";
#include "ffmpeg_compatibility.h"
#include "subtitle.h"
-using namespace std;
-using namespace boost;
+using std::string;
+using std::stringstream;
+using std::min;
+using boost::shared_ptr;
/** @param f Film.
* @param o Options.
#include <string>
#include <stdint.h>
#include <boost/shared_ptr.hpp>
-#include <sigc++/sigc++.h>
+#include <boost/signals2.hpp>
#include "util.h"
#include "stream.h"
* Second parameter is its index within the content.
* Third parameter is either 0 or a subtitle that should be on this frame.
*/
- sigc::signal<void, boost::shared_ptr<Image>, int, boost::shared_ptr<Subtitle> > Video;
+ boost::signals2::signal<void (boost::shared_ptr<Image>, int, boost::shared_ptr<Subtitle>)> Video;
/** Emitted when some audio data is ready */
- sigc::signal<void, boost::shared_ptr<AudioBuffers> > Audio;
+ boost::signals2::signal<void (boost::shared_ptr<AudioBuffers>)> Audio;
protected:
/** perform a single pass at our content */
#include "imagemagick_decoder.h"
#include "film.h"
-using namespace std;
-using namespace boost;
+using std::string;
+using boost::shared_ptr;
shared_ptr<Decoder>
decoder_factory (
shared_ptr<Film> f, shared_ptr<const Options> o, Job* j, bool minimal = false, bool ignore_length = false
)
{
- if (filesystem::is_directory (f->content_path ())) {
+ if (boost::filesystem::is_directory (f->content_path ())) {
/* Assume a directory contains TIFFs */
return shared_ptr<Decoder> (new TIFFDecoder (f, o, j, minimal, ignore_length));
}
#include "j2k_still_encoder.h"
#include "film.h"
-using namespace std;
-using namespace boost;
+using boost::shared_ptr;
shared_ptr<Encoder>
encoder_factory (shared_ptr<const Film> f, shared_ptr<const Options> o)
{
- if (!filesystem::is_directory (f->content_path()) && f->content_type() == STILL) {
+ if (!boost::filesystem::is_directory (f->content_path()) && f->content_type() == STILL) {
return shared_ptr<Encoder> (new J2KStillEncoder (f, o));
}
#include "log.h"
#include "film.h"
-using namespace std;
-using namespace boost;
+using std::string;
+using std::vector;
+using boost::shared_ptr;
ExamineContentJob::ExamineContentJob (shared_ptr<Film> f, shared_ptr<Job> req)
: Job (f, req)
string const tdir = _film->dir ("thumbs");
vector<int> thumbs;
- for (filesystem::directory_iterator i = filesystem::directory_iterator (tdir); i != filesystem::directory_iterator(); ++i) {
+ for (boost::filesystem::directory_iterator i = boost::filesystem::directory_iterator (tdir); i != boost::filesystem::directory_iterator(); ++i) {
/* Aah, the sweet smell of progress */
#if BOOST_FILESYSTEM_VERSION == 3
- string const l = filesystem::path(*i).leaf().generic_string();
+ string const l = boost::filesystem::path(*i).leaf().generic_string();
#else
string const l = i->leaf ();
#endif
#include "ffmpeg_decoder.h"
#include "subtitle.h"
-using namespace std;
-using namespace boost;
+using std::string;
+using std::vector;
+using std::stringstream;
+using boost::shared_ptr;
-FFmpegDecoder::FFmpegDecoder (boost::shared_ptr<Film> f, boost::shared_ptr<const Options> o, Job* j, bool minimal, bool ignore_length)
+FFmpegDecoder::FFmpegDecoder (shared_ptr<Film> f, shared_ptr<const Options> o, Job* j, bool minimal, bool ignore_length)
: Decoder (f, o, j, minimal, ignore_length)
, _format_context (0)
, _video_stream (-1)
#include "version.h"
#include "ui_signaller.h"
-using namespace std;
-using namespace boost;
+using std::string;
+using std::stringstream;
+using std::multimap;
+using std::pair;
+using std::map;
+using std::vector;
+using std::ifstream;
+using std::ofstream;
+using std::setfill;
+using boost::shared_ptr;
+using boost::lexical_cast;
+using boost::to_upper_copy;
+using boost::ends_with;
+using boost::starts_with;
/** Construct a Film object in a given directory, reading any metadata
* file that exists in that directory. An exception will be thrown if
- * must_exist is true, and the specified directory does not exist.
+ * must_exist is true and the specified directory does not exist.
*
* @param d Film directory.
* @param must_exist true to throw an exception if does not exist.
(Code swiped from Adam Bowen on stackoverflow)
*/
- filesystem::path p (filesystem::system_complete (d));
- filesystem::path result;
- for (filesystem::path::iterator i = p.begin(); i != p.end(); ++i) {
+ boost::filesystem::path p (boost::filesystem::system_complete (d));
+ boost::filesystem::path result;
+ for (boost::filesystem::path::iterator i = p.begin(); i != p.end(); ++i) {
if (*i == "..") {
- if (filesystem::is_symlink (result) || result.filename() == "..") {
+ if (boost::filesystem::is_symlink (result) || result.filename() == "..") {
result /= *i;
} else {
result = result.parent_path ();
set_directory (result.string ());
- if (!filesystem::exists (directory())) {
+ if (!boost::filesystem::exists (directory())) {
if (must_exist) {
throw OpenFileError (directory());
} else {
- filesystem::create_directory (directory());
+ boost::filesystem::create_directory (directory());
}
}
{
assert (format());
- filesystem::path p;
+ boost::filesystem::path p;
/* Start with j2c */
p /= "j2c";
}
set_thumbs (vector<int> ());
- filesystem::remove_all (dir ("thumbs"));
+ boost::filesystem::remove_all (dir ("thumbs"));
/* This call will recreate the directory */
dir ("thumbs");
_examine_content_job.reset (new ExamineContentJob (shared_from_this(), shared_ptr<Job> ()));
- _examine_content_job->Finished.connect (sigc::mem_fun (*this, &Film::examine_content_finished));
+ _examine_content_job->Finished.connect (bind (&Film::examine_content_finished, this));
JobManager::instance()->add (_examine_content_job);
}
Film::audio_files () const
{
vector<string> f;
- for (filesystem::directory_iterator i = filesystem::directory_iterator (dir("wavs")); i != filesystem::directory_iterator(); ++i) {
+ for (boost::filesystem::directory_iterator i = boost::filesystem::directory_iterator (dir("wavs")); i != boost::filesystem::directory_iterator(); ++i) {
f.push_back (i->path().string ());
}
}
int N = 0;
- for (filesystem::directory_iterator i = filesystem::directory_iterator (j2k_dir ()); i != filesystem::directory_iterator(); ++i) {
+ for (boost::filesystem::directory_iterator i = boost::filesystem::directory_iterator (j2k_dir ()); i != boost::filesystem::directory_iterator(); ++i) {
++N;
- this_thread::interruption_point ();
+ boost::this_thread::interruption_point ();
}
return N;
Film::thumb_subtitle (int n) const
{
string sub_file = thumb_base(n) + ".sub";
- if (!filesystem::exists (sub_file)) {
+ if (!boost::filesystem::exists (sub_file)) {
return pair<Position, string> ();
}
{
boost::mutex::scoped_lock lm (_state_mutex);
- filesystem::create_directories (directory());
+ boost::filesystem::create_directories (directory());
string const m = file_locked ("metadata");
ofstream f (m.c_str ());
if (k == "thumb") {
int const n = atoi (v.c_str ());
/* Only add it to the list if it still exists */
- if (filesystem::exists (thumb_file_for_frame (n))) {
+ if (boost::filesystem::exists (thumb_file_for_frame_locked (n))) {
_thumbs.push_back (n);
}
} else if (k == "width") {
return thumb_base_for_frame(n) + ".png";
}
+string
+Film::thumb_file_for_frame_locked (int n) const
+{
+ return thumb_base_for_frame_locked(n) + ".png";
+}
+
string
Film::thumb_base (int n) const
{
string
Film::thumb_base_for_frame (int n) const
+{
+ boost::mutex::scoped_lock lm (_state_mutex);
+ return thumb_base_for_frame_locked (n);
+}
+
+string
+Film::thumb_base_for_frame_locked (int n) const
{
stringstream s;
s.width (8);
s << setfill('0') << n;
- filesystem::path p;
- p /= dir ("thumbs");
+ boost::filesystem::path p;
+ p /= dir_locked ("thumbs");
p /= s.str ();
return p.string ();
}
-
/** @param n A thumb index.
* @return The frame within the Film that it is for.
*/
Film::dir (string d) const
{
boost::mutex::scoped_lock lm (_state_mutex);
- filesystem::path p;
+ return dir_locked (d);
+}
+
+string
+Film::dir_locked (string d) const
+{
+ boost::filesystem::path p;
p /= _directory;
p /= d;
- filesystem::create_directories (p);
+ boost::filesystem::create_directories (p);
return p.string ();
}
string
Film::file_locked (string f) const
{
- filesystem::path p;
+ boost::filesystem::path p;
p /= _directory;
p /= f;
return p.string ();
Film::content_path () const
{
boost::mutex::scoped_lock lm (_state_mutex);
- if (filesystem::path(_content).has_root_directory ()) {
+ if (boost::filesystem::path(_content).has_root_directory ()) {
return _content;
}
Film::content_type () const
{
#if BOOST_FILESYSTEM_VERSION == 3
- string ext = filesystem::path(_content).extension().string();
+ string ext = boost::filesystem::path(_content).extension().string();
#else
string ext = filesystem::path(_content).extension();
#endif
d << _studio << "_";
}
- gregorian::date today = gregorian::day_clock::local_day ();
- d << gregorian::to_iso_string (today) << "_";
+ boost::gregorian::date today = boost::gregorian::day_clock::local_day ();
+ d << boost::gregorian::to_iso_string (today) << "_";
if (!_facility.empty ()) {
d << _facility << "_";
string check = directory ();
#if BOOST_FILESYSTEM_VERSION == 3
- filesystem::path slash ("/");
+ boost::filesystem::path slash ("/");
string platform_slash = slash.make_preferred().string ();
#else
#ifdef DVDOMATIC_WINDOWS
check += platform_slash;
}
- if (filesystem::path(c).has_root_directory () && starts_with (c, check)) {
+ if (boost::filesystem::path(c).has_root_directory () && starts_with (c, check)) {
c = c.substr (_directory.length() + 1);
}
#include <inttypes.h>
#include <boost/thread/mutex.hpp>
#include <boost/thread.hpp>
+#include <boost/signals2.hpp>
extern "C" {
#include <libavcodec/avcodec.h>
}
void set_frames_per_second (float);
/** Emitted when some property has changed */
- mutable sigc::signal1<void, Property> Changed;
+ mutable boost::signals2::signal<void (Property)> Changed;
private:
boost::shared_ptr<ExamineContentJob> _examine_content_job;
std::string thumb_file_for_frame (int) const;
+ std::string thumb_file_for_frame_locked (int) const;
std::string thumb_base_for_frame (int) const;
+ std::string thumb_base_for_frame_locked (int) const;
void signal_changed (Property);
std::string file_locked (std::string) const;
+ std::string dir_locked (std::string d) const;
void examine_content_finished ();
/** Complete path to directory containing the film metadata;
#include "image.h"
#include "subtitle.h"
-using namespace std;
-using namespace boost;
+using std::string;
+using std::ofstream;
+using boost::shared_ptr;
/** @param f Film that we are encoding.
* @param o Options.
Magick::Image thumb (compact->size().width, compact->size().height, "RGB", MagickCore::CharPixel, compact->data()[0]);
thumb.magick ("PNG");
thumb.write (tmp_file);
- filesystem::rename (tmp_file, _opt->frame_out_path (frame, false));
+ boost::filesystem::rename (tmp_file, _opt->frame_out_path (frame, false));
if (sub) {
float const x_scale = float (_opt->out_size.width) / _film->size().width;
Magick::Image sub_thumb (compact->size().width, compact->size().height, "RGBA", MagickCore::CharPixel, compact->data()[0]);
sub_thumb.magick ("PNG");
sub_thumb.write (tmp_sub_file);
- filesystem::rename (tmp_sub_file, _opt->frame_out_path (frame, false, ".sub.png"));
+ boost::filesystem::rename (tmp_sub_file, _opt->frame_out_path (frame, false, ".sub.png"));
metadata << "x " << sub->position().x << "\n"
<< "y " << sub->position().y << "\n";
metadata.close ();
- filesystem::rename (tmp_metadata_file, _opt->frame_out_path (frame, false, ".sub"));
+ boost::filesystem::rename (tmp_metadata_file, _opt->frame_out_path (frame, false, ".sub"));
}
frame_done (frame);
#include "imagemagick_decoder.h"
#include "film.h"
-using namespace std;
-using namespace boost;
+using std::string;
+using std::pair;
+using boost::shared_ptr;
J2KStillEncoder::J2KStillEncoder (shared_ptr<const Film> f, shared_ptr<const Options> o)
: Encoder (f, o)
#include "cross.h"
#include "film.h"
-using namespace std;
-using namespace boost;
+using std::string;
+using std::stringstream;
+using std::list;
+using std::vector;
+using std::pair;
+using boost::shared_ptr;
+using boost::thread;
+using boost::lexical_cast;
J2KWAVEncoder::J2KWAVEncoder (shared_ptr<const Film> f, shared_ptr<const Options> o)
: Encoder (f, o)
#include "job.h"
#include "util.h"
-using namespace std;
-using namespace boost;
+using std::string;
+using std::list;
+using std::stringstream;
+using boost::shared_ptr;
/** @param s Film that we are operating on.
*/
set_progress (1);
set_state (FINISHED_ERROR);
- set_error (String::compose ("%1 (%2)", e.what(), filesystem::path (e.filename()).leaf()));
+ set_error (String::compose ("%1 (%2)", e.what(), boost::filesystem::path (e.filename()).leaf()));
} catch (std::exception& e) {
#include <string>
#include <boost/thread/mutex.hpp>
#include <boost/enable_shared_from_this.hpp>
-#include <sigc++/sigc++.h>
+#include <boost/signals2.hpp>
class Film;
class Options;
return _required;
}
- sigc::signal0<void> Finished;
+ boost::signals2::signal<void()> Finished;
protected:
#include "job.h"
#include "cross.h"
-using namespace std;
-using namespace boost;
+using std::string;
+using std::list;
+using boost::shared_ptr;
JobManager* JobManager::_instance = 0;
#include "imagemagick_decoder.h"
#include "film.h"
-using namespace std;
-using namespace boost;
+using std::string;
+using boost::shared_ptr;
/** @param f Film we are making the DCP for.
* @param o Options.
string const dcp_path = _film->dir (_film->dcp_name());
/* Remove any old DCP */
- filesystem::remove_all (dcp_path);
+ boost::filesystem::remove_all (dcp_path);
int frames = 0;
switch (_film->content_type ()) {
#include "log.h"
#include "film.h"
-using namespace std;
-using namespace boost;
+using std::string;
+using std::stringstream;
+using std::min;
+using boost::shared_ptr;
class SSHSession
{
string const dcp_dir = _film->dir (_film->dcp_name());
boost::uintmax_t bytes_to_transfer = 0;
- for (filesystem::directory_iterator i = filesystem::directory_iterator (dcp_dir); i != filesystem::directory_iterator(); ++i) {
- bytes_to_transfer += filesystem::file_size (*i);
+ for (boost::filesystem::directory_iterator i = boost::filesystem::directory_iterator (dcp_dir); i != boost::filesystem::directory_iterator(); ++i) {
+ bytes_to_transfer += boost::filesystem::file_size (*i);
}
boost::uintmax_t buffer_size = 64 * 1024;
char buffer[buffer_size];
boost::uintmax_t bytes_transferred = 0;
- for (filesystem::directory_iterator i = filesystem::directory_iterator (dcp_dir); i != filesystem::directory_iterator(); ++i) {
+ for (boost::filesystem::directory_iterator i = boost::filesystem::directory_iterator (dcp_dir); i != boost::filesystem::directory_iterator(); ++i) {
/* Aah, the sweet smell of progress */
#if BOOST_FILESYSTEM_VERSION == 3
- string const leaf = filesystem::path(*i).leaf().generic_string ();
+ string const leaf = boost::filesystem::path(*i).leaf().generic_string ();
#else
string const leaf = i->leaf ();
#endif
set_status ("copying " + leaf);
- boost::uintmax_t to_do = filesystem::file_size (*i);
+ boost::uintmax_t to_do = boost::filesystem::file_size (*i);
ssh_scp_push_file (sc.scp, leaf.c_str(), to_do, S_IRUSR | S_IWUSR);
- FILE* f = fopen (filesystem::path (*i).string().c_str(), "rb");
+ FILE* f = fopen (boost::filesystem::path (*i).string().c_str(), "rb");
if (f == 0) {
throw NetworkError (String::compose ("Could not open %1 to send", *i));
}
int const t = min (to_do, buffer_size);
size_t const read = fread (buffer, 1, t, f);
if (read != size_t (t)) {
- throw ReadFileError (filesystem::path (*i).string());
+ throw ReadFileError (boost::filesystem::path (*i).string());
}
r = ssh_scp_write (sc.scp, buffer, t);
#include "config.h"
#include "subtitle.h"
-using namespace std;
-using namespace boost;
+using std::string;
+using std::stringstream;
+using std::multimap;
+using std::vector;
+using std::cerr;
+using boost::shared_ptr;
+using boost::algorithm::is_any_of;
+using boost::algorithm::split;
+using boost::thread;
+using boost::bind;
/** Create a server description from a string of metadata returned from as_metadata().
* @param v Metadata.
Server::worker_thread ()
{
while (1) {
- mutex::scoped_lock lock (_worker_mutex);
+ boost::mutex::scoped_lock lock (_worker_mutex);
while (_queue.empty ()) {
_worker_condition.wait (lock);
}
_worker_threads.push_back (new thread (bind (&Server::worker_thread, this)));
}
- asio::io_service io_service;
- asio::ip::tcp::acceptor acceptor (io_service, asio::ip::tcp::endpoint (asio::ip::tcp::v4(), Config::instance()->server_port ()));
+ boost::asio::io_service io_service;
+ boost::asio::ip::tcp::acceptor acceptor (io_service, boost::asio::ip::tcp::endpoint (boost::asio::ip::tcp::v4(), Config::instance()->server_port ()));
while (1) {
shared_ptr<Socket> socket (new Socket);
acceptor.accept (socket->socket ());
- mutex::scoped_lock lock (_worker_mutex);
+ boost::mutex::scoped_lock lock (_worker_mutex);
/* Wait until the queue has gone down a bit */
while (int (_queue.size()) >= num_threads * 2) {
#include "log.h"
#include "encoder_factory.h"
-using namespace std;
-using namespace boost;
+using std::string;
+using std::stringstream;
+using std::fixed;
+using std::setprecision;
+using boost::shared_ptr;
/** @param s Film to use.
* @param o Options.
*/
#include <iostream>
-#include <sigc++/signal.h>
+#include <boost/signals2.hpp>
#include "transcoder.h"
#include "encoder.h"
#include "decoder_factory.h"
-using namespace std;
-using namespace boost;
+using std::string;
+using boost::shared_ptr;
/** Construct a transcoder using a Decoder that we create and a supplied Encoder.
* @param f Film that we are transcoding.
{
assert (_encoder);
- _decoder->Video.connect (sigc::mem_fun (*e, &Encoder::process_video));
- _decoder->Audio.connect (sigc::mem_fun (*e, &Encoder::process_audio));
+ _decoder->Video.connect (bind (&Encoder::process_video, e, _1, _2, _3));
+ _decoder->Audio.connect (bind (&Encoder::process_audio, e, _1));
}
/** Run the decoder, passing its output to the encoder, until the decoder
: _work (_service)
{}
- template <class S>
- void emit (S signal) {
- _service.post (boost::bind (boost::ref (signal)));
+ template <typename T>
+ void emit (T f) {
+ _service.post (f);
}
void ui_idle () {
film_editor->setup_visibility ();
film_viewer->setup_visibility ();
- film_editor->FileChanged.connect (sigc::mem_fun (*this, &Frame::file_changed));
+ film_editor->FileChanged.connect (bind (&Frame::file_changed, this, _1));
if (film) {
file_changed (film->directory ());
} else {
#include "config.h"
#include "log.h"
-using namespace std;
-using namespace boost;
+using std::string;
+using std::cerr;
+using std::cout;
+using std::vector;
+using std::pair;
+using std::list;
+using boost::shared_ptr;
static void
help (string n)
#include "server_dialog.h"
using namespace std;
-using namespace boost;
+using boost::bind;
ConfigDialog::ConfigDialog (wxWindow* parent)
: wxDialog (parent, wxID_ANY, _("DVD-o-matic Configuration"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
ConfigDialog::edit_reference_filters_clicked (wxCommandEvent &)
{
FilterDialog* d = new FilterDialog (this, Config::instance()->reference_filters ());
- d->ActiveChanged.connect (sigc::mem_fun (*this, &ConfigDialog::reference_filters_changed));
+ d->ActiveChanged.connect (boost::bind (&ConfigDialog::reference_filters_changed, this, _1));
d->ShowModal ();
d->Destroy ();
}
#include <wx/wx.h>
#include <wx/spinctrl.h>
-#include <sigc++/sigc++.h>
+#include <boost/signals2.hpp>
#include "lib/trim_action.h"
class Film;
public:
DCPRangeDialog (wxWindow *, Film *);
- sigc::signal2<void, int, TrimAction> Changed;
+ boost::signals2::signal<void (int, TrimAction)> Changed;
private:
void whole_toggled (wxCommandEvent &);
set_things_sensitive (_film != 0);
if (_film) {
- _film->Changed.connect (sigc::mem_fun (*this, &FilmEditor::film_changed));
+ _film->Changed.connect (bind (&FilmEditor::film_changed, this, _1));
}
if (_film) {
FilmEditor::edit_filters_clicked (wxCommandEvent &)
{
FilterDialog* d = new FilterDialog (this, _film->filters());
- d->ActiveChanged.connect (sigc::mem_fun (*_film, &Film::set_filters));
+ d->ActiveChanged.connect (bind (&Film::set_filters, _film, _1));
d->ShowModal ();
d->Destroy ();
}
FilmEditor::change_dcp_range_clicked (wxCommandEvent &)
{
DCPRangeDialog* d = new DCPRangeDialog (this, _film);
- d->Changed.connect (sigc::mem_fun (*this, &FilmEditor::dcp_range_changed));
+ d->Changed.connect (bind (&FilmEditor::dcp_range_changed, this, _1, _2));
d->ShowModal ();
}
#include <wx/spinctrl.h>
#include <wx/filepicker.h>
#include <wx/collpane.h>
+#include <boost/signals2.hpp>
#include "lib/trim_action.h"
#include "lib/film.h"
void set_film (Film *);
void setup_visibility ();
- sigc::signal1<void, std::string> FileChanged;
+ boost::signals2::signal<void (std::string)> FileChanged;
private:
/* Handle changes to the view */
}
_list.set_headers_visible (false);
- _list.get_selection()->signal_changed().connect (sigc::mem_fun (*this, &FilmList::selection_changed));
+ _list.get_selection()->signal_changed().connect (bind (&FilmList::selection_changed, this));
}
Gtk::Widget&
#include "film_viewer.h"
#include "wx_util.h"
-using namespace std;
-using namespace boost;
+using std::string;
+using std::pair;
+using std::max;
+using boost::shared_ptr;
class ThumbPanel : public wxPanel
{
return;
}
- _film->Changed.connect (sigc::mem_fun (*this, &FilmViewer::film_changed));
+ _film->Changed.connect (bind (&FilmViewer::film_changed, this, _1));
film_changed (Film::CROP);
film_changed (Film::THUMBS);
setup_visibility ();
#include "filter_view.h"
using namespace std;
+using boost::bind;
FilterDialog::FilterDialog (wxWindow* parent, vector<Filter const *> const & f)
: wxDialog (parent, wxID_ANY, wxString (_("Filters")))
wxBoxSizer* sizer = new wxBoxSizer (wxVERTICAL);
sizer->Add (_filters, 1, wxEXPAND | wxALL, 6);
- _filters->ActiveChanged.connect (sigc::mem_fun (*this, &FilterDialog::active_changed));
+ _filters->ActiveChanged.connect (bind (&FilterDialog::active_changed, this));
wxSizer* buttons = CreateSeparatedButtonSizer (wxOK);
if (buttons) {
*/
#include <wx/wx.h>
+#include <boost/signals2.hpp>
class Film;
class FilterView;
public:
FilterDialog (wxWindow *, std::vector<Filter const *> const &);
- sigc::signal1<void, std::vector<Filter const *> > ActiveChanged;
+ boost::signals2::signal<void (std::vector<Filter const *>)> ActiveChanged;
private:
void active_changed ();
* @brief A panel to select FFmpeg filters.
*/
+#include <boost/signals2.hpp>
#include <vector>
#include <map>
-#include <sigc++/sigc++.h>
#include <wx/wx.h>
class Filter;
std::vector<Filter const *> active () const;
- sigc::signal0<void> ActiveChanged;
+ boost::signals2::signal<void()> ActiveChanged;
private:
void filter_toggled (wxCommandEvent &);
#include "job_manager_view.h"
#include "wx_util.h"
-using namespace std;
-using namespace boost;
+using std::string;
+using std::list;
+using boost::shared_ptr;
/** Must be called in the GUI thread */
JobManagerView::JobManagerView (wxWindow* parent)
#define BOOST_TEST_MODULE dvdomatic_test
#include <boost/test/unit_test.hpp>
-using namespace std;
-using namespace boost;
+using std::string;
+using std::list;
+using std::stringstream;
+using std::vector;
+using boost::shared_ptr;
+using boost::thread;
void
setup_test_config ()