using std::list;
using std::exception;
using std::vector;
-using boost::shared_ptr;
-using boost::weak_ptr;
+using std::shared_ptr;
+using std::weak_ptr;
using boost::scoped_array;
using boost::optional;
-using boost::dynamic_pointer_cast;
+using std::dynamic_pointer_cast;
using boost::thread;
using boost::bind;
#if BOOST_VERSION >= 106100
}
bool ok = true;
- BOOST_FOREACH (shared_ptr<Content> i, _film->content()) {
+ for (auto i: _film->content()) {
shared_ptr<DCPContent> d = dynamic_pointer_cast<DCPContent>(i);
if (d && !d->kdm_timing_window_valid()) {
ok = false;
if (dcp) {
DCPExaminer ex (dcp, true);
shared_ptr<dcp::CPL> playing_cpl;
- BOOST_FOREACH (shared_ptr<dcp::CPL> i, ex.cpls()) {
+ for (auto i: ex.cpls()) {
if (!dcp->cpl() || i->id() == *dcp->cpl()) {
playing_cpl = i;
}
"playback-started %s %s %s",
time.timecode(_film->video_frame_rate()).c_str(),
dcp->directories().front().string().c_str(),
- playing_cpl->annotation_text().c_str()
+ playing_cpl->annotation_text().get_value_or("").c_str()
)
);
}
void film_changed (ChangeType type, Film::Property property)
{
- if (type != CHANGE_TYPE_DONE || property != Film::CONTENT) {
+ if (type != ChangeType::DONE || property != Film::Property::CONTENT) {
return;
}
/* Start off as Flat */
_film->set_container (Ratio::from_id("185"));
- BOOST_FOREACH (shared_ptr<Content> i, _film->content()) {
- shared_ptr<DCPContent> dcp = dynamic_pointer_cast<DCPContent>(i);
+ for (auto i: _film->content()) {
+ auto dcp = dynamic_pointer_cast<DCPContent>(i);
- BOOST_FOREACH (shared_ptr<TextContent> j, i->text) {
+ for (auto j: i->text) {
j->set_use (true);
}
if (i->video) {
- Ratio const * r = Ratio::nearest_from_ratio(i->video->size().ratio());
+ auto const r = Ratio::nearest_from_ratio(i->video->size().ratio());
if (r->id() == "239") {
/* Any scope content means we use scope */
_film->set_container(r);
}
/* Any 3D content means we use 3D mode */
- if (i->video && i->video->frame_type() != VIDEO_FRAME_TYPE_2D) {
+ if (i->video && i->video->frame_type() != VideoFrameType::TWO_D) {
_film->set_three_d (true);
}
}
set_menu_sensitivity ();
- wxMenuItemList old = _cpl_menu->GetMenuItems();
- for (wxMenuItemList::iterator i = old.begin(); i != old.end(); ++i) {
- _cpl_menu->Remove (*i);
+ auto old = _cpl_menu->GetMenuItems();
+ for (auto const& i: old) {
+ _cpl_menu->Remove (i);
}
if (_film->content().size() == 1) {
/* Offer a CPL menu */
- shared_ptr<DCPContent> first = dynamic_pointer_cast<DCPContent>(_film->content().front());
+ auto first = dynamic_pointer_cast<DCPContent>(_film->content().front());
if (first) {
DCPExaminer ex (first, true);
int id = ID_view_cpl;
- BOOST_FOREACH (shared_ptr<dcp::CPL> i, ex.cpls()) {
- wxMenuItem* j = _cpl_menu->AppendRadioItem(
+ for (auto i: ex.cpls()) {
+ auto j = _cpl_menu->AppendRadioItem(
id,
- wxString::Format("%s (%s)", std_to_wx(i->annotation_text()).data(), std_to_wx(i->id()).data())
+ wxString::Format("%s (%s)", std_to_wx(i->annotation_text().get_value_or("")).data(), std_to_wx(i->id()).data())
);
j->Check(!first->cpl() || i->id() == *first->cpl());
++id;
bool report_errors_from_last_job (wxWindow* parent) const
{
- JobManager* jm = JobManager::instance ();
+ auto jm = JobManager::instance ();
DCPOMATIC_ASSERT (!jm->get().empty());
- shared_ptr<Job> last = jm->get().back();
+ auto last = jm->get().back();
if (last->finished_in_error()) {
error_dialog(parent, wxString::Format(_("Could not load DCP.\n\n%s."), std_to_wx(last->error_summary()).data()), std_to_wx(last->error_details()));
return false;
view->AppendRadioItem(ID_view_scale_quarter, _("Decode at quarter resolution"))->Check(c && c.get() == 2);
wxMenu* tools = new wxMenu;
- _tools_verify = tools->Append (ID_tools_verify, _("Verify DCP"));
+ _tools_verify = tools->Append (ID_tools_verify, _("Verify DCP..."));
tools->AppendSeparator ();
tools->Append (ID_tools_check_for_updates, _("Check for updates"));
tools->Append (ID_tools_timing, _("Timing..."));
if (r == wxID_OK) {
DCPOMATIC_ASSERT (_film);
- shared_ptr<DCPContent> dcp = boost::dynamic_pointer_cast<DCPContent>(_film->content().front());
+ shared_ptr<DCPContent> dcp = std::dynamic_pointer_cast<DCPContent>(_film->content().front());
DCPOMATIC_ASSERT (dcp);
dcp->add_ov (wx_to_std(c->GetPath()));
JobManager::instance()->add(shared_ptr<Job>(new ExamineContentJob (_film, dcp)));
if (!ok || !report_errors_from_last_job(this)) {
return;
}
- BOOST_FOREACH (shared_ptr<TextContent> i, dcp->text) {
+ for (auto i: dcp->text) {
i->set_use (true);
}
if (dcp->video) {
if (d->ShowModal() == wxID_OK) {
DCPOMATIC_ASSERT (_film);
- shared_ptr<DCPContent> dcp = boost::dynamic_pointer_cast<DCPContent>(_film->content().front());
+ shared_ptr<DCPContent> dcp = std::dynamic_pointer_cast<DCPContent>(_film->content().front());
DCPOMATIC_ASSERT (dcp);
try {
if (dcp) {
void view_cpl (wxCommandEvent& ev)
{
- shared_ptr<DCPContent> dcp = boost::dynamic_pointer_cast<DCPContent>(_film->content().front());
+ shared_ptr<DCPContent> dcp = std::dynamic_pointer_cast<DCPContent>(_film->content().front());
DCPOMATIC_ASSERT (dcp);
DCPExaminer ex (dcp, true);
int id = ev.GetId() - ID_view_cpl;
void tools_verify ()
{
- shared_ptr<DCPContent> dcp = boost::dynamic_pointer_cast<DCPContent>(_film->content().front());
+ shared_ptr<DCPContent> dcp = std::dynamic_pointer_cast<DCPContent>(_film->content().front());
DCPOMATIC_ASSERT (dcp);
shared_ptr<VerifyDCPJob> job (new VerifyDCPJob(dcp->directories()));
shared_ptr<FilmViewer> _viewer;
Controls* _controls;
SystemInformationDialog* _system_information_dialog;
- boost::shared_ptr<Film> _film;
+ std::shared_ptr<Film> _film;
boost::signals2::scoped_connection _config_changed_connection;
boost::signals2::scoped_connection _examine_job_connection;
wxMenuItem* _file_add_ov;