diff options
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/cinema.h | 23 | ||||
| -rw-r--r-- | src/lib/film.cc | 15 | ||||
| -rw-r--r-- | src/lib/film.h | 8 | ||||
| -rw-r--r-- | src/lib/make_dcp_job.cc | 6 | ||||
| -rw-r--r-- | src/lib/util.cc | 3 |
5 files changed, 53 insertions, 2 deletions
diff --git a/src/lib/cinema.h b/src/lib/cinema.h new file mode 100644 index 000000000..232fc5ec8 --- /dev/null +++ b/src/lib/cinema.h @@ -0,0 +1,23 @@ +#include <libdcp/certificates.h> + +class Screen +{ +public: + Screen (std::string const & n) + : name (n) + {} + + std::string name; + libdcp::Certificate certificate; +}; + +class Cinema +{ +public: + Cinema (std::string const & n) + : name (n) + {} + + std::string name; + std::list<Screen> screens; +}; diff --git a/src/lib/film.cc b/src/lib/film.cc index 7daf825af..6e49dd4ea 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -99,6 +99,7 @@ Film::Film (string d, bool must_exist) , _with_subtitles (false) , _subtitle_offset (0) , _subtitle_scale (1) + , _encrypted (false) , _frames_per_second (0) , _dirty (false) { @@ -166,6 +167,7 @@ Film::Film (Film const & o) , _with_subtitles (o._with_subtitles) , _subtitle_offset (o._subtitle_offset) , _subtitle_scale (o._subtitle_scale) + , _encrypted (o._encrypted) , _audio_language (o._audio_language) , _subtitle_language (o._subtitle_language) , _territory (o._territory) @@ -420,6 +422,7 @@ Film::write_metadata () const f << "with_subtitles " << _with_subtitles << "\n"; f << "subtitle_offset " << _subtitle_offset << "\n"; f << "subtitle_scale " << _subtitle_scale << "\n"; + f << "encrypted " << _encrypted << "\n"; f << "audio_language " << _audio_language << "\n"; f << "subtitle_language " << _subtitle_language << "\n"; f << "territory " << _territory << "\n"; @@ -545,6 +548,8 @@ Film::read_metadata () _subtitle_offset = atoi (v.c_str ()); } else if (k == "subtitle_scale") { _subtitle_scale = atof (v.c_str ()); + } else if (k == "encrypted") { + _encrypted = (v == "1"); } else if (k == "audio_language") { _audio_language = v; } else if (k == "subtitle_language") { @@ -1191,6 +1196,16 @@ Film::set_subtitle_scale (float s) } void +Film::set_encrypted (bool e) +{ + { + boost::mutex::scoped_lock lm (_state_mutex); + _encrypted = e; + } + signal_changed (ENCRYPTED); +} + +void Film::set_audio_language (string l) { { diff --git a/src/lib/film.h b/src/lib/film.h index eb199784e..b2f57eac8 100644 --- a/src/lib/film.h +++ b/src/lib/film.h @@ -124,6 +124,7 @@ public: WITH_SUBTITLES, SUBTITLE_OFFSET, SUBTITLE_SCALE, + ENCRYPTED, DCI_METADATA, SIZE, LENGTH, @@ -250,6 +251,11 @@ public: return _subtitle_scale; } + bool encrypted () const { + boost::mutex::scoped_lock lm (_state_mutex); + return _encrypted; + } + std::string audio_language () const { boost::mutex::scoped_lock lm (_state_mutex); return _audio_language; @@ -351,6 +357,7 @@ public: void set_with_subtitles (bool); void set_subtitle_offset (int); void set_subtitle_scale (float); + void set_encrypted (bool); void set_audio_language (std::string); void set_subtitle_language (std::string); void set_territory (std::string); @@ -444,6 +451,7 @@ private: int _subtitle_offset; /** scale factor to apply to subtitles */ float _subtitle_scale; + bool _encrypted; /* DCI naming stuff */ std::string _audio_language; diff --git a/src/lib/make_dcp_job.cc b/src/lib/make_dcp_job.cc index 5272d6bad..e42018ad5 100644 --- a/src/lib/make_dcp_job.cc +++ b/src/lib/make_dcp_job.cc @@ -113,7 +113,8 @@ MakeDCPJob::run () dfr.frames_per_second, frames, _opt->out_size.width, - _opt->out_size.height + _opt->out_size.height, + _film->encrypted () ) ); @@ -131,7 +132,8 @@ MakeDCPJob::run () &dcp.Progress, dfr.frames_per_second, frames, - dcp_audio_channels (_film->audio_channels()) + dcp_audio_channels (_film->audio_channels()), + _film->encrypted() ) ); ascend (); diff --git a/src/lib/util.cc b/src/lib/util.cc index 66743250f..987c2b9e5 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -43,6 +43,7 @@ #include <magick/MagickCore.h> #include <magick/version.h> #include <libdcp/version.h> +#include <libdcp/util.h> extern "C" { #include <libavcodec/avcodec.h> #include <libavformat/avformat.h> @@ -230,6 +231,8 @@ seconds (struct timeval t) void dvdomatic_setup () { + libdcp::init (); + Format::setup_formats (); DCPContentType::setup_dcp_content_types (); Scaler::setup_scalers (); |
