diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-12-04 23:40:39 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-12-04 23:40:39 +0000 |
| commit | 47d5204ee41d891c5ad9a204a2b1fa10ed2e7658 (patch) | |
| tree | 8e2abd982a1ed6cb34a24a82bd04cf7d190a7be3 /src/lib | |
| parent | a3241f40b061480a0907699a5857075388216643 (diff) | |
Make signatures optional (#273).
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/film.cc | 10 | ||||
| -rw-r--r-- | src/lib/film.h | 8 | ||||
| -rw-r--r-- | src/lib/writer.cc | 2 |
3 files changed, 19 insertions, 1 deletions
diff --git a/src/lib/film.cc b/src/lib/film.cc index 71836f254..5946d5bec 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -96,6 +96,7 @@ Film::Film (boost::filesystem::path dir) , _resolution (RESOLUTION_2K) , _scaler (Scaler::from_id ("bicubic")) , _with_subtitles (false) + , _signed (true) , _encrypted (false) , _j2k_bandwidth (Config::instance()->default_j2k_bandwidth ()) , _dci_metadata (Config::instance()->default_dci_metadata ()) @@ -351,6 +352,7 @@ Film::write_metadata () const root->add_child("ThreeD")->add_child_text (_three_d ? "1" : "0"); root->add_child("SequenceVideo")->add_child_text (_sequence_video ? "1" : "0"); root->add_child("Interop")->add_child_text (_interop ? "1" : "0"); + root->add_child("Signed")->add_child_text (_signed ? "1" : "0"); root->add_child("Encrypted")->add_child_text (_encrypted ? "1" : "0"); root->add_child("Key")->add_child_text (_key.hex ()); _playlist->as_xml (root->add_child ("Playlist")); @@ -399,6 +401,7 @@ Film::read_metadata () _dci_metadata = DCIMetadata (f.node_child ("DCIMetadata")); _video_frame_rate = f.number_child<int> ("VideoFrameRate"); _dci_date = boost::gregorian::from_undelimited_string (f.string_child ("DCIDate")); + _signed = f.optional_bool_child("Signed").get_value_or (true); _encrypted = f.bool_child ("Encrypted"); _audio_channels = f.number_child<int> ("AudioChannels"); _sequence_video = f.bool_child ("SequenceVideo"); @@ -763,6 +766,13 @@ Film::make_player () const } void +Film::set_signed (bool s) +{ + _signed = s; + signal_changed (SIGNED); +} + +void Film::set_encrypted (bool e) { _encrypted = e; diff --git a/src/lib/film.h b/src/lib/film.h index 6bd04572b..4b07f84a9 100644 --- a/src/lib/film.h +++ b/src/lib/film.h @@ -149,6 +149,7 @@ public: RESOLUTION, SCALER, WITH_SUBTITLES, + SIGNED, ENCRYPTED, J2K_BANDWIDTH, DCI_METADATA, @@ -195,6 +196,11 @@ public: return _with_subtitles; } + /* signed is a reserved word */ + bool is_signed () const { + return _signed; + } + bool encrypted () const { return _encrypted; } @@ -244,6 +250,7 @@ public: void set_resolution (Resolution); void set_scaler (Scaler const *); void set_with_subtitles (bool); + void set_signed (bool); void set_encrypted (bool); void set_j2k_bandwidth (int); void set_dci_metadata (DCIMetadata); @@ -295,6 +302,7 @@ private: Scaler const * _scaler; /** True if subtitles should be shown for this film */ bool _with_subtitles; + bool _signed; bool _encrypted; /** bandwidth for J2K files in bits per second */ int _j2k_bandwidth; diff --git a/src/lib/writer.cc b/src/lib/writer.cc index 60b2a47ab..4c9749d89 100644 --- a/src/lib/writer.cc +++ b/src/lib/writer.cc @@ -400,7 +400,7 @@ Writer::finish () libdcp::XMLMetadata meta = Config::instance()->dcp_metadata (); meta.set_issue_date_now (); - dcp.write_xml (_film->interop (), meta, make_signer ()); + dcp.write_xml (_film->interop (), meta, _film->is_signed() ? make_signer () : shared_ptr<const libdcp::Signer> ()); _film->log()->log (String::compose (N_("Wrote %1 FULL, %2 FAKE, %3 REPEAT; %4 pushed to disk"), _full_written, _fake_written, _repeat_written, _pushed_to_disk)); } |
