projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rename some variables and re-implement collect().
[dcpomatic.git]
/
src
/
tools
/
dcpomatic_kdm_cli.cc
diff --git
a/src/tools/dcpomatic_kdm_cli.cc
b/src/tools/dcpomatic_kdm_cli.cc
index 1aad31cb534d7d1fd656bad295b55de3afc95110..ec49723a8fcdf71892837da62d4d13de5fab5ae8 100644
(file)
--- a/
src/tools/dcpomatic_kdm_cli.cc
+++ b/
src/tools/dcpomatic_kdm_cli.cc
@@
-25,7
+25,6
@@
#include "lib/film.h"
#include "lib/cinema.h"
#include "lib/kdm_with_metadata.h"
#include "lib/film.h"
#include "lib/cinema.h"
#include "lib/kdm_with_metadata.h"
-#include "lib/cinema_kdms.h"
#include "lib/config.h"
#include "lib/exceptions.h"
#include "lib/emailer.h"
#include "lib/config.h"
#include "lib/exceptions.h"
#include "lib/emailer.h"
@@
-130,7
+129,7
@@
always_overwrite ()
void
write_files (
void
write_files (
- list<
shared_ptr<KDMWithMetadata> > screen_
kdms,
+ list<
KDMWithMetadataPtr>
kdms,
bool zip,
boost::filesystem::path output,
dcp::NameFormat container_name_format,
bool zip,
boost::filesystem::path output,
dcp::NameFormat container_name_format,
@@
-140,8
+139,8
@@
write_files (
)
{
if (zip) {
)
{
if (zip) {
- int const N =
CinemaKDMs::
write_zip_files (
-
CinemaKDMs::collect (screen_
kdms),
+ int const N = write_zip_files (
+
collect (
kdms),
output,
container_name_format,
filename_format,
output,
container_name_format,
filename_format,
@@
-153,8
+152,8
@@
write_files (
cout << "Wrote " << N << " ZIP files to " << output << "\n";
}
} else {
cout << "Wrote " << N << " ZIP files to " << output << "\n";
}
} else {
- int const N =
KDMWithMetadata::
write_files (
-
screen_
kdms, output, filename_format, values,
+ int const N = write_files (
+ kdms, output, filename_format, values,
bind (&always_overwrite)
);
bind (&always_overwrite)
);
@@
-229,7
+228,7
@@
from_film (
values['e'] = dcp::LocalTime(valid_to).date() + " " + dcp::LocalTime(valid_to).time_of_day(true, false);
try {
values['e'] = dcp::LocalTime(valid_to).date() + " " + dcp::LocalTime(valid_to).time_of_day(true, false);
try {
- list<
shared_ptr<KDMWithMetadata>
> kdms;
+ list<
KDMWithMetadataPtr
> kdms;
BOOST_FOREACH (shared_ptr<Screen> i, screens) {
if (i->recipient) {
BOOST_FOREACH (shared_ptr<Screen> i, screens) {
if (i->recipient) {
@@
-244,7
+243,11
@@
from_film (
disable_forensic_marking_audio
);
disable_forensic_marking_audio
);
- kdms.push_back (shared_ptr<KDMWithMetadata>(new DCPKDMWithMetadata(i, kdm)));
+ dcp::NameFormat::Map name_values;
+ name_values['c'] = i->cinema->name;
+ name_values['s'] = i->name;
+
+ kdms.push_back (KDMWithMetadataPtr(new DCPKDMWithMetadata(name_values, i->cinema, kdm)));
}
}
}
}
@@
-345,16
+348,21
@@
from_dkdm (
values['e'] = dcp::LocalTime(valid_to).date() + " " + dcp::LocalTime(valid_to).time_of_day(true, false);
try {
values['e'] = dcp::LocalTime(valid_to).date() + " " + dcp::LocalTime(valid_to).time_of_day(true, false);
try {
- list<
shared_ptr<KDMWithMetadata> > screen_
kdms;
+ list<
KDMWithMetadataPtr>
kdms;
BOOST_FOREACH (shared_ptr<Screen> i, screens) {
if (!i->recipient) {
continue;
}
BOOST_FOREACH (shared_ptr<Screen> i, screens) {
if (!i->recipient) {
continue;
}
- screen_kdms.push_back (
- shared_ptr<KDMWithMetadata>(
+ dcp::NameFormat::Map name_values;
+ name_values['c'] = i->cinema->name;
+ name_values['s'] = i->name;
+
+ kdms.push_back (
+ KDMWithMetadataPtr(
new DCPKDMWithMetadata(
new DCPKDMWithMetadata(
- i,
+ name_values,
+ i->cinema,
kdm_from_dkdm(
dkdm,
i->recipient.get(),
kdm_from_dkdm(
dkdm,
i->recipient.get(),
@@
-369,7
+377,7
@@
from_dkdm (
)
);
}
)
);
}
- write_files (
screen_
kdms, zip, output, container_name_format, filename_format, values, verbose);
+ write_files (kdms, zip, output, container_name_format, filename_format, values, verbose);
} catch (FileError& e) {
cerr << program_name << ": " << e.what() << " (" << e.file().string() << ")\n";
exit (EXIT_FAILURE);
} catch (FileError& e) {
cerr << program_name << ": " << e.what() << " (" << e.file().string() << ")\n";
exit (EXIT_FAILURE);