diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-01-05 23:34:21 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-01-05 23:34:21 +0000 |
| commit | 49936cb957f0d57310f05a7b17c7ab52c95e94d4 (patch) | |
| tree | 59c22abf44a5c180af4459b8513a8f6c11b418f0 /src/lib | |
| parent | 881c8455d01de5c785c01f7dc55fef0aede2f3b2 (diff) | |
Basic encryption UI.
Diffstat (limited to 'src/lib')
| -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 | 2 |
4 files changed, 29 insertions, 2 deletions
diff --git a/src/lib/film.cc b/src/lib/film.cc index 1abf8e91f..cae4f5f93 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) @@ -418,6 +420,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"; @@ -543,6 +546,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") { @@ -1189,6 +1194,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 b8a824233..eda2060b8 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 4605d1724..a8b80fd67 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, - _film->audio_channels() + _film->audio_channels(), + _film->encrypted() ) ); ascend (); diff --git a/src/lib/util.cc b/src/lib/util.cc index 45965385c..424c736c2 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -230,6 +230,8 @@ seconds (struct timeval t) void dvdomatic_setup () { + libdcp_setup (); + Format::setup_formats (); DCPContentType::setup_dcp_content_types (); Scaler::setup_scalers (); |
