Merge master.
[dcpomatic.git] / src / lib / ab_transcode_job.cc
index 9e453d85dedd63e58519833da0d59c5cb161ea11..4ffdd9af6b815cbe6c572d1e72a336e82ce0445b 100644 (file)
 
 #include <stdexcept>
 #include "ab_transcode_job.h"
-#include "j2k_wav_encoder.h"
 #include "film.h"
 #include "format.h"
 #include "filter.h"
 #include "ab_transcoder.h"
-#include "encoder_factory.h"
 #include "config.h"
+#include "encoder.h"
 
-using namespace std;
-using namespace boost;
+#include "i18n.h"
+
+using std::string;
+using boost::shared_ptr;
 
 /** @param f Film to compare.
- *  @param o Options.
+ *  @param o Decode options.
  */
-ABTranscodeJob::ABTranscodeJob (shared_ptr<Film> f, shared_ptr<const Options> o, shared_ptr<Job> req)
-       : Job (f, req)
-       , _opt (o)
+ABTranscodeJob::ABTranscodeJob (shared_ptr<Film> f, DecodeOptions o)
+       : Job (f)
+       , _decode_opt (o)
 {
        _film_b.reset (new Film (*_film));
        _film_b->set_scaler (Config::instance()->reference_scaler ());
@@ -45,7 +46,7 @@ ABTranscodeJob::ABTranscodeJob (shared_ptr<Film> f, shared_ptr<const Options> o,
 string
 ABTranscodeJob::name () const
 {
-       return String::compose ("A/B transcode %1", _film->name());
+       return String::compose (_("A/B transcode %1"), _film->name());
 }
 
 void
@@ -53,7 +54,7 @@ ABTranscodeJob::run ()
 {
        try {
                /* _film_b is the one with reference filters */
-               ABTranscoder w (_film_b, _film, _opt, this, encoder_factory (_film, _opt));
+               ABTranscoder w (_film_b, _film, _decode_opt, this, shared_ptr<Encoder> (new Encoder (_film)));
                w.go ();
                set_progress (1);
                set_state (FINISHED_OK);