#include "lib/copy_dcp_details_to_film.h"
#include <dcp/cpl.h>
#include <dcp/exceptions.h>
+#include <dcp/decrypted_kdm.h>
#include <wx/wx.h>
#include <wx/dirdlg.h>
-#include <boost/foreach.hpp>
#include <iostream>
using std::cout;
using std::vector;
using std::exception;
using std::list;
-using boost::shared_ptr;
-using boost::weak_ptr;
-using boost::dynamic_pointer_cast;
+using std::shared_ptr;
+using std::weak_ptr;
+using std::dynamic_pointer_cast;
using boost::optional;
+#if BOOST_VERSION >= 106100
+using namespace boost::placeholders;
+#endif
+
enum {
/* Start at 256 so we can have IDs on _cpl_menu from 1 to 255 */
_repeat->Enable (!_content.empty ());
int n = 0;
- BOOST_FOREACH (shared_ptr<Content> i, _content) {
+ for (auto i: _content) {
if (dynamic_pointer_cast<FFmpegContent> (i)) {
++n;
}
_set_dcp_settings->Enable (static_cast<bool>(dcp));
try {
DCPExaminer ex (dcp, true);
- list<shared_ptr<dcp::CPL> > cpls = ex.cpls ();
+ auto cpls = ex.cpls ();
_choose_cpl->Enable (cpls.size() > 1);
/* We can't have 0 as a menu item ID on OS X */
int id = 1;
- BOOST_FOREACH (shared_ptr<dcp::CPL> i, cpls) {
+ for (auto i: cpls) {
wxMenuItem* item = _cpl_menu->AppendRadioItem (
id++,
wxString::Format (
"%s (%s)",
- std_to_wx(i->annotation_text()).data(),
+ std_to_wx(i->annotation_text().get_value_or("")).data(),
std_to_wx(i->id()).data()
)
);
ContentMenu::join ()
{
vector<shared_ptr<Content> > fc;
- BOOST_FOREACH (shared_ptr<Content> i, _content) {
+ for (auto i: _content) {
shared_ptr<FFmpegContent> f = dynamic_pointer_cast<FFmpegContent> (i);
if (f) {
fc.push_back (f);
/* Special case: we only remove FFmpegContent if its video view is selected;
if not, and its audio view is selected, we unmap the audio.
*/
- BOOST_FOREACH (shared_ptr<Content> i, _content) {
+ for (auto i: _content) {
shared_ptr<FFmpegContent> fc = dynamic_pointer_cast<FFmpegContent> (i);
if (!fc) {
continue;
shared_ptr<TimelineVideoContentView> video;
shared_ptr<TimelineAudioContentView> audio;
- BOOST_FOREACH (shared_ptr<TimelineContentView> j, _views) {
+ for (auto j: _views) {
shared_ptr<TimelineVideoContentView> v = dynamic_pointer_cast<TimelineVideoContentView> (j);
shared_ptr<TimelineAudioContentView> a = dynamic_pointer_cast<TimelineAudioContentView> (j);
if (v && v->content() == fc) {
return;
}
- BOOST_FOREACH (shared_ptr<Content> i, content) {
+ for (auto i: content) {
shared_ptr<Job> j (new ExamineContentJob (film, i));
j->Finished.connect (
bind (
&ContentMenu::maybe_found_missing,
this,
- boost::weak_ptr<Job> (j),
- boost::weak_ptr<Content> (_content.front ()),
- boost::weak_ptr<Content> (i)
+ std::weak_ptr<Job> (j),
+ std::weak_ptr<Content> (_content.front ()),
+ std::weak_ptr<Content> (i)
)
);
return;
}
- BOOST_FOREACH (shared_ptr<Content> i, _content) {
+ for (auto i: _content) {
JobManager::instance()->add (shared_ptr<Job> (new ExamineContentJob (film, i)));
}
}
return;
}
+ /* Try to decrypt it to get an early preview of any errors */
+ try {
+ decrypt_kdm_with_helpful_error (*kdm);
+ } catch (KDMError& e) {
+ error_dialog (_parent, std_to_wx(e.summary()), std_to_wx(e.detail()));
+ return;
+ } catch (exception& e) {
+ error_dialog (_parent, e.what());
+ return;
+ }
+
DCPExaminer ex (dcp, true);
bool kdm_matches_any_cpl = false;
- BOOST_FOREACH (shared_ptr<dcp::CPL> i, ex.cpls()) {
+ for (auto i: ex.cpls()) {
if (i->id() == kdm->cpl_id()) {
kdm_matches_any_cpl = true;
}
}
-
bool kdm_matches_selected_cpl = dcp->cpl() || kdm->cpl_id() == dcp->cpl().get();
if (!kdm_matches_any_cpl) {