summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-07-18 00:29:00 +0100
committerCarl Hetherington <cth@carlh.net>2012-07-18 00:29:00 +0100
commita0abbfbb61435d4c70066f220c31ee393e79c6b7 (patch)
treee62eeda57db8fa2212b30c89cde7ed30c395174e /src/lib
parent166d9713a4bd6ce8fedfcc82189ba34943e9a2a5 (diff)
Use new functor API in libdcp.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/make_dcp_job.cc32
-rw-r--r--src/lib/make_dcp_job.h2
2 files changed, 19 insertions, 15 deletions
diff --git a/src/lib/make_dcp_job.cc b/src/lib/make_dcp_job.cc
index b0b8a2a1a..3de5e8d5d 100644
--- a/src/lib/make_dcp_job.cc
+++ b/src/lib/make_dcp_job.cc
@@ -53,6 +53,18 @@ MakeDCPJob::name () const
return s.str ();
}
+string
+MakeDCPJob::j2c_path (int f) const
+{
+ return _opt->frame_out_path (f, false);
+}
+
+string
+MakeDCPJob::wav_path (libdcp::Channel c) const
+{
+ return _opt->multichannel_audio_out_path (int (c), false);
+}
+
void
MakeDCPJob::run ()
{
@@ -61,27 +73,17 @@ MakeDCPJob::run ()
/* Remove any old DCP */
filesystem::remove_all (dcp_path);
- libdcp::DCP dcp (_fs->dir (_fs->name), _fs->name, _fs->dcp_content_type->libdcp_type (), rint (_fs->frames_per_second), _fs->length);
+ int const frames = _fs->dcp_frames ? _fs->dcp_frames : _fs->length;
+ libdcp::DCP dcp (_fs->dir (_fs->name), _fs->name, _fs->dcp_content_type->libdcp_type (), rint (_fs->frames_per_second), frames);
dcp.Progress.connect (sigc::mem_fun (*this, &MakeDCPJob::dcp_progress));
- list<string> j2cs;
- int f = _fs->dcp_frames ? _fs->dcp_frames : _fs->length;
- for (int i = 0; i < f; ++i) {
- j2cs.push_back (_opt->frame_out_path (i, false));
- }
-
descend (0.9);
- dcp.add_picture_asset (j2cs, _opt->out_size.width, _opt->out_size.height);
+ dcp.add_picture_asset (sigc::mem_fun (*this, &MakeDCPJob::j2c_path), _opt->out_size.width, _opt->out_size.height);
ascend ();
- list<string> wavs;
- for (int i = 0; i < _fs->audio_channels; ++i) {
- wavs.push_back (_opt->multichannel_audio_out_path (i, false));
- }
-
- if (!wavs.empty ()) {
+ if (_fs->audio_channels > 0) {
descend (0.1);
- dcp.add_sound_asset (wavs);
+ dcp.add_sound_asset (sigc::mem_fun (*this, &MakeDCPJob::wav_path), _fs->audio_channels);
ascend ();
}
diff --git a/src/lib/make_dcp_job.h b/src/lib/make_dcp_job.h
index fc7da6c89..677bed424 100644
--- a/src/lib/make_dcp_job.h
+++ b/src/lib/make_dcp_job.h
@@ -36,5 +36,7 @@ public:
private:
void dcp_progress (float);
+ std::string j2c_path (int) const;
+ std::string wav_path (libdcp::Channel) const;
};