Move some functions to kdm_with_metadata
[dcpomatic.git] / src / lib / send_kdm_email_job.cc
index eff77ce43bfa6b6467876fb24705df093171878c..7b4d349f3d7ca767c799f02d9be8feb335dacbcd 100644 (file)
@@ -20,8 +20,8 @@
 
 #include "send_kdm_email_job.h"
 #include "compose.hpp"
+#include "kdm_with_metadata.h"
 #include "film.h"
-#include "cinema_kdms.h"
 #include <list>
 
 #include "i18n.h"
@@ -35,15 +35,13 @@ using boost::shared_ptr;
  *  @param filename_format Format to use for filenames.
  *  @param name_values Values to substitute into \p container_name_format and \p filename_format.
  *  @param cpl_name Name of the CPL that the KDMs are for.
- *  @param log Log to write to, or 0.
  */
 SendKDMEmailJob::SendKDMEmailJob (
-       list<CinemaKDMs> cinema_kdms,
+       list<list<KDMWithMetadataPtr> > cinema_kdms,
        dcp::NameFormat container_name_format,
        dcp::NameFormat filename_format,
        dcp::NameFormat::Map name_values,
-       string cpl_name,
-       shared_ptr<Log> log
+       string cpl_name
        )
        : Job (shared_ptr<Film>())
        , _container_name_format (container_name_format)
@@ -51,11 +49,15 @@ SendKDMEmailJob::SendKDMEmailJob (
        , _name_values (name_values)
        , _cpl_name (cpl_name)
        , _cinema_kdms (cinema_kdms)
-       , _log (log)
 {
 
 }
 
+SendKDMEmailJob::~SendKDMEmailJob ()
+{
+       stop_thread ();
+}
+
 string
 SendKDMEmailJob::name () const
 {
@@ -77,7 +79,7 @@ void
 SendKDMEmailJob::run ()
 {
        set_progress_unknown ();
-       CinemaKDMs::email (_cinema_kdms, _container_name_format, _filename_format, _name_values, _cpl_name, _log);
+       email (_cinema_kdms, _container_name_format, _filename_format, _name_values, _cpl_name);
        set_progress (1);
        set_state (FINISHED_OK);
 }