#include "lib/job_manager.h"
#include "lib/exceptions.h"
#include "lib/cinema.h"
-#include "lib/kdm.h"
+#include "lib/screen_kdm.h"
#include "lib/send_kdm_email_job.h"
#include "lib/server_finder.h"
#include "lib/update_checker.h"
#include "lib/cross.h"
#include "lib/content_factory.h"
#include "lib/compose.hpp"
+#include "lib/cinema_kdms.h"
#include <dcp/exceptions.h>
#include <wx/generic/aboutdlgg.h>
#include <wx/stdpaths.h>
}
try {
+ list<ScreenKDM> screen_kdms = _film->make_kdms (d->screens(), d->cpl(), d->from(), d->until(), d->formulation());
if (d->write_to ()) {
- write_kdm_files (_film, d->screens (), d->cpl (), d->from (), d->until (), d->formulation (), d->directory ());
+ ScreenKDM::write_files (
+ _film->name(),
+ screen_kdms,
+ d->directory()
+ );
} else {
JobManager::instance()->add (
- shared_ptr<Job> (new SendKDMEmailJob (_film, d->screens (), d->cpl (), d->from (), d->until (), d->formulation ()))
+ shared_ptr<Job> (new SendKDMEmailJob (
+ _film->name(),
+ _film->dcp_name(),
+ d->from(),
+ d->until(),
+ CinemaKDMs::collect (screen_kdms),
+ _film->log()
+ ))
);
}
} catch (dcp::NotEncryptedError& e) {
try {
throw;
} catch (FileError& e) {
- error_dialog (0, wxString::Format (_("An exception occurred: %s (%s).\n\n" + REPORT_PROBLEM), e.what(), e.file().string().c_str ()));
+ error_dialog (
+ 0,
+ wxString::Format (
+ _("An exception occurred: %s (%s)\n\n") + REPORT_PROBLEM,
+ std_to_wx (e.what()),
+ std_to_wx (e.file().string().c_str ())
+ )
+ );
} catch (exception& e) {
- error_dialog (0, wxString::Format (_("An exception occurred: %s.\n\n"), e.what ()) + " " + REPORT_PROBLEM);
+ error_dialog (
+ 0,
+ wxString::Format (
+ _("An exception occurred: %s.\n\n") + " " + REPORT_PROBLEM,
+ std_to_wx (e.what ())
+ )
+ );
} catch (...) {
error_dialog (0, _("An unknown exception occurred.") + " " + REPORT_PROBLEM);
}