Tidy up test film naming.
[dcpomatic.git] / src / lib / make_dcp_job.cc
index b42a38429ff2800c1e15a13509be08bd0743e2f4..fcfce4b07bccc6ada73799e79e2f68e8dc6064db 100644 (file)
@@ -44,7 +44,8 @@ using namespace boost;
  *  @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)
 {
        
 }
@@ -52,7 +53,7 @@ MakeDCPJob::MakeDCPJob (shared_ptr<const FilmState> s, shared_ptr<const Options>
 string
 MakeDCPJob::name () const
 {
-       return String::compose ("Make DCP for %1", _fs->name);
+       return String::compose ("Make DCP for %1", _fs->name());
 }
 
 string
@@ -70,7 +71,7 @@ MakeDCPJob::wav_path (libdcp::Channel c) const
 void
 MakeDCPJob::run ()
 {
-       string const dcp_path = _fs->dir (_fs->name);
+       string const dcp_path = _fs->dir (_fs->dcp_name());
 
        /* Remove any old DCP */
        filesystem::remove_all (dcp_path);
@@ -78,27 +79,30 @@ MakeDCPJob::run ()
        int frames = 0;
        switch (_fs->content_type ()) {
        case VIDEO:
-               frames = _fs->dcp_frames ? _fs->dcp_frames : _fs->length;
+               frames = _fs->dcp_length ();
                break;
        case STILL:
-               frames = _fs->still_duration * ImageMagickDecoder::static_frames_per_second ();
+               frames = _fs->still_duration() * ImageMagickDecoder::static_frames_per_second ();
                break;
        }
        
-       libdcp::DCP dcp (_fs->dir (_fs->name));
+       libdcp::DCP dcp (_fs->dir (_fs->dcp_name()));
        dcp.Progress.connect (sigc::mem_fun (*this, &MakeDCPJob::dcp_progress));
 
-       shared_ptr<libdcp::CPL> cpl (new libdcp::CPL (_fs->dir (_fs->name), _fs->name, _fs->dcp_content_type->libdcp_kind (), frames, rint (_fs->frames_per_second)));
+       shared_ptr<libdcp::CPL> cpl (
+               new libdcp::CPL (_fs->dir (_fs->dcp_name()), _fs->dcp_name(), _fs->dcp_content_type()->libdcp_kind (), frames, rint (_fs->frames_per_second()))
+               );
+       
        dcp.add_cpl (cpl);
 
        descend (0.9);
        shared_ptr<libdcp::MonoPictureAsset> pa (
                new libdcp::MonoPictureAsset (
                        sigc::mem_fun (*this, &MakeDCPJob::j2c_path),
-                       _fs->dir (_fs->name),
+                       _fs->dir (_fs->dcp_name()),
                        "video.mxf",
                        &dcp.Progress,
-                       rint (_fs->frames_per_second),
+                       rint (_fs->frames_per_second()),
                        frames,
                        _opt->out_size.width,
                        _opt->out_size.height
@@ -109,17 +113,17 @@ MakeDCPJob::run ()
 
        shared_ptr<libdcp::SoundAsset> sa;
 
-       if (_fs->audio_channels > 0) {
+       if (_fs->audio_channels() > 0) {
                descend (0.1);
                sa.reset (
                        new libdcp::SoundAsset (
                                sigc::mem_fun (*this, &MakeDCPJob::wav_path),
-                               _fs->dir (_fs->name),
+                               _fs->dir (_fs->dcp_name()),
                                "audio.mxf",
                                &dcp.Progress,
-                               rint (_fs->frames_per_second),
+                               rint (_fs->frames_per_second()),
                                frames,
-                               _fs->audio_channels
+                               _fs->audio_channels()
                                )
                        );
                ascend ();