projects
/
dcpomatic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
4e62980
)
Pull methods out of CinemaKDMs.
author
Carl Hetherington
<cth@carlh.net>
Mon, 4 May 2020 21:37:22 +0000
(23:37 +0200)
committer
Carl Hetherington
<cth@carlh.net>
Wed, 6 May 2020 18:15:26 +0000
(20:15 +0200)
src/lib/cinema_kdms.cc
patch
|
blob
|
history
src/lib/cinema_kdms.h
patch
|
blob
|
history
src/lib/send_kdm_email_job.cc
patch
|
blob
|
history
src/tools/dcpomatic_kdm_cli.cc
patch
|
blob
|
history
src/wx/kdm_output_panel.cc
patch
|
blob
|
history
diff --git
a/src/lib/cinema_kdms.cc
b/src/lib/cinema_kdms.cc
index 56b76d3f9ecdb5e9264647c7ce638e28384645ea..d96a95d7f7a96ede71df6e53879a089a406db35b 100644
(file)
--- a/
src/lib/cinema_kdms.cc
+++ b/
src/lib/cinema_kdms.cc
@@
-43,13
+43,13
@@
using boost::function;
using boost::optional;
void
using boost::optional;
void
-CinemaKDMs::make_zip_file (boost::filesystem::path zip_file, dcp::NameFormat name_format, dcp::NameFormat::Map name_values) const
+make_zip_file (CinemaKDMs kdms, boost::filesystem::path zip_file, dcp::NameFormat name_format, dcp::NameFormat::Map name_values)
{
Zipper zipper (zip_file);
{
Zipper zipper (zip_file);
- name_values['c'] = cinema->name;
+ name_values['c'] =
kdms.
cinema->name;
- BOOST_FOREACH (KDMWithMetadataPtr i, screen_kdms) {
+ BOOST_FOREACH (KDMWithMetadataPtr i,
kdms.
screen_kdms) {
name_values['i'] = i->kdm_id ();
string const name = careful_string_filter(name_format.get(name_values, ".xml"));
zipper.add (name, i->kdm_as_xml());
name_values['i'] = i->kdm_id ();
string const name = careful_string_filter(name_format.get(name_values, ".xml"));
zipper.add (name, i->kdm_as_xml());
@@
-62,7
+62,7
@@
CinemaKDMs::make_zip_file (boost::filesystem::path zip_file, dcp::NameFormat nam
* CinemaKDM contains the KDMs for its cinema.
*/
list<CinemaKDMs>
* CinemaKDM contains the KDMs for its cinema.
*/
list<CinemaKDMs>
-
CinemaKDMs::
collect (list<KDMWithMetadataPtr> screen_kdms)
+collect (list<KDMWithMetadataPtr> screen_kdms)
{
list<CinemaKDMs> cinema_kdms;
{
list<CinemaKDMs> cinema_kdms;
@@
-98,7
+98,7
@@
CinemaKDMs::collect (list<KDMWithMetadataPtr> screen_kdms)
/** Write one directory per cinema into another directory */
int
/** Write one directory per cinema into another directory */
int
-
CinemaKDMs::
write_directories (
+write_directories (
list<CinemaKDMs> cinema_kdms,
boost::filesystem::path directory,
dcp::NameFormat container_name_format,
list<CinemaKDMs> cinema_kdms,
boost::filesystem::path directory,
dcp::NameFormat container_name_format,
@@
-128,7
+128,7
@@
CinemaKDMs::write_directories (
/** Write one ZIP file per cinema into a directory */
int
/** Write one ZIP file per cinema into a directory */
int
-
CinemaKDMs::
write_zip_files (
+write_zip_files (
list<CinemaKDMs> cinema_kdms,
boost::filesystem::path directory,
dcp::NameFormat container_name_format,
list<CinemaKDMs> cinema_kdms,
boost::filesystem::path directory,
dcp::NameFormat container_name_format,
@@
-151,7
+151,7
@@
CinemaKDMs::write_zip_files (
/* Creating a new zip file over an existing one is an error */
boost::filesystem::remove (path);
}
/* Creating a new zip file over an existing one is an error */
boost::filesystem::remove (path);
}
-
i.make_zip_file (
path, filename_format, name_values);
+
make_zip_file (i,
path, filename_format, name_values);
written += i.screen_kdms.size();
}
}
written += i.screen_kdms.size();
}
}
@@
-167,7
+167,7
@@
CinemaKDMs::write_zip_files (
* @param cpl_name Name of the CPL that the KDMs are for.
*/
void
* @param cpl_name Name of the CPL that the KDMs are for.
*/
void
-
CinemaKDMs::
email (
+email (
list<CinemaKDMs> cinema_kdms,
dcp::NameFormat container_name_format,
dcp::NameFormat filename_format,
list<CinemaKDMs> cinema_kdms,
dcp::NameFormat container_name_format,
dcp::NameFormat filename_format,
@@
-195,7
+195,7
@@
CinemaKDMs::email (
boost::filesystem::path zip_file = boost::filesystem::temp_directory_path() / boost::filesystem::unique_path();
boost::filesystem::create_directories (zip_file);
zip_file /= container_name_format.get(name_values, ".zip");
boost::filesystem::path zip_file = boost::filesystem::temp_directory_path() / boost::filesystem::unique_path();
boost::filesystem::create_directories (zip_file);
zip_file /= container_name_format.get(name_values, ".zip");
-
i.make_zip_file (
zip_file, filename_format, name_values);
+
make_zip_file (i,
zip_file, filename_format, name_values);
string subject = config->kdm_subject();
boost::algorithm::replace_all (subject, "$CPL_NAME", cpl_name);
string subject = config->kdm_subject();
boost::algorithm::replace_all (subject, "$CPL_NAME", cpl_name);
diff --git
a/src/lib/cinema_kdms.h
b/src/lib/cinema_kdms.h
index 91867039731bf56178f621af4e5fd2d2234f70e2..592bec9233cee9bb2c88f46a6b552f6910f40dae 100644
(file)
--- a/
src/lib/cinema_kdms.h
+++ b/
src/lib/cinema_kdms.h
@@
-27,11
+27,15
@@
class Log;
class CinemaKDMs
{
public:
class CinemaKDMs
{
public:
- void make_zip_file (boost::filesystem::path zip_file, dcp::NameFormat name_format, dcp::NameFormat::Map name_values) const;
+ boost::shared_ptr<Cinema> cinema;
+ std::list<KDMWithMetadataPtr > screen_kdms;
+};
+
+void make_zip_file (CinemaKDMs kdms, boost::filesystem::path zip_file, dcp::NameFormat name_format, dcp::NameFormat::Map name_values);
-
static
std::list<CinemaKDMs> collect (std::list<KDMWithMetadataPtr > kdms);
+std::list<CinemaKDMs> collect (std::list<KDMWithMetadataPtr > kdms);
-
static
int write_directories (
+int write_directories (
std::list<CinemaKDMs> cinema_kdms,
boost::filesystem::path directory,
dcp::NameFormat container_name_format,
std::list<CinemaKDMs> cinema_kdms,
boost::filesystem::path directory,
dcp::NameFormat container_name_format,
@@
-40,7
+44,7
@@
public:
boost::function<bool (boost::filesystem::path)> confirm_overwrite
);
boost::function<bool (boost::filesystem::path)> confirm_overwrite
);
-
static
int write_zip_files (
+int write_zip_files (
std::list<CinemaKDMs> cinema_kdms,
boost::filesystem::path directory,
dcp::NameFormat container_name_format,
std::list<CinemaKDMs> cinema_kdms,
boost::filesystem::path directory,
dcp::NameFormat container_name_format,
@@
-49,7
+53,7
@@
public:
boost::function<bool (boost::filesystem::path)> confirm_overwrite
);
boost::function<bool (boost::filesystem::path)> confirm_overwrite
);
-
static
void email (
+void email (
std::list<CinemaKDMs> cinema_kdms,
dcp::NameFormat container_name_format,
dcp::NameFormat filename_format,
std::list<CinemaKDMs> cinema_kdms,
dcp::NameFormat container_name_format,
dcp::NameFormat filename_format,
@@
-57,6
+61,3
@@
public:
std::string cpl_name
);
std::string cpl_name
);
- boost::shared_ptr<Cinema> cinema;
- std::list<KDMWithMetadataPtr > screen_kdms;
-};
diff --git
a/src/lib/send_kdm_email_job.cc
b/src/lib/send_kdm_email_job.cc
index 1b476fa63e7312a1ea67710a45e2fc0a6c88b384..10a571ead20dbcbb3d397f3bf71d26bb67fd8293 100644
(file)
--- a/
src/lib/send_kdm_email_job.cc
+++ b/
src/lib/send_kdm_email_job.cc
@@
-79,7
+79,7
@@
void
SendKDMEmailJob::run ()
{
set_progress_unknown ();
SendKDMEmailJob::run ()
{
set_progress_unknown ();
-
CinemaKDMs::
email (_cinema_kdms, _container_name_format, _filename_format, _name_values, _cpl_name);
+ email (_cinema_kdms, _container_name_format, _filename_format, _name_values, _cpl_name);
set_progress (1);
set_state (FINISHED_OK);
}
set_progress (1);
set_state (FINISHED_OK);
}
diff --git
a/src/tools/dcpomatic_kdm_cli.cc
b/src/tools/dcpomatic_kdm_cli.cc
index dd7fc82e3e92cada7037e52be7e264d8fe59c004..493eea2c99acb68093ee51e5862f143c3524803a 100644
(file)
--- a/
src/tools/dcpomatic_kdm_cli.cc
+++ b/
src/tools/dcpomatic_kdm_cli.cc
@@
-140,8
+140,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 (screen_kdms),
output,
container_name_format,
filename_format,
output,
container_name_format,
filename_format,
diff --git
a/src/wx/kdm_output_panel.cc
b/src/wx/kdm_output_panel.cc
index 541674ae120823ad4d8a835b24a3e545243b79d7..fe87dfccd459f788ff4631b24c120a7d9e2ae003 100644
(file)
--- a/
src/wx/kdm_output_panel.cc
+++ b/
src/wx/kdm_output_panel.cc
@@
-186,7
+186,7
@@
KDMOutputPanel::make (
list<KDMWithMetadataPtr> screen_kdms, string name, KDMTimingPanel* timing, function<bool (boost::filesystem::path)> confirm_overwrite
)
{
list<KDMWithMetadataPtr> screen_kdms, string name, KDMTimingPanel* timing, function<bool (boost::filesystem::path)> confirm_overwrite
)
{
- list<CinemaKDMs> const cinema_kdms =
CinemaKDMs::
collect (screen_kdms);
+ list<CinemaKDMs> const cinema_kdms = collect (screen_kdms);
/* Decide whether to proceed */
/* Decide whether to proceed */
@@
-255,8
+255,8
@@
KDMOutputPanel::make (
confirm_overwrite
);
} else if (_write_folder->GetValue()) {
confirm_overwrite
);
} else if (_write_folder->GetValue()) {
- written =
CinemaKDMs::
write_directories (
-
CinemaKDMs::
collect (screen_kdms),
+ written = write_directories (
+ collect (screen_kdms),
directory(),
_container_name_format->get(),
_filename_format->get(),
directory(),
_container_name_format->get(),
_filename_format->get(),
@@
-264,8
+264,8
@@
KDMOutputPanel::make (
confirm_overwrite
);
} else if (_write_zip->GetValue()) {
confirm_overwrite
);
} else if (_write_zip->GetValue()) {
- written =
CinemaKDMs::
write_zip_files (
-
CinemaKDMs::
collect (screen_kdms),
+ written = write_zip_files (
+ collect (screen_kdms),
directory(),
_container_name_format->get(),
_filename_format->get(),
directory(),
_container_name_format->get(),
_filename_format->get(),