diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-05-04 23:30:23 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-05-06 20:15:16 +0200 |
| commit | 4e62980064496060af5a8c6ecab26ddf218aa63a (patch) | |
| tree | f3cc59c341866280e7998e7599039054a880d6b0 /src/lib/kdm_with_metadata.cc | |
| parent | ca56871d4860b8ead384c410fe374c2fa993f88f (diff) | |
Remove Screen pointer from KDMWithMetadata, preferring to
add metadata to a dcp::NameFormat::Map earlier in the
call stack.
Diffstat (limited to 'src/lib/kdm_with_metadata.cc')
| -rw-r--r-- | src/lib/kdm_with_metadata.cc | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/lib/kdm_with_metadata.cc b/src/lib/kdm_with_metadata.cc index 674554f7e..012172a8e 100644 --- a/src/lib/kdm_with_metadata.cc +++ b/src/lib/kdm_with_metadata.cc @@ -28,6 +28,7 @@ using std::string; using std::cout; using std::list; using boost::shared_ptr; +using boost::optional; int write_files ( @@ -56,8 +57,6 @@ write_files ( /* Write KDMs to the specified directory */ BOOST_FOREACH (KDMWithMetadataPtr i, screen_kdms) { - name_values['c'] = i->screen->cinema ? i->screen->cinema->name : ""; - name_values['s'] = i->screen->name; name_values['i'] = i->kdm_id (); boost::filesystem::path out = directory / careful_string_filter(name_format.get(name_values, ".xml")); if (!boost::filesystem::exists (out) || confirm_overwrite (out)) { @@ -68,3 +67,15 @@ write_files ( return written; } + + +optional<string> +KDMWithMetadata::get (char k) const +{ + dcp::NameFormat::Map::const_iterator i = _name_values.find (k); + if (i == _name_values.end()) { + return optional<string>(); + } + + return i->second; +} |
