* @Param l A log that we can write to.
*/
ABTranscodeJob::ABTranscodeJob (shared_ptr<const FilmState> s, shared_ptr<const Options> o, Log* l, shared_ptr<Job> req)
- : Job (s, o, l, req)
+ : Job (s, l, req)
+ , _opt (o)
{
_fs_b.reset (new FilmState (*_fs));
_fs_b->set_scaler (Config::instance()->reference_scaler ());
void run ();
private:
+ boost::shared_ptr<const Options> _opt;
+
/** Copy of our FilmState with filters removed and scaler set back to bicubic;
* this is the `reference' (left-half-frame) state.
*/
using namespace boost;
CheckHashesJob::CheckHashesJob (shared_ptr<const FilmState> s, shared_ptr<const Options> o, Log* l, shared_ptr<Job> req)
- : Job (s, o, l, req)
+ : Job (s, l, req)
+ , _opt (o)
, _bad (0)
{
std::string status () const;
private:
+ boost::shared_ptr<const Options> _opt;
int _bad;
};
* @param l Log that we can write to.
*/
CopyFromDVDJob::CopyFromDVDJob (shared_ptr<const FilmState> fs, Log* l, shared_ptr<Job> req)
- : Job (fs, shared_ptr<Options> (), l, req)
+ : Job (fs, l, req)
{
}
using namespace boost;
ExamineContentJob::ExamineContentJob (shared_ptr<const FilmState> fs, Log* l, shared_ptr<Job> req)
- : Job (fs, shared_ptr<Options> (), l, req)
+ : Job (fs, l, req)
{
}
using namespace boost;
/** @param s FilmState for the film that we are operating on.
- * @param o Options.
* @param l A log that we can write to.
*/
-Job::Job (shared_ptr<const FilmState> s, shared_ptr<const Options> o, Log* l, shared_ptr<Job> req)
+Job::Job (shared_ptr<const FilmState> s, Log* l, shared_ptr<Job> req)
: _fs (s)
- , _opt (o)
, _log (l)
, _required (req)
, _state (NEW)
class Job : public boost::enable_shared_from_this<Job>
{
public:
- Job (boost::shared_ptr<const FilmState> s, boost::shared_ptr<const Options> o, Log* l, boost::shared_ptr<Job> req);
+ Job (boost::shared_ptr<const FilmState> s, Log* l, boost::shared_ptr<Job> req);
/** @return user-readable name of this job */
virtual std::string name () const = 0;
/** FilmState for this job */
boost::shared_ptr<const FilmState> _fs;
- /** options in use for this job */
- boost::shared_ptr<const Options> _opt;
/** a log that this job can write to */
Log* _log;
* @param l Log.
*/
MakeDCPJob::MakeDCPJob (shared_ptr<const FilmState> s, shared_ptr<const Options> o, Log* l, shared_ptr<Job> req)
- : Job (s, o, l, req)
+ : Job (s, l, req)
+ , _opt (o)
{
}
void dcp_progress (float);
std::string j2c_path (int) const;
std::string wav_path (libdcp::Channel) const;
+
+ boost::shared_ptr<const Options> _opt;
};
SCPDCPJob::SCPDCPJob (shared_ptr<const FilmState> s, Log* l, shared_ptr<Job> req)
- : Job (s, shared_ptr<const Options> (), l, req)
+ : Job (s, l, req)
, _status ("Waiting")
{
* @param l A log that we can write to.
*/
TranscodeJob::TranscodeJob (shared_ptr<const FilmState> s, shared_ptr<const Options> o, Log* l, shared_ptr<Job> req)
- : Job (s, o, l, req)
+ : Job (s, l, req)
+ , _opt (o)
{
}
int remaining_time () const;
private:
+ boost::shared_ptr<const Options> _opt;
boost::shared_ptr<Encoder> _encoder;
};
class TestJob : public Job
{
public:
- TestJob (shared_ptr<const FilmState> s, shared_ptr<const Options> o, Log* l, shared_ptr<Job> req)
- : Job (s, o, l, req)
+ TestJob (shared_ptr<const FilmState> s, Log* l, shared_ptr<Job> req)
+ : Job (s, l, req)
{
}
BOOST_AUTO_TEST_CASE (job_manager_test)
{
shared_ptr<const FilmState> s;
- shared_ptr<const Options> o;
FileLog log ("build/test/job_manager_test.log");
/* Single job, no dependency */
- shared_ptr<TestJob> a (new TestJob (s, o, &log, shared_ptr<Job> ()));
+ shared_ptr<TestJob> a (new TestJob (s, &log, shared_ptr<Job> ()));
JobManager::instance()->add (a);
dvdomatic_sleep (1);
BOOST_CHECK_EQUAL (a->finished_ok(), true);
/* Two jobs, dependency */
- a.reset (new TestJob (s, o, &log, shared_ptr<Job> ()));
- shared_ptr<TestJob> b (new TestJob (s, o, &log, a));
+ a.reset (new TestJob (s, &log, shared_ptr<Job> ()));
+ shared_ptr<TestJob> b (new TestJob (s, &log, a));
JobManager::instance()->add (a);
JobManager::instance()->add (b);
BOOST_CHECK_EQUAL (b->finished_ok(), true);
/* Two jobs, dependency, first fails */
- a.reset (new TestJob (s, o, &log, shared_ptr<Job> ()));
- b.reset (new TestJob (s, o, &log, a));
+ a.reset (new TestJob (s, &log, shared_ptr<Job> ()));
+ b.reset (new TestJob (s, &log, a));
JobManager::instance()->add (a);
JobManager::instance()->add (b);