diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-12-23 00:23:19 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-12-23 00:23:19 +0000 |
| commit | 03dd6e03f5ee261b9c1ed9328ad2762ef3b62057 (patch) | |
| tree | b33e3b379ea72bcaa4417cb1b42b68753f48b7ec /src/lib | |
| parent | a618339514026c5f9129a9f786289952cdbd3cdf (diff) | |
Add a stored list of DKDMs to the creator rather than just a load button (#767).
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/config.cc | 10 | ||||
| -rw-r--r-- | src/lib/config.h | 12 |
2 files changed, 22 insertions, 0 deletions
diff --git a/src/lib/config.cc b/src/lib/config.cc index b9e25e37a..54d42a1b9 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -284,6 +284,12 @@ Config::read () } else { _decryption_chain = create_certificate_chain (); } + + list<cxml::NodePtr> dkdm = f.node_children ("DKDM"); + BOOST_FOREACH (cxml::NodePtr i, f.node_children ("DKDM")) { + _dkdms.push_back (dcp::EncryptedKDM (i->content ())); + } + } /** @return Filename to write configuration to */ @@ -416,6 +422,10 @@ Config::write () const root->add_child("History")->add_child_text (i->string ()); } + BOOST_FOREACH (dcp::EncryptedKDM i, _dkdms) { + root->add_child("DKDM")->add_child_text (i.as_xml ()); + } + try { doc.write_to_file_formatted (file().string ()); } catch (xmlpp::exception& e) { diff --git a/src/lib/config.h b/src/lib/config.h index 664020a2a..6b1f3fb87 100644 --- a/src/lib/config.h +++ b/src/lib/config.h @@ -27,6 +27,7 @@ #include "isdcf_metadata.h" #include "types.h" #include <dcp/certificate_chain.h> +#include <dcp/encrypted_kdm.h> #include <boost/shared_ptr.hpp> #include <boost/signals2.hpp> #include <boost/filesystem.hpp> @@ -244,6 +245,10 @@ public: return _history; } + std::vector<dcp::EncryptedKDM> dkdms () const { + return _dkdms; + } + /** @param n New number of local encoding threads */ void set_num_local_encoding_threads (int n) { maybe_set (_num_local_encoding_threads, n); @@ -432,6 +437,12 @@ public: } #endif + void set_dkdms (std::vector<dcp::EncryptedKDM> dkdms) + { + _dkdms = dkdms; + changed (); + } + void clear_history () { _history.clear (); changed (); @@ -531,6 +542,7 @@ private: bool _win32_console; #endif std::vector<boost::filesystem::path> _history; + std::vector<dcp::EncryptedKDM> _dkdms; /** Singleton instance, or 0 */ static Config* _instance; |
