From a5d004b0773f633401528392fc28e66d70e13ac8 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 4 Jan 2021 21:32:13 +0100 Subject: [PATCH] BOOST_FOREACH. --- src/lib/active_text.cc | 6 +- src/lib/analyse_audio_job.cc | 5 +- src/lib/analyse_subtitles_job.cc | 4 +- src/lib/audio_analysis.cc | 19 +++--- src/lib/audio_content.cc | 13 ++-- src/lib/audio_decoder.cc | 5 +- src/lib/audio_mapping.cc | 2 +- src/lib/audio_merger.cc | 8 +-- src/lib/audio_ring_buffers.cc | 1 - src/lib/case_insensitive_sorter.cc | 1 - src/lib/check_content_change_job.cc | 5 +- src/lib/cinema.cc | 7 +-- src/lib/colour_conversion.cc | 3 +- src/lib/config.cc | 45 +++++++------ src/lib/content.cc | 10 +-- src/lib/cross_common.cc | 7 +-- src/lib/cross_linux.cc | 3 +- src/lib/cross_osx.cc | 13 ++-- src/lib/cross_windows.cc | 1 - src/lib/dcp.cc | 13 ++-- src/lib/dcp_content.cc | 31 +++++---- src/lib/dcp_content_type.cc | 5 +- src/lib/dcp_decoder.cc | 13 ++-- src/lib/dcp_encoder.cc | 7 +-- src/lib/dcp_examiner.cc | 15 +++-- src/lib/dcp_subtitle_content.cc | 3 +- src/lib/dcp_subtitle_decoder.cc | 2 +- src/lib/dcpomatic_time.h | 5 +- src/lib/decoder.cc | 4 +- src/lib/decoder_factory.cc | 1 - src/lib/dkdm_recipient.cc | 5 +- src/lib/dkdm_wrapper.cc | 5 +- src/lib/emailer.cc | 11 ++-- src/lib/empty.cc | 11 ++-- src/lib/encode_server.cc | 1 - src/lib/encode_server_finder.cc | 2 +- src/lib/ext.cc | 3 +- src/lib/ffmpeg.cc | 3 +- src/lib/ffmpeg_content.cc | 13 ++-- src/lib/ffmpeg_decoder.cc | 9 ++- src/lib/ffmpeg_encoder.cc | 2 +- src/lib/ffmpeg_examiner.cc | 1 - src/lib/ffmpeg_file_encoder.cc | 4 +- src/lib/ffmpeg_subtitle_stream.cc | 3 +- src/lib/film.cc | 73 +++++++++++----------- src/lib/filter.cc | 3 +- src/lib/font.cc | 3 +- src/lib/frame_interval_checker.cc | 2 +- src/lib/hints.cc | 23 ++++--- src/lib/image_content.cc | 3 +- src/lib/image_filename_sorter.cc | 1 - src/lib/j2k_encoder.cc | 3 +- src/lib/job.cc | 3 +- src/lib/job_manager.cc | 17 +++-- src/lib/kdm_with_metadata.cc | 19 +++--- src/lib/overlaps.cc | 3 +- src/lib/player.cc | 35 +++++------ src/lib/player_text.cc | 5 +- src/lib/playlist.cc | 43 +++++++------ src/lib/reel_writer.cc | 17 +++-- src/lib/render_text.cc | 7 +-- src/lib/screen.cc | 7 +-- src/lib/send_kdm_email_job.cc | 2 +- src/lib/send_notification_email_job.cc | 3 +- src/lib/send_problem_report_job.cc | 3 +- src/lib/shuffler.cc | 4 +- src/lib/spl.cc | 5 +- src/lib/string_text_file_decoder.cc | 5 +- src/lib/subtitle_encoder.cc | 6 +- src/lib/text_content.cc | 9 ++- src/lib/text_decoder.cc | 11 ++-- src/lib/types.cc | 7 +-- src/lib/util.cc | 6 +- src/lib/util.h | 4 +- src/lib/verify_dcp_job.cc | 2 +- src/lib/video_decoder.cc | 1 - src/lib/video_ring_buffers.cc | 1 - src/lib/writer.cc | 23 ++++--- src/tools/dcpomatic.cc | 7 +-- src/tools/dcpomatic_batch.cc | 9 ++- src/tools/dcpomatic_cli.cc | 7 +-- src/tools/dcpomatic_create.cc | 11 ++-- src/tools/dcpomatic_disk.cc | 2 +- src/tools/dcpomatic_disk_writer.cc | 1 - src/tools/dcpomatic_kdm.cc | 7 +-- src/tools/dcpomatic_kdm_cli.cc | 10 +-- src/tools/dcpomatic_player.cc | 12 ++-- src/tools/dcpomatic_playlist.cc | 7 +-- src/tools/dcpomatic_server.cc | 3 +- src/wx/audio_dialog.cc | 5 +- src/wx/audio_mapping_view.cc | 11 ++-- src/wx/audio_panel.cc | 3 +- src/wx/audio_plot.cc | 6 +- src/wx/cinema_dialog.cc | 1 - src/wx/closed_captions_dialog.cc | 6 +- src/wx/config_dialog.cc | 2 +- src/wx/config_dialog.h | 1 - src/wx/confirm_kdm_email_dialog.cc | 3 +- src/wx/content_colour_conversion_dialog.cc | 3 +- src/wx/content_menu.cc | 17 +++-- src/wx/content_panel.cc | 31 +++++---- src/wx/content_properties_dialog.cc | 5 +- src/wx/content_sub_panel.cc | 1 - src/wx/content_view.cc | 6 +- src/wx/dcp_panel.cc | 9 ++- src/wx/dkdm_dialog.cc | 4 +- src/wx/dkdm_output_panel.cc | 6 +- src/wx/dolby_doremi_certificate_panel.cc | 3 +- src/wx/download_certificate_dialog.cc | 2 +- src/wx/editable_list.h | 8 +-- src/wx/film_editor.cc | 1 - src/wx/film_name_location_dialog.cc | 3 +- src/wx/film_viewer.cc | 4 +- src/wx/filter_dialog.cc | 5 +- src/wx/fonts_dialog.cc | 5 +- src/wx/full_config_dialog.cc | 5 +- src/wx/gain_calculator_dialog.cc | 2 +- src/wx/hints_dialog.cc | 3 +- src/wx/job_manager_view.cc | 11 ++-- src/wx/kdm_cpl_panel.cc | 11 ++-- src/wx/kdm_dialog.cc | 4 +- src/wx/kdm_output_panel.cc | 6 +- src/wx/language_tag_dialog.cc | 7 +-- src/wx/move_to_dialog.cc | 3 +- src/wx/nag_dialog.cc | 1 - src/wx/name_format_editor.h | 1 - src/wx/player_config_dialog.cc | 1 - src/wx/player_stress_tester.cc | 3 +- src/wx/playlist_controls.cc | 6 +- src/wx/qube_certificate_panel.cc | 2 +- src/wx/recipients_panel.cc | 3 +- src/wx/recreate_chain_dialog.cc | 1 - src/wx/save_template_dialog.cc | 1 - src/wx/screens_panel.cc | 9 ++- src/wx/servers_list_dialog.cc | 3 +- src/wx/suspender.cc | 3 +- src/wx/system_font_dialog.cc | 3 +- src/wx/templates_dialog.cc | 3 +- src/wx/text_panel.cc | 29 +++++---- src/wx/text_view.cc | 4 +- src/wx/timeline.cc | 21 +++---- src/wx/timeline_audio_content_view.cc | 2 +- src/wx/timeline_content_view.cc | 3 +- src/wx/timeline_reels_view.cc | 3 +- src/wx/timing_panel.cc | 35 +++++------ src/wx/verify_dcp_dialog.cc | 3 +- src/wx/video_panel.cc | 33 +++++----- src/wx/wx_util.cc | 2 +- test/colour_conversion_test.cc | 3 +- test/dcp_subtitle_test.cc | 4 +- test/ffmpeg_encoder_test.cc | 2 +- test/kdm_naming_test.cc | 2 +- test/reels_test.cc | 3 +- test/subtitle_reel_number_test.cc | 2 +- test/subtitle_reel_test.cc | 5 +- test/threed_test.cc | 4 +- test/vf_test.cc | 1 - 157 files changed, 526 insertions(+), 643 deletions(-) diff --git a/src/lib/active_text.cc b/src/lib/active_text.cc index 30f3b8ca6..1180ce7b0 100644 --- a/src/lib/active_text.cc +++ b/src/lib/active_text.cc @@ -54,7 +54,7 @@ ActiveText::get_burnt (DCPTimePeriod period, bool always_burn_captions) const continue; } - BOOST_FOREACH (Period j, i->second) { + for (auto j: i->second) { DCPTimePeriod test (j.from, j.to.get_value_or(DCPTime::max())); optional overlap = period.overlap (test); if (overlap && overlap->duration() > DCPTime(period.duration().get() / 2)) { @@ -77,7 +77,7 @@ ActiveText::clear_before (DCPTime time) Map updated; for (Map::const_iterator i = _data.begin(); i != _data.end(); ++i) { list as; - BOOST_FOREACH (Period j, i->second) { + for (auto j: i->second) { if (!j.to || j.to.get() >= time) { as.push_back (j); } @@ -119,7 +119,7 @@ ActiveText::add_to (weak_ptr content, DCPTime to) _data[content].back().to = to; - BOOST_FOREACH (StringText& i, _data[content].back().subs.string) { + for (auto& i: _data[content].back().subs.string) { i.set_out (dcp::Time(to.seconds(), 1000)); } diff --git a/src/lib/analyse_audio_job.cc b/src/lib/analyse_audio_job.cc index 0d6a5e8b8..c94e0b91f 100644 --- a/src/lib/analyse_audio_job.cc +++ b/src/lib/analyse_audio_job.cc @@ -37,7 +37,6 @@ extern "C" { #include #endif } -#include #include #include "i18n.h" @@ -123,7 +122,7 @@ AnalyseAudioJob::AnalyseAudioJob (shared_ptr film, shared_ptr (i); } delete[] _current; @@ -165,7 +164,7 @@ AnalyseAudioJob::run () _analysis.reset (new AudioAnalysis (_film->audio_channels ())); bool has_any_audio = false; - BOOST_FOREACH (shared_ptr c, _playlist->content ()) { + for (auto c: _playlist->content()) { if (c->audio) { has_any_audio = true; } diff --git a/src/lib/analyse_subtitles_job.cc b/src/lib/analyse_subtitles_job.cc index df3cb3181..b941824d6 100644 --- a/src/lib/analyse_subtitles_job.cc +++ b/src/lib/analyse_subtitles_job.cc @@ -94,7 +94,7 @@ AnalyseSubtitlesJob::analyse (PlayerText text, TextType type) return; } - BOOST_FOREACH (BitmapText const& i, text.bitmap) { + for (auto const& i: text.bitmap) { if (!_bounding_box) { _bounding_box = i.rectangle; } else { @@ -105,7 +105,7 @@ AnalyseSubtitlesJob::analyse (PlayerText text, TextType type) if (!text.string.empty()) { /* We can provide dummy values for time and frame rate here as they are only used to calculate fades */ dcp::Size const frame = _film->frame_size(); - BOOST_FOREACH (PositionImage i, render_text(text.string, text.fonts, frame, dcpomatic::DCPTime(), 24)) { + for (auto i: render_text(text.string, text.fonts, frame, dcpomatic::DCPTime(), 24)) { dcpomatic::Rect rect ( double(i.position.x) / frame.width, double(i.position.y) / frame.height, double(i.image->size().width) / frame.width, double(i.image->size().height) / frame.height diff --git a/src/lib/audio_analysis.cc b/src/lib/audio_analysis.cc index 41591b062..22c14c764 100644 --- a/src/lib/audio_analysis.cc +++ b/src/lib/audio_analysis.cc @@ -29,7 +29,6 @@ DCPOMATIC_DISABLE_WARNINGS #include DCPOMATIC_ENABLE_WARNINGS #include -#include #include #include #include @@ -68,17 +67,17 @@ AudioAnalysis::AudioAnalysis (boost::filesystem::path filename) throw OldFormatError ("Audio analysis file is too old"); } - BOOST_FOREACH (cxml::NodePtr i, f.node_children ("Channel")) { + for (auto i: f.node_children("Channel")) { vector channel; - BOOST_FOREACH (cxml::NodePtr j, i->node_children ("Point")) { - channel.push_back (AudioPoint (j)); + for (auto j: i->node_children("Point")) { + channel.push_back (AudioPoint(j)); } _data.push_back (channel); } - BOOST_FOREACH (cxml::ConstNodePtr i, f.node_children ("SamplePeak")) { + for (auto i: f.node_children ("SamplePeak")) { _sample_peak.push_back ( PeakTime ( dcp::raw_convert(i->content()), DCPTime(i->number_attribute("Time")) @@ -86,7 +85,7 @@ AudioAnalysis::AudioAnalysis (boost::filesystem::path filename) ); } - BOOST_FOREACH (cxml::ConstNodePtr i, f.node_children ("TruePeak")) { + for (auto i: f.node_children ("TruePeak")) { _true_peak.push_back (dcp::raw_convert (i->content ())); } @@ -135,9 +134,9 @@ AudioAnalysis::write (boost::filesystem::path filename) root->add_child("Version")->add_child_text (raw_convert (_current_state_version)); - BOOST_FOREACH (vector& i, _data) { + for (auto& i: _data) { xmlpp::Element* channel = root->add_child ("Channel"); - BOOST_FOREACH (AudioPoint& j, i) { + for (auto& j: i) { j.as_xml (channel->add_child ("Point")); } } @@ -148,7 +147,7 @@ AudioAnalysis::write (boost::filesystem::path filename) n->set_attribute ("Time", raw_convert (_sample_peak[i].time.get())); } - BOOST_FOREACH (float i, _true_peak) { + for (auto i: _true_peak) { root->add_child("TruePeak")->add_child_text (raw_convert (i)); } @@ -213,7 +212,7 @@ AudioAnalysis::overall_true_peak () const { optional p; - BOOST_FOREACH (float i, _true_peak) { + for (auto i: _true_peak) { if (!p || i > *p) { p = i; } diff --git a/src/lib/audio_content.cc b/src/lib/audio_content.cc index 79a00b249..c70afcda4 100644 --- a/src/lib/audio_content.cc +++ b/src/lib/audio_content.cc @@ -27,7 +27,6 @@ #include #include #include -#include #include #include "i18n.h" @@ -137,7 +136,7 @@ string AudioContent::technical_summary () const { string s = "audio: "; - BOOST_FOREACH (AudioStreamPtr i, streams ()) { + for (auto i: streams()) { s += String::compose ("stream channels %1 rate %2 ", i->channels(), i->frame_rate()); } @@ -150,7 +149,7 @@ AudioContent::set_mapping (AudioMapping mapping) ChangeSignaller cc (_parent, AudioContentProperty::STREAMS); int c = 0; - BOOST_FOREACH (AudioStreamPtr i, streams ()) { + for (auto i: streams()) { AudioMapping stream_mapping (i->channels (), MAX_DCP_AUDIO_CHANNELS); for (int j = 0; j < i->channels(); ++j) { for (int k = 0; k < MAX_DCP_AUDIO_CHANNELS; ++k) { @@ -166,7 +165,7 @@ AudioMapping AudioContent::mapping () const { int channels = 0; - BOOST_FOREACH (AudioStreamPtr i, streams ()) { + for (auto i: streams()) { channels += i->channels (); } @@ -175,7 +174,7 @@ AudioContent::mapping () const int c = 0; int s = 0; - BOOST_FOREACH (AudioStreamPtr i, streams ()) { + for (auto i: streams()) { AudioMapping mapping = i->mapping (); for (int j = 0; j < mapping.input_channels(); ++j) { for (int k = 0; k < MAX_DCP_AUDIO_CHANNELS; ++k) { @@ -232,7 +231,7 @@ AudioContent::processing_description (shared_ptr film) const bool same = true; optional common_frame_rate; - BOOST_FOREACH (AudioStreamPtr i, streams()) { + for (auto i: streams()) { if (i->frame_rate() != resampled_frame_rate(film)) { resampled = true; } else { @@ -272,7 +271,7 @@ AudioContent::channel_names () const int index = 0; int stream = 1; - BOOST_FOREACH (AudioStreamPtr i, streams ()) { + for (auto i: streams()) { for (int j = 0; j < i->channels(); ++j) { n.push_back (NamedChannel(String::compose ("%1:%2", stream, j + 1), index++)); } diff --git a/src/lib/audio_decoder.cc b/src/lib/audio_decoder.cc index 5334dfa34..095be0aae 100644 --- a/src/lib/audio_decoder.cc +++ b/src/lib/audio_decoder.cc @@ -25,7 +25,6 @@ #include "log.h" #include "resampler.h" #include "compose.hpp" -#include #include #include "i18n.h" @@ -43,7 +42,7 @@ AudioDecoder::AudioDecoder (Decoder* parent, shared_ptr cont , _fast (fast) { /* Set up _positions so that we have one for each stream */ - BOOST_FOREACH (AudioStreamPtr i, content->streams ()) { + for (auto i: content->streams ()) { _positions[i] = 0; } } @@ -184,7 +183,7 @@ AudioDecoder::flush () void AudioDecoder::silence (int milliseconds) { - BOOST_FOREACH (AudioStreamPtr i, _content->streams ()) { + for (auto i: _content->streams()) { int const samples = ContentTime::from_seconds(milliseconds / 1000.0).frames_round(i->frame_rate()); shared_ptr silence (new AudioBuffers (i->channels(), samples)); silence->make_silent (); diff --git a/src/lib/audio_mapping.cc b/src/lib/audio_mapping.cc index 37a3d5fa2..da9f9822e 100644 --- a/src/lib/audio_mapping.cc +++ b/src/lib/audio_mapping.cc @@ -237,7 +237,7 @@ AudioMapping::mapped_output_channels () const list mapped; for (vector >::const_iterator i = _gain.begin(); i != _gain.end(); ++i) { - BOOST_FOREACH (dcp::Channel j, dcp::used_audio_channels()) { + for (auto j: dcp::used_audio_channels()) { if (abs ((*i)[j]) > minus_96_db) { mapped.push_back (j); } diff --git a/src/lib/audio_merger.cc b/src/lib/audio_merger.cc index 347a96f5a..06eba098f 100644 --- a/src/lib/audio_merger.cc +++ b/src/lib/audio_merger.cc @@ -60,7 +60,7 @@ AudioMerger::pull (DCPTime time) list new_buffers; _buffers.sort (AudioMerger::BufferComparator()); - BOOST_FOREACH (Buffer i, _buffers) { + for (auto i: _buffers) { if (i.period().to <= time) { /* Completely within the pull period */ DCPOMATIC_ASSERT (i.audio->frames() > 0); @@ -102,7 +102,7 @@ AudioMerger::push (std::shared_ptr audio, DCPTime time) DCPTimePeriod period (time, time + DCPTime::from_frames (audio->frames(), _frame_rate)); /* Mix any overlapping parts of this new block with existing ones */ - BOOST_FOREACH (Buffer i, _buffers) { + for (auto i: _buffers) { optional overlap = i.period().overlap (period); if (overlap) { int32_t const offset = frames(DCPTime(overlap->from - i.time)); @@ -116,12 +116,12 @@ AudioMerger::push (std::shared_ptr audio, DCPTime time) } list periods; - BOOST_FOREACH (Buffer i, _buffers) { + for (auto i: _buffers) { periods.push_back (i.period ()); } /* Add the non-overlapping parts */ - BOOST_FOREACH (DCPTimePeriod i, subtract (period, periods)) { + for (auto i: subtract(period, periods)) { list::iterator before = _buffers.end(); list::iterator after = _buffers.end(); for (list::iterator j = _buffers.begin(); j != _buffers.end(); ++j) { diff --git a/src/lib/audio_ring_buffers.cc b/src/lib/audio_ring_buffers.cc index c0559f61c..289045ff5 100644 --- a/src/lib/audio_ring_buffers.cc +++ b/src/lib/audio_ring_buffers.cc @@ -21,7 +21,6 @@ #include "audio_ring_buffers.h" #include "dcpomatic_assert.h" #include "exceptions.h" -#include #include using std::min; diff --git a/src/lib/case_insensitive_sorter.cc b/src/lib/case_insensitive_sorter.cc index 1dfdb01f3..c26f1e642 100644 --- a/src/lib/case_insensitive_sorter.cc +++ b/src/lib/case_insensitive_sorter.cc @@ -20,7 +20,6 @@ #include "case_insensitive_sorter.h" #include -#include #include using std::string; diff --git a/src/lib/check_content_change_job.cc b/src/lib/check_content_change_job.cc index 45a662e37..c4d050c0e 100644 --- a/src/lib/check_content_change_job.cc +++ b/src/lib/check_content_change_job.cc @@ -23,7 +23,6 @@ #include "examine_content_job.h" #include "content.h" #include "film.h" -#include #include #include "i18n.h" @@ -66,7 +65,7 @@ CheckContentChangeJob::run () list > changed; - BOOST_FOREACH (shared_ptr i, _film->content()) { + for (auto i: _film->content()) { bool ic = false; for (size_t j = 0; j < i->number_of_paths(); ++j) { if (boost::filesystem::last_write_time(i->path(j)) != i->last_write_time(j)) { @@ -84,7 +83,7 @@ CheckContentChangeJob::run () if (!changed.empty()) { if (_gui) { - BOOST_FOREACH (shared_ptr i, changed) { + for (auto i: changed) { JobManager::instance()->add(shared_ptr(new ExamineContentJob(_film, i))); } string m = _("Some files have been changed since they were added to the project.\n\nThese files will now be re-examined, so you may need to check their settings."); diff --git a/src/lib/cinema.cc b/src/lib/cinema.cc index 48cba2b8f..42557efc3 100644 --- a/src/lib/cinema.cc +++ b/src/lib/cinema.cc @@ -24,7 +24,6 @@ #include #include #include -#include #include using std::list; @@ -37,7 +36,7 @@ Cinema::Cinema (cxml::ConstNodePtr node) : name (node->string_child ("Name")) , notes (node->optional_string_child("Notes").get_value_or("")) { - BOOST_FOREACH (cxml::ConstNodePtr i, node->node_children("Email")) { + for (auto i: node->node_children("Email")) { emails.push_back (i->content ()); } @@ -67,7 +66,7 @@ Cinema::as_xml (xmlpp::Element* parent) const { parent->add_child("Name")->add_child_text (name); - BOOST_FOREACH (string i, emails) { + for (auto i: emails) { parent->add_child("Email")->add_child_text (i); } @@ -76,7 +75,7 @@ Cinema::as_xml (xmlpp::Element* parent) const parent->add_child("UTCOffsetHour")->add_child_text (raw_convert (_utc_offset_hour)); parent->add_child("UTCOffsetMinute")->add_child_text (raw_convert (_utc_offset_minute)); - BOOST_FOREACH (shared_ptr i, _screens) { + for (auto i: _screens) { i->as_xml (parent->add_child ("Screen")); } } diff --git a/src/lib/colour_conversion.cc b/src/lib/colour_conversion.cc index d0e0f4638..e0158b735 100644 --- a/src/lib/colour_conversion.cc +++ b/src/lib/colour_conversion.cc @@ -33,7 +33,6 @@ DCPOMATIC_DISABLE_WARNINGS #include DCPOMATIC_ENABLE_WARNINGS -#include #include #include "i18n.h" @@ -293,7 +292,7 @@ PresetColourConversion::setup_colour_conversion_presets () PresetColourConversion PresetColourConversion::from_id (string s) { - BOOST_FOREACH (PresetColourConversion const& i, _presets) { + for (auto const& i: _presets) { if (i.id == s) { return i; } diff --git a/src/lib/config.cc b/src/lib/config.cc index e2425799d..a3eb1b77a 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -41,7 +41,6 @@ #include #include #include -#include #include #include #include @@ -262,7 +261,7 @@ try boost::optional u = f.optional_bool_child ("UseAnyServers"); _use_any_servers = u.get_value_or (true); - BOOST_FOREACH (cxml::ConstNodePtr i, f.node_children("Server")) { + for (auto i: f.node_children("Server")) { if (i->node_children("HostName").size() == 1) { _servers.push_back (i->string_child ("HostName")); } else { @@ -348,7 +347,7 @@ try _kdm_subject = f.optional_string_child ("KDMSubject").get_value_or (_("KDM delivery: $CPL_NAME")); _kdm_from = f.string_child ("KDMFrom"); - BOOST_FOREACH (cxml::ConstNodePtr i, f.node_children("KDMCC")) { + for (auto i: f.node_children("KDMCC")) { if (!i->content().empty()) { _kdm_cc.push_back (i->content ()); } @@ -359,7 +358,7 @@ try _notification_subject = f.optional_string_child("NotificationSubject").get_value_or(_("DCP-o-matic notification")); _notification_from = f.optional_string_child("NotificationFrom").get_value_or(""); _notification_to = f.optional_string_child("NotificationTo").get_value_or(""); - BOOST_FOREACH (cxml::ConstNodePtr i, f.node_children("NotificationCC")) { + for (auto i: f.node_children("NotificationCC")) { if (!i->content().empty()) { _notification_cc.push_back (i->content ()); } @@ -384,11 +383,11 @@ try _win32_console = f.optional_bool_child ("Win32Console").get_value_or (false); #endif - BOOST_FOREACH (cxml::ConstNodePtr i, f.node_children("History")) { + for (auto i: f.node_children("History")) { _history.push_back (i->content ()); } - BOOST_FOREACH (cxml::ConstNodePtr i, f.node_children("PlayerHistory")) { + for (auto i: f.node_children("PlayerHistory")) { _player_history.push_back (i->content ()); } @@ -396,7 +395,7 @@ try if (signer) { shared_ptr c (new dcp::CertificateChain ()); /* Read the signing certificates and private key in from the config file */ - BOOST_FOREACH (cxml::NodePtr i, signer->node_children ("Certificate")) { + for (auto i: signer->node_children ("Certificate")) { c->add (dcp::Certificate (i->content ())); } c->set_key (signer->string_child ("PrivateKey")); @@ -409,7 +408,7 @@ try cxml::NodePtr decryption = f.optional_node_child ("Decryption"); if (decryption) { shared_ptr c (new dcp::CertificateChain ()); - BOOST_FOREACH (cxml::NodePtr i, decryption->node_children ("Certificate")) { + for (auto i: decryption->node_children ("Certificate")) { c->add (dcp::Certificate (i->content ())); } c->set_key (decryption->string_child ("PrivateKey")); @@ -421,7 +420,7 @@ try /* These must be done before we call Bad as that might set one of the nags. */ - BOOST_FOREACH (cxml::NodePtr i, f.node_children("Nagged")) { + for (auto i: f.node_children("Nagged")) { int const id = i->number_attribute("Id"); if (id >= 0 && id < NAG_COUNT) { _nagged[id] = raw_convert(i->content()); @@ -430,7 +429,7 @@ try optional bad; - BOOST_FOREACH (dcp::Certificate const & i, _signer_chain->unordered()) { + for (auto const& i: _signer_chain->unordered()) { if (i.has_utf8_strings()) { bad = BAD_SIGNER_UTF8_STRINGS; } @@ -465,7 +464,7 @@ try } else { /* Old-style: one or more DKDM nodes */ _dkdms.reset (new DKDMGroup ("root")); - BOOST_FOREACH (cxml::ConstNodePtr i, f.node_children("DKDM")) { + for (auto i: f.node_children("DKDM")) { _dkdms->add (DKDMBase::read (i)); } } @@ -506,7 +505,7 @@ try _decode_reduction = f.optional_number_child("DecodeReduction"); _default_notify = f.optional_bool_child("DefaultNotify").get_value_or(false); - BOOST_FOREACH (cxml::NodePtr i, f.node_children("Notification")) { + for (auto i: f.node_children("Notification")) { int const id = i->number_attribute("Id"); if (id >= 0 && id < NOTIFICATION_COUNT) { _notification[id] = raw_convert(i->content()); @@ -622,7 +621,7 @@ Config::write_config () const /* [XML] UseAnyServers 1 to broadcast to look for encoding servers to use, 0 to use only those configured. */ root->add_child("UseAnyServers")->add_child_text (_use_any_servers ? "1" : "0"); - BOOST_FOREACH (string i, _servers) { + for (auto i: _servers) { /* [XML:opt] Server IP address or hostname of an encoding server to use; you can use as many of these tags as you like. */ @@ -725,7 +724,7 @@ Config::write_config () const root->add_child("KDMSubject")->add_child_text (_kdm_subject); /* [XML] KDMFrom From address to use for KDM emails. */ root->add_child("KDMFrom")->add_child_text (_kdm_from); - BOOST_FOREACH (string i, _kdm_cc) { + for (auto i: _kdm_cc) { /* [XML] KDMCC CC address to use for KDM emails; you can use as many of these tags as you like. */ root->add_child("KDMCC")->add_child_text (i); } @@ -740,7 +739,7 @@ Config::write_config () const root->add_child("NotificationFrom")->add_child_text (_notification_from); /* [XML] NotificationFrom To address to use for notification emails. */ root->add_child("NotificationTo")->add_child_text (_notification_to); - BOOST_FOREACH (string i, _notification_cc) { + for (auto i: _notification_cc) { /* [XML] NotificationCC CC address to use for notification emails; you can use as many of these tags as you like. */ root->add_child("NotificationCC")->add_child_text (i); } @@ -782,7 +781,7 @@ Config::write_config () const */ xmlpp::Element* signer = root->add_child ("Signer"); DCPOMATIC_ASSERT (_signer_chain); - BOOST_FOREACH (dcp::Certificate const & i, _signer_chain->unordered()) { + for (auto const& i: _signer_chain->unordered()) { signer->add_child("Certificate")->add_child_text (i.certificate (true)); } signer->add_child("PrivateKey")->add_child_text (_signer_chain->key().get ()); @@ -790,7 +789,7 @@ Config::write_config () const /* [XML] Decryption Certificate chain and private key to use when decrypting KDMs */ xmlpp::Element* decryption = root->add_child ("Decryption"); DCPOMATIC_ASSERT (_decryption_chain); - BOOST_FOREACH (dcp::Certificate const & i, _decryption_chain->unordered()) { + for (auto const& i: _decryption_chain->unordered()) { decryption->add_child("Certificate")->add_child_text (i.certificate (true)); } decryption->add_child("PrivateKey")->add_child_text (_decryption_chain->key().get ()); @@ -798,14 +797,14 @@ Config::write_config () const /* [XML] History Filename of DCP to present in the File menu of the GUI; there can be more than one of these tags. */ - BOOST_FOREACH (boost::filesystem::path i, _history) { + for (auto i: _history) { root->add_child("History")->add_child_text (i.string ()); } /* [XML] History Filename of DCP to present in the File menu of the player; there can be more than one of these tags. */ - BOOST_FOREACH (boost::filesystem::path i, _player_history) { + for (auto i: _player_history) { root->add_child("PlayerHistory")->add_child_text (i.string ()); } @@ -1002,7 +1001,7 @@ write_file (string root_node, string node, string version, list > xmlpp::Element* root = doc.create_root_node (root_node); root->add_child("Version")->add_child_text(version); - BOOST_FOREACH (shared_ptr i, things) { + for (auto i: things) { i->as_xml (root->add_child(node)); } @@ -1172,7 +1171,7 @@ Config::clean_history_internal (vector& h) { vector old = h; h.clear (); - BOOST_FOREACH (boost::filesystem::path i, old) { + for (auto i: old) { try { if (boost::filesystem::is_directory(i)) { h.push_back (i); @@ -1194,7 +1193,7 @@ Config::read_cinemas (cxml::Document const & f) { _cinemas.clear (); list cin = f.node_children ("Cinema"); - BOOST_FOREACH (cxml::ConstNodePtr i, f.node_children("Cinema")) { + for (auto i: f.node_children("Cinema")) { /* Slightly grotty two-part construction of Cinema here so that we can use shared_from_this. */ @@ -1229,7 +1228,7 @@ Config::read_dkdm_recipients (cxml::Document const & f) { _dkdm_recipients.clear (); list cin = f.node_children ("DKDMRecipient"); - BOOST_FOREACH (cxml::ConstNodePtr i, f.node_children("DKDMRecipient")) { + for (auto i: f.node_children("DKDMRecipient")) { _dkdm_recipients.push_back (shared_ptr(new DKDMRecipient(i))); } } diff --git a/src/lib/content.cc b/src/lib/content.cc index efcec534c..5fb9d324a 100644 --- a/src/lib/content.cc +++ b/src/lib/content.cc @@ -92,7 +92,7 @@ Content::Content (cxml::ConstNodePtr node) : _change_signals_frequent (false) { list path_children = node->node_children ("Path"); - BOOST_FOREACH (cxml::NodePtr i, path_children) { + for (auto i: path_children) { _paths.push_back (i->content()); optional const mod = i->optional_number_attribute("mtime"); if (mod) { @@ -192,7 +192,7 @@ Content::examine (shared_ptr, shared_ptr job) _digest = d; _last_write_times.clear (); - BOOST_FOREACH (boost::filesystem::path i, _paths) { + for (auto i: _paths) { _last_write_times.push_back (boost::filesystem::last_write_time(i)); } } @@ -327,7 +327,7 @@ Content::identifier () const bool Content::paths_valid () const { - BOOST_FOREACH (boost::filesystem::path i, _paths) { + for (auto i: _paths) { if (!boost::filesystem::exists (i)) { return false; } @@ -345,7 +345,7 @@ Content::set_paths (vector paths) boost::mutex::scoped_lock lm (_mutex); _paths = paths; _last_write_times.clear (); - BOOST_FOREACH (boost::filesystem::path i, _paths) { + for (auto i: _paths) { _last_write_times.push_back (boost::filesystem::last_write_time(i)); } } @@ -495,7 +495,7 @@ Content::only_text () const shared_ptr Content::text_of_original_type (TextType type) const { - BOOST_FOREACH (shared_ptr i, text) { + for (auto i: text) { if (i->original_type() == type) { return i; } diff --git a/src/lib/cross_common.cc b/src/lib/cross_common.cc index edc806b58..f8556b1fd 100644 --- a/src/lib/cross_common.cc +++ b/src/lib/cross_common.cc @@ -23,7 +23,6 @@ #include "dcpomatic_log.h" #include "warnings.h" #include -#include DCPOMATIC_DISABLE_WARNINGS #include DCPOMATIC_ENABLE_WARNINGS @@ -38,7 +37,7 @@ Drive::Drive (string xml) cxml::Document doc; doc.read_string (xml); _device = doc.string_child("Device"); - BOOST_FOREACH (cxml::ConstNodePtr i, doc.node_children("MountPoint")) { + for (auto i: doc.node_children("MountPoint")) { _mount_points.push_back (i->content()); } _size = doc.number_child("Size"); @@ -53,7 +52,7 @@ Drive::as_xml () const xmlpp::Document doc; xmlpp::Element* root = doc.create_root_node ("Drive"); root->add_child("Device")->add_child_text(_device); - BOOST_FOREACH (boost::filesystem::path i, _mount_points) { + for (auto i: _mount_points) { root->add_child("MountPoint")->add_child_text(i.string()); } root->add_child("Size")->add_child_text(dcp::raw_convert(_size)); @@ -96,7 +95,7 @@ string Drive::log_summary () const { string mp; - BOOST_FOREACH (boost::filesystem::path i, _mount_points) { + for (auto i: _mount_points) { mp += i.string() + ","; } if (mp.empty()) { diff --git a/src/lib/cross_linux.cc b/src/lib/cross_linux.cc index 247bf4aab..c001cbf35 100644 --- a/src/lib/cross_linux.cc +++ b/src/lib/cross_linux.cc @@ -31,7 +31,6 @@ extern "C" { #include } #include -#include #include #if BOOST_VERSION >= 106100 #include @@ -350,7 +349,7 @@ Drive::get () bool Drive::unmount () { - BOOST_FOREACH (boost::filesystem::path i, _mount_points) { + for (auto i: _mount_points) { int const r = umount(i.string().c_str()); LOG_DISK("Tried to unmount %1 and got %2 and %3", i.string(), r, errno); if (r == -1) { diff --git a/src/lib/cross_osx.cc b/src/lib/cross_osx.cc index 76c451a6f..8b60ff492 100644 --- a/src/lib/cross_osx.cc +++ b/src/lib/cross_osx.cc @@ -31,7 +31,6 @@ extern "C" { #include } #include -#include #include #if BOOST_VERSION >= 106100 #include @@ -331,7 +330,7 @@ analyse_media_path (CFDictionaryRef& description) vector bits; split(bits, path, boost::is_any_of("/")); - BOOST_FOREACH (string i, bits) { + for (auto i: bits) { if (starts_with(i, "PRT")) { mp.prt = i; } @@ -468,11 +467,11 @@ Drive::get () CFRelease(session); /* Mark disks containing mounted partitions as themselves mounted */ - BOOST_FOREACH (Disk& i, disks) { + for (auto& i: disks) { if (!i.whole) { continue; } - BOOST_FOREACH (Disk& j, disks) { + for (auto& j: disks) { if (!j.mount_points.empty() && starts_with(j.mount_point, i.mount_point)) { LOG_DISK("Marking %1 as mounted because %2 is", i.mount_point, j.mount_point); std::copy(j.mount_points.begin(), j.mount_points.end(), back_inserter(i.mount_points)); @@ -482,7 +481,7 @@ Drive::get () /* Make a map of the PRT codes and mount points of mounted, synthesized disks */ map > mounted_synths; - BOOST_FOREACH (Disk& i, disks) { + for (auto& i: disks) { if (!i.real && !i.mount_points.empty()) { LOG_DISK("Found a mounted synth %1 with %2", i.mount_point, i.prt); mounted_synths[i.prt] = i.mount_points; @@ -490,7 +489,7 @@ Drive::get () } /* Mark containers of those mounted synths as themselves mounted */ - BOOST_FOREACH (Disk& i, disks) { + for (auto& i: disks) { if (i.real) { map >::const_iterator j = mounted_synths.find(i.prt); if (j != mounted_synths.end()) { @@ -501,7 +500,7 @@ Drive::get () } vector drives; - BOOST_FOREACH (Disk& i, disks) { + for (auto& i: disks) { if (i.whole) { /* A whole disk that is not a container for a mounted synth */ drives.push_back(Drive(i.mount_point, i.mount_points, i.size, i.vendor, i.model)); diff --git a/src/lib/cross_windows.cc b/src/lib/cross_windows.cc index 1fe555648..0ab56bb6b 100644 --- a/src/lib/cross_windows.cc +++ b/src/lib/cross_windows.cc @@ -31,7 +31,6 @@ extern "C" { #include } #include -#include #include #include #include diff --git a/src/lib/dcp.cc b/src/lib/dcp.cc index 8baf489d1..421dbbf83 100644 --- a/src/lib/dcp.cc +++ b/src/lib/dcp.cc @@ -28,7 +28,6 @@ #include #include #include -#include #include "i18n.h" @@ -46,13 +45,13 @@ DCP::cpls () const list > cpls; LOG_GENERAL ("Reading %1 DCP directories", _dcp_content->directories().size()); - BOOST_FOREACH (boost::filesystem::path i, _dcp_content->directories()) { + for (auto i: _dcp_content->directories()) { shared_ptr dcp (new dcp::DCP (i)); list notes; dcp->read (¬es, true); if (!_tolerant) { /** We accept and ignore EMPTY_ASSET_PATH and EXTERNAL_ASSET but everything else is bad */ - BOOST_FOREACH (dcp::VerificationNote j, notes) { + for (auto j: notes) { if (j.code() == dcp::VerificationNote::EMPTY_ASSET_PATH || j.code() == dcp::VerificationNote::EXTERNAL_ASSET) { LOG_WARNING("Empty path in ASSETMAP of %1", i.string()); } else { @@ -62,13 +61,13 @@ DCP::cpls () const } dcps.push_back (dcp); LOG_GENERAL ("Reading DCP %1: %2 CPLs", i.string(), dcp->cpls().size()); - BOOST_FOREACH (shared_ptr i, dcp->cpls()) { + for (auto i: dcp->cpls()) { cpls.push_back (i); } } - BOOST_FOREACH (shared_ptr i, dcps) { - BOOST_FOREACH (shared_ptr j, dcps) { + for (auto i: dcps) { + for (auto j: dcps) { if (i != j) { i->resolve_refs (j->assets (true)); } @@ -77,7 +76,7 @@ DCP::cpls () const if (_dcp_content->kdm ()) { dcp::DecryptedKDM k = decrypt_kdm_with_helpful_error (_dcp_content->kdm().get()); - BOOST_FOREACH (shared_ptr i, dcps) { + for (auto i: dcps) { i->add (k); } } diff --git a/src/lib/dcp_content.cc b/src/lib/dcp_content.cc index d4bd58e58..e43d88a34 100644 --- a/src/lib/dcp_content.cc +++ b/src/lib/dcp_content.cc @@ -40,7 +40,6 @@ #include #include #include -#include #include #include @@ -151,19 +150,19 @@ DCPContent::DCPContent (cxml::ConstNodePtr node, int version) _content_kind = dcp::content_kind_from_string (*ck); } _cpl = node->optional_string_child("CPL"); - BOOST_FOREACH (cxml::ConstNodePtr i, node->node_children("ReelLength")) { + for (auto i: node->node_children("ReelLength")) { _reel_lengths.push_back (raw_convert (i->content ())); } - BOOST_FOREACH (cxml::ConstNodePtr i, node->node_children("Marker")) { + for (auto i: node->node_children("Marker")) { _markers[dcp::marker_from_string(i->string_attribute("type"))] = ContentTime(raw_convert(i->content())); } - BOOST_FOREACH (cxml::ConstNodePtr i, node->node_children("Rating")) { + for (auto i: node->node_children("Rating")) { _ratings.push_back (dcp::Rating(i)); } - BOOST_FOREACH (cxml::ConstNodePtr i, node->node_children("ContentVersion")) { + for (auto i: node->node_children("ContentVersion")) { _content_versions.push_back (i->content()); } } @@ -352,7 +351,7 @@ DCPContent::as_xml (xmlpp::Node* node, bool with_paths) const audio->stream()->mapping().as_xml (node->add_child("AudioMapping")); } - BOOST_FOREACH (shared_ptr i, text) { + for (auto i: text) { i->as_xml (node); } @@ -391,7 +390,7 @@ DCPContent::as_xml (xmlpp::Node* node, bool with_paths) const if (_cpl) { node->add_child("CPL")->add_child_text (_cpl.get ()); } - BOOST_FOREACH (int64_t i, _reel_lengths) { + for (auto i: _reel_lengths) { node->add_child("ReelLength")->add_child_text (raw_convert (i)); } @@ -401,12 +400,12 @@ DCPContent::as_xml (xmlpp::Node* node, bool with_paths) const marker->add_child_text(raw_convert(i->second.get())); } - BOOST_FOREACH (dcp::Rating i, _ratings) { + for (auto i: _ratings) { xmlpp::Element* rating = node->add_child("Rating"); i.as_xml (rating); } - BOOST_FOREACH (string i, _content_versions) { + for (auto i: _content_versions) { node->add_child("ContentVersion")->add_child_text(i); } } @@ -439,7 +438,7 @@ DCPContent::identifier () const s += video->identifier() + "_"; } - BOOST_FOREACH (shared_ptr i, text) { + for (auto i: text) { s += i->identifier () + " "; } @@ -566,7 +565,7 @@ DCPContent::reels (shared_ptr film) const /* The starting point of this content on the timeline */ DCPTime pos = position() - DCPTime (trim_start().get()); - BOOST_FOREACH (int64_t i, reel_lengths) { + for (auto i: reel_lengths) { /* This reel runs from `pos' to `to' */ DCPTime const to = pos + DCPTime::from_frames (i, film->video_frame_rate()); if (to > position()) { @@ -585,7 +584,7 @@ list DCPContent::reel_split_points (shared_ptr film) const { list s; - BOOST_FOREACH (DCPTimePeriod i, reels(film)) { + for (auto i: reels(film)) { s.push_back (i.from); } return s; @@ -630,7 +629,7 @@ DCPContent::can_reference (shared_ptr film, function film, string& why_not) c return false; } - BOOST_FOREACH (shared_ptr i, decoder->reels()) { + for (auto i: decoder->reels()) { if (!i->main_sound()) { /// TRANSLATORS: this string will follow "Cannot reference this DCP: " why_not = _("it does not have sound in all its reels."); @@ -735,7 +734,7 @@ DCPContent::can_reference_text (shared_ptr film, TextType type, stri return false; } - BOOST_FOREACH (shared_ptr i, decoder->reels()) { + for (auto i: decoder->reels()) { if (type == TEXT_OPEN_SUBTITLE) { if (!i->main_subtitle()) { /// TRANSLATORS: this string will follow "Cannot reference this DCP: " @@ -753,7 +752,7 @@ DCPContent::can_reference_text (shared_ptr film, TextType type, stri why_not = _("it does not have closed captions in all its reels."); return false; } - BOOST_FOREACH (shared_ptr j, i->closed_captions()) { + for (auto j: i->closed_captions()) { if (j->entry_point().get_value_or(0) != 0) { /// TRANSLATORS: this string will follow "Cannot reference this DCP: " why_not = _("one if its closed caption has a non-zero entry point so it must be re-written."); diff --git a/src/lib/dcp_content_type.cc b/src/lib/dcp_content_type.cc index 4fedd366c..c31c507b0 100644 --- a/src/lib/dcp_content_type.cc +++ b/src/lib/dcp_content_type.cc @@ -24,7 +24,6 @@ #include "dcp_content_type.h" #include "dcpomatic_assert.h" -#include #include "i18n.h" @@ -60,7 +59,7 @@ DCPContentType::setup_dcp_content_types () DCPContentType const * DCPContentType::from_isdcf_name (string n) { - BOOST_FOREACH (DCPContentType const * i, _dcp_content_types) { + for (auto i: _dcp_content_types) { if (i->isdcf_name() == n) { return i; } @@ -72,7 +71,7 @@ DCPContentType::from_isdcf_name (string n) DCPContentType const * DCPContentType::from_libdcp_kind (dcp::ContentKind kind) { - BOOST_FOREACH (DCPContentType const * i, _dcp_content_types) { + for (auto i: _dcp_content_types) { if (i->libdcp_kind() == kind) { return i; } diff --git a/src/lib/dcp_decoder.cc b/src/lib/dcp_decoder.cc index aa8fed2b4..71eb0bae0 100644 --- a/src/lib/dcp_decoder.cc +++ b/src/lib/dcp_decoder.cc @@ -49,7 +49,6 @@ #include #include #include -#include #include #include "i18n.h" @@ -76,7 +75,7 @@ DCPDecoder::DCPDecoder (shared_ptr film, shared_ptraudio) { audio.reset (new AudioDecoder (this, c->audio, fast)); } - BOOST_FOREACH (shared_ptr i, c->text) { + for (auto i: c->text) { /* XXX: this time here should be the time of the first subtitle, not 0 */ text.push_back (shared_ptr (new TextDecoder (this, i, ContentTime()))); } @@ -106,7 +105,7 @@ DCPDecoder::DCPDecoder (shared_ptr film, shared_ptr cpl; - BOOST_FOREACH (shared_ptr i, cpl_list) { + for (auto i: cpl_list) { if (_dcp_content->cpl() && i->id() == _dcp_content->cpl().get()) { cpl = i; } @@ -263,7 +262,7 @@ DCPDecoder::pass_texts (ContentTime next, dcp::Size size) ++decoder; } - BOOST_FOREACH (shared_ptr i, (*_reel)->closed_captions()) { + for (auto i: (*_reel)->closed_captions()) { pass_texts ( next, i->asset(), _dcp_content->reference_text(TEXT_CLOSED_CAPTION), i->entry_point().get_value_or(0), *decoder, size ); @@ -289,7 +288,7 @@ DCPDecoder::pass_texts ( list strings; - BOOST_FOREACH (shared_ptr i, subs) { + for (auto i: subs) { shared_ptr is = dynamic_pointer_cast (i); if (is) { if (!strings.empty() && (strings.back().in() != is->in() || strings.back().out() != is->out())) { @@ -471,7 +470,7 @@ string DCPDecoder::calculate_lazy_digest (shared_ptr c) const { Digester d; - BOOST_FOREACH (boost::filesystem::path i, c->paths()) { + for (auto i: c->paths()) { d.add (i.string()); } if (_dcp_content->kdm()) { @@ -495,7 +494,7 @@ vector DCPDecoder::fonts () const { vector data; - BOOST_FOREACH (shared_ptr i, _reels) { + for (auto i: _reels) { if (i->main_subtitle() && i->main_subtitle()->asset()) { map fm = i->main_subtitle()->asset()->font_data(); for (map::const_iterator j = fm.begin(); j != fm.end(); ++j) { diff --git a/src/lib/dcp_encoder.cc b/src/lib/dcp_encoder.cc index dfd8ed8d7..0478fcf80 100644 --- a/src/lib/dcp_encoder.cc +++ b/src/lib/dcp_encoder.cc @@ -38,7 +38,6 @@ #include "text_content.h" #include "player_video.h" #include -#include #include #include "i18n.h" @@ -70,8 +69,8 @@ DCPEncoder::DCPEncoder (shared_ptr film, weak_ptr job) _player_text_connection = _player->Text.connect (bind (&DCPEncoder::text, this, _1, _2, _3, _4)); _player_atmos_connection = _player->Atmos.connect (bind (&DCPEncoder::atmos, this, _1, _2, _3)); - BOOST_FOREACH (shared_ptr c, film->content ()) { - BOOST_FOREACH (shared_ptr i, c->text) { + for (auto c: film->content ()) { + for (auto i: c->text) { if (i->use() && !i->burn()) { _non_burnt_subtitles = true; } @@ -120,7 +119,7 @@ DCPEncoder::go () while (!_player->pass ()) {} - BOOST_FOREACH (ReferencedReelAsset i, _player->get_reel_assets ()) { + for (auto i: _player->get_reel_assets()) { _writer->write (i); } diff --git a/src/lib/dcp_examiner.cc b/src/lib/dcp_examiner.cc index fc1fbc53a..191022f12 100644 --- a/src/lib/dcp_examiner.cc +++ b/src/lib/dcp_examiner.cc @@ -44,7 +44,6 @@ #include #include #include -#include #include #include "i18n.h" @@ -77,7 +76,7 @@ DCPExaminer::DCPExaminer (shared_ptr content, bool tolerant) if (content->cpl ()) { /* Use the CPL that the content was using before */ - BOOST_FOREACH (shared_ptr i, cpls()) { + for (auto i: cpls()) { if (i->id() == content->cpl().get()) { cpl = i; } @@ -87,9 +86,9 @@ DCPExaminer::DCPExaminer (shared_ptr content, bool tolerant) int least_unsatisfied = INT_MAX; - BOOST_FOREACH (shared_ptr i, cpls()) { + for (auto i: cpls()) { int unsatisfied = 0; - BOOST_FOREACH (shared_ptr j, i->reels()) { + for (auto j: i->reels()) { if (j->main_picture() && !j->main_picture()->asset_ref().resolved()) { ++unsatisfied; } @@ -119,7 +118,7 @@ DCPExaminer::DCPExaminer (shared_ptr content, bool tolerant) _name = cpl->content_title_text (); _content_kind = cpl->content_kind (); - BOOST_FOREACH (shared_ptr i, cpl->reels()) { + for (auto i: cpl->reels()) { if (i->main_picture ()) { if (!i->main_picture()->asset_ref().resolved()) { @@ -182,7 +181,7 @@ DCPExaminer::DCPExaminer (shared_ptr content, bool tolerant) _text_count[TEXT_OPEN_SUBTITLE] = 1; } - BOOST_FOREACH (shared_ptr j, i->closed_captions()) { + for (auto j: i->closed_captions()) { if (!j->asset_ref().resolved()) { /* We are missing this asset so we can't continue; examination will be repeated later */ _needs_assets = true; @@ -225,7 +224,7 @@ DCPExaminer::DCPExaminer (shared_ptr content, bool tolerant) /* Check that we can read the first picture, sound and subtitle frames of each reel */ try { - BOOST_FOREACH (shared_ptr i, cpl->reels()) { + for (auto i: cpl->reels()) { shared_ptr pic = i->main_picture()->asset (); shared_ptr mono = dynamic_pointer_cast (pic); shared_ptr stereo = dynamic_pointer_cast (pic); @@ -260,7 +259,7 @@ DCPExaminer::DCPExaminer (shared_ptr content, bool tolerant) _three_d = !cpl->reels().empty() && cpl->reels().front()->main_picture() && dynamic_pointer_cast (cpl->reels().front()->main_picture()->asset()); _ratings = cpl->ratings(); - BOOST_FOREACH (dcp::ContentVersion i, cpl->content_versions()) { + for (auto i: cpl->content_versions()) { _content_versions.push_back (i.label_text); } diff --git a/src/lib/dcp_subtitle_content.cc b/src/lib/dcp_subtitle_content.cc index d58779ee2..2c5d98e49 100644 --- a/src/lib/dcp_subtitle_content.cc +++ b/src/lib/dcp_subtitle_content.cc @@ -27,7 +27,6 @@ #include #include #include -#include #include "i18n.h" @@ -73,7 +72,7 @@ DCPSubtitleContent::examine (shared_ptr film, shared_ptr job) sc->fix_empty_font_ids (); - BOOST_FOREACH (shared_ptr i, sc->load_font_nodes ()) { + for (auto i: sc->load_font_nodes()) { only_text()->add_font (shared_ptr (new Font (i->id))); } } diff --git a/src/lib/dcp_subtitle_decoder.cc b/src/lib/dcp_subtitle_decoder.cc index 5c14b7885..5372df0a5 100644 --- a/src/lib/dcp_subtitle_decoder.cc +++ b/src/lib/dcp_subtitle_decoder.cc @@ -54,7 +54,7 @@ DCPSubtitleDecoder::DCPSubtitleDecoder (shared_ptr film, shared_ptr< } /* Add a default font for any LoadFont nodes in our file which we haven't yet found fonts for */ - BOOST_FOREACH (shared_ptr i, c->load_font_nodes()) { + for (auto i: c->load_font_nodes()) { if (fm.find(i->id) == fm.end()) { _fonts.push_back (FontData(i->id, dcp::ArrayData(default_font_file()))); } diff --git a/src/lib/dcpomatic_time.h b/src/lib/dcpomatic_time.h index 897b725bd..62d8a28cc 100644 --- a/src/lib/dcpomatic_time.h +++ b/src/lib/dcpomatic_time.h @@ -28,7 +28,6 @@ #include "frame_rate_change.h" #include "dcpomatic_assert.h" #include -#include #include #include #include @@ -319,9 +318,9 @@ std::list > subtract (TimePeriod A, std::list > c std::list > result; result.push_back (A); - BOOST_FOREACH (TimePeriod i, B) { + for (auto i: B) { std::list > new_result; - BOOST_FOREACH (TimePeriod j, result) { + for (auto j: result) { boost::optional > ov = i.overlap (j); if (ov) { if (*ov == i) { diff --git a/src/lib/decoder.cc b/src/lib/decoder.cc index a53118061..bf0bd1a26 100644 --- a/src/lib/decoder.cc +++ b/src/lib/decoder.cc @@ -60,7 +60,7 @@ Decoder::position () const which can cause bugs like #1581. */ if (!pos) { - BOOST_FOREACH (shared_ptr i, text) { + for (auto i: text) { if (!i->ignore() && (!pos || i->position(f) < *pos)) { pos = i->position(f); } @@ -79,7 +79,7 @@ Decoder::seek (ContentTime, bool) if (audio) { audio->seek (); } - BOOST_FOREACH (shared_ptr i, text) { + for (auto i: text) { i->seek (); } } diff --git a/src/lib/decoder_factory.cc b/src/lib/decoder_factory.cc index f68a443b5..1acef6f4f 100644 --- a/src/lib/decoder_factory.cc +++ b/src/lib/decoder_factory.cc @@ -33,7 +33,6 @@ #include "video_mxf_content.h" #include "video_mxf_decoder.h" #include "timer.h" -#include using std::list; using std::shared_ptr; diff --git a/src/lib/dkdm_recipient.cc b/src/lib/dkdm_recipient.cc index a12d95a4c..22da53f3b 100644 --- a/src/lib/dkdm_recipient.cc +++ b/src/lib/dkdm_recipient.cc @@ -22,7 +22,6 @@ #include "kdm_with_metadata.h" #include "film.h" #include -#include using std::string; @@ -34,7 +33,7 @@ using dcp::raw_convert; DKDMRecipient::DKDMRecipient (cxml::ConstNodePtr node) : KDMRecipient (node) { - BOOST_FOREACH (cxml::ConstNodePtr i, node->node_children("Email")) { + for (auto i: node->node_children("Email")) { emails.push_back (i->content()); } @@ -48,7 +47,7 @@ DKDMRecipient::as_xml (xmlpp::Element* node) const { KDMRecipient::as_xml (node); - BOOST_FOREACH (string i, emails) { + for (auto i: emails) { node->add_child("Email")->add_child_text(i); } diff --git a/src/lib/dkdm_wrapper.cc b/src/lib/dkdm_wrapper.cc index 66f67114d..74a71966e 100644 --- a/src/lib/dkdm_wrapper.cc +++ b/src/lib/dkdm_wrapper.cc @@ -25,7 +25,6 @@ DCPOMATIC_DISABLE_WARNINGS #include DCPOMATIC_ENABLE_WARNINGS -#include using std::string; using std::list; @@ -39,7 +38,7 @@ DKDMBase::read (cxml::ConstNodePtr node) return shared_ptr (new DKDM (dcp::EncryptedKDM (node->content ()))); } else if (node->name() == "DKDMGroup") { shared_ptr group (new DKDMGroup (node->string_attribute ("Name"))); - BOOST_FOREACH (cxml::ConstNodePtr i, node->node_children()) { + for (auto i: node->node_children()) { shared_ptr c = read (i); if (c) { group->add (c); @@ -68,7 +67,7 @@ DKDMGroup::as_xml (xmlpp::Element* node) const { xmlpp::Element* f = node->add_child("DKDMGroup"); f->set_attribute ("Name", _name); - BOOST_FOREACH (shared_ptr i, _children) { + for (auto i: _children) { i->as_xml (f); } } diff --git a/src/lib/emailer.cc b/src/lib/emailer.cc index b7cae7079..c4637ff0d 100644 --- a/src/lib/emailer.cc +++ b/src/lib/emailer.cc @@ -25,7 +25,6 @@ #include #include #include -#include #include "i18n.h" @@ -144,7 +143,7 @@ Emailer::send (string server, int port, EmailProtocol protocol, string user, str _email += _body; - BOOST_FOREACH (Attachment i, _attachments) { + for (auto i: _attachments) { _email += "\r\n\r\n--" + boundary + "\r\n" "Content-Type: " + i.mime_type + "; name=" + i.name + "\r\n" "Content-Transfer-Encoding: Base64\r\n" @@ -194,13 +193,13 @@ Emailer::send (string server, int port, EmailProtocol protocol, string user, str curl_easy_setopt (curl, CURLOPT_MAIL_FROM, _from.c_str()); struct curl_slist* recipients = 0; - BOOST_FOREACH (string i, _to) { + for (auto i: _to) { recipients = curl_slist_append (recipients, i.c_str()); } - BOOST_FOREACH (string i, _cc) { + for (auto i: _cc) { recipients = curl_slist_append (recipients, i.c_str()); } - BOOST_FOREACH (string i, _bcc) { + for (auto i: _bcc) { recipients = curl_slist_append (recipients, i.c_str()); } @@ -233,7 +232,7 @@ string Emailer::address_list (list addresses) { string o; - BOOST_FOREACH (string i, addresses) { + for (auto i: addresses) { o += i + ", "; } diff --git a/src/lib/empty.cc b/src/lib/empty.cc index 00baaeb14..0cf2b85dc 100644 --- a/src/lib/empty.cc +++ b/src/lib/empty.cc @@ -26,7 +26,6 @@ #include "dcp_content.h" #include "dcpomatic_time_coalesce.h" #include "piece.h" -#include #include using std::cout; @@ -39,7 +38,7 @@ using namespace dcpomatic; Empty::Empty (shared_ptr film, shared_ptr playlist, function)> part, DCPTime length) { list full; - BOOST_FOREACH (shared_ptr i, playlist->content()) { + for (auto i: playlist->content()) { if (part(i)) { full.push_back (DCPTimePeriod (i->position(), i->end(film))); } @@ -57,13 +56,13 @@ Empty::set_position (DCPTime position) { _position = position; - BOOST_FOREACH (DCPTimePeriod i, _periods) { + for (auto i: _periods) { if (i.contains(_position)) { return; } } - BOOST_FOREACH (DCPTimePeriod i, _periods) { + for (auto i: _periods) { if (i.from > _position) { _position = i.from; return; @@ -74,7 +73,7 @@ Empty::set_position (DCPTime position) DCPTimePeriod Empty::period_at_position () const { - BOOST_FOREACH (DCPTimePeriod i, _periods) { + for (auto i: _periods) { if (i.contains(_position)) { return DCPTimePeriod (_position, i.to); } @@ -87,7 +86,7 @@ bool Empty::done () const { DCPTime latest; - BOOST_FOREACH (DCPTimePeriod i, _periods) { + for (auto i: _periods) { latest = max (latest, i.to); } diff --git a/src/lib/encode_server.cc b/src/lib/encode_server.cc index a14578a6b..6ec3e701c 100644 --- a/src/lib/encode_server.cc +++ b/src/lib/encode_server.cc @@ -44,7 +44,6 @@ DCPOMATIC_DISABLE_WARNINGS DCPOMATIC_ENABLE_WARNINGS #include #include -#include #ifdef HAVE_VALGRIND_H #include #endif diff --git a/src/lib/encode_server_finder.cc b/src/lib/encode_server_finder.cc index 5a5a2bfb7..396d67623 100644 --- a/src/lib/encode_server_finder.cc +++ b/src/lib/encode_server_finder.cc @@ -122,7 +122,7 @@ try } /* Query our `definite' servers (if there are any) */ - BOOST_FOREACH (string const& i, Config::instance()->servers()) { + for (auto const& i: Config::instance()->servers()) { try { boost::asio::ip::udp::resolver resolver (io_service); boost::asio::ip::udp::resolver::query query (i, raw_convert (HELLO_PORT)); diff --git a/src/lib/ext.cc b/src/lib/ext.cc index 751bab5aa..086afd91e 100644 --- a/src/lib/ext.cc +++ b/src/lib/ext.cc @@ -57,7 +57,6 @@ extern "C" { #include } #include -#include #include @@ -246,7 +245,7 @@ void verify (vector const& copied_files, uint64_t total, Nanomsg* nanomsg) { uint64_t total_remaining = total; - BOOST_FOREACH (CopiedFile const& i, copied_files) { + for (auto const& i: copied_files) { string const read_digest = read (i.from, i.to, total_remaining, total, nanomsg); LOG_DISK ("Read %1 %2 was %3 on write, now %4", i.from.string(), i.to.generic_string(), i.write_digest, read_digest); if (read_digest != i.write_digest) { diff --git a/src/lib/ffmpeg.cc b/src/lib/ffmpeg.cc index 11a332bdb..85c65763f 100644 --- a/src/lib/ffmpeg.cc +++ b/src/lib/ffmpeg.cc @@ -37,7 +37,6 @@ extern "C" { #include } #include -#include #include #include "i18n.h" @@ -314,7 +313,7 @@ FFmpeg::pts_offset (vector > audio_streams, option po = - first_video.get (); } - BOOST_FOREACH (shared_ptr i, audio_streams) { + for (auto i: audio_streams) { if (i->first_audio) { po = max (po, - i->first_audio.get ()); } diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc index 6f3aceff8..234c792fd 100644 --- a/src/lib/ffmpeg_content.cc +++ b/src/lib/ffmpeg_content.cc @@ -41,7 +41,6 @@ extern "C" { #include } #include -#include #include #include "i18n.h" @@ -202,7 +201,7 @@ FFmpegContent::as_xml (xmlpp::Node* node, bool with_paths) const if (audio) { audio->as_xml (node); - BOOST_FOREACH (AudioStreamPtr i, audio->streams ()) { + for (auto i: audio->streams ()) { shared_ptr f = dynamic_pointer_cast (i); DCPOMATIC_ASSERT (f); f->as_xml (node->add_child("AudioStream")); @@ -296,7 +295,7 @@ FFmpegContent::examine (shared_ptr film, shared_ptr job) if (!examiner->audio_streams().empty ()) { audio.reset (new AudioContent (this)); - BOOST_FOREACH (shared_ptr i, examiner->audio_streams ()) { + for (auto i: examiner->audio_streams ()) { audio->add_stream (i); } @@ -345,7 +344,7 @@ string FFmpegContent::technical_summary () const { string as = ""; - BOOST_FOREACH (shared_ptr i, ffmpeg_audio_streams ()) { + for (auto i: ffmpeg_audio_streams ()) { as += i->technical_summary () + " " ; } @@ -408,7 +407,7 @@ FFmpegContent::full_length (shared_ptr film) const if (audio) { DCPTime longest; - BOOST_FOREACH (AudioStreamPtr i, audio->streams()) { + for (auto i: audio->streams()) { longest = max (longest, DCPTime::from_frames(llrint(i->length() / frc.speed_up), i->frame_rate())); } return longest; @@ -429,7 +428,7 @@ FFmpegContent::approximate_length () const DCPOMATIC_ASSERT (audio); Frame longest = 0; - BOOST_FOREACH (AudioStreamPtr i, audio->streams ()) { + for (auto i: audio->streams()) { longest = max (longest, Frame(llrint(i->length()))); } @@ -670,7 +669,7 @@ FFmpegContent::ffmpeg_audio_streams () const vector > fa; if (audio) { - BOOST_FOREACH (AudioStreamPtr i, audio->streams()) { + for (auto i: audio->streams()) { fa.push_back (dynamic_pointer_cast (i)); } } diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc index ae4ab237f..b050fc594 100644 --- a/src/lib/ffmpeg_decoder.cc +++ b/src/lib/ffmpeg_decoder.cc @@ -51,7 +51,6 @@ extern "C" { #include #include } -#include #include #include #include @@ -134,7 +133,7 @@ FFmpegDecoder::flush () } } - BOOST_FOREACH (shared_ptr i, _ffmpeg_content->ffmpeg_audio_streams ()) { + for (auto i: _ffmpeg_content->ffmpeg_audio_streams ()) { ContentTime a = audio->stream_position(film(), i); /* Unfortunately if a is 0 that really means that we don't know the stream position since there has been no data on it since the last seek. In this case we'll just do nothing @@ -400,7 +399,7 @@ FFmpegDecoder::seek (ContentTime time, bool accurate) } DCPOMATIC_DISABLE_WARNINGS - BOOST_FOREACH (shared_ptr i, ffmpeg_content()->ffmpeg_audio_streams()) { + for (auto i: ffmpeg_content()->ffmpeg_audio_streams()) { avcodec_flush_buffers (i->stream(_format_context)->codec); } DCPOMATIC_ENABLE_WARNINGS @@ -411,7 +410,7 @@ DCPOMATIC_ENABLE_WARNINGS _have_current_subtitle = false; - BOOST_FOREACH (optional& i, _next_time) { + for (auto& i: _next_time) { i = optional(); } } @@ -744,7 +743,7 @@ FFmpegDecoder::decode_ass_subtitle (string ass, ContentTime from) _ffmpeg_content->video->size().height ); - BOOST_FOREACH (sub::Subtitle const & i, sub::collect > (raw)) { + for (auto const& i: sub::collect > (raw)) { only_text()->emit_plain_start (from, i); } } diff --git a/src/lib/ffmpeg_encoder.cc b/src/lib/ffmpeg_encoder.cc index 4e1f0bcb5..cc4f18bb6 100644 --- a/src/lib/ffmpeg_encoder.cc +++ b/src/lib/ffmpeg_encoder.cc @@ -212,7 +212,7 @@ FFmpegEncoder::go () } delete[] interleaved; - BOOST_FOREACH (FileEncoderSet i, file_encoders) { + for (auto i: file_encoders) { i.flush (); } } diff --git a/src/lib/ffmpeg_examiner.cc b/src/lib/ffmpeg_examiner.cc index b75d6c514..23c2f1a72 100644 --- a/src/lib/ffmpeg_examiner.cc +++ b/src/lib/ffmpeg_examiner.cc @@ -36,7 +36,6 @@ extern "C" { #include } DCPOMATIC_ENABLE_WARNINGS -#include #include #include "i18n.h" diff --git a/src/lib/ffmpeg_file_encoder.cc b/src/lib/ffmpeg_file_encoder.cc index 99637564a..0eea003a9 100644 --- a/src/lib/ffmpeg_file_encoder.cc +++ b/src/lib/ffmpeg_file_encoder.cc @@ -385,7 +385,7 @@ DCPOMATIC_ENABLE_WARNINGS av_packet_unref (&packet); flushed_audio = true; - BOOST_FOREACH (shared_ptr i, _audio_streams) { + for (auto i: _audio_streams) { if (!i->flush()) { flushed_audio = false; } @@ -473,7 +473,7 @@ FFmpegFileEncoder::audio_frame (int size) { if (_audio_stream_per_channel) { int offset = 0; - BOOST_FOREACH (shared_ptr i, _audio_streams) { + for (auto i: _audio_streams) { i->write (size, offset, 1, _pending_audio->data(), _audio_frames); ++offset; } diff --git a/src/lib/ffmpeg_subtitle_stream.cc b/src/lib/ffmpeg_subtitle_stream.cc index 72698fa51..e500dd35b 100644 --- a/src/lib/ffmpeg_subtitle_stream.cc +++ b/src/lib/ffmpeg_subtitle_stream.cc @@ -24,7 +24,6 @@ DCPOMATIC_DISABLE_WARNINGS #include DCPOMATIC_ENABLE_WARNINGS -#include #include using std::string; @@ -43,7 +42,7 @@ FFmpegSubtitleStream::FFmpegSubtitleStream (cxml::ConstNodePtr node, int version { if (version >= 33) { boost::mutex::scoped_lock lm (_mutex); - BOOST_FOREACH (cxml::NodePtr i, node->node_children ("Colour")) { + for (auto i: node->node_children ("Colour")) { _colours[RGBA(i->node_child("From"))] = RGBA (i->node_child("To")); } } diff --git a/src/lib/film.cc b/src/lib/film.cc index 68e5c1c1f..8bcbaebe5 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -69,7 +69,6 @@ #include #include #include -#include #include #include #include @@ -220,11 +219,11 @@ Film::Film (optional dir) Film::~Film () { - BOOST_FOREACH (boost::signals2::connection& i, _job_connections) { + for (auto& i: _job_connections) { i.disconnect (); } - BOOST_FOREACH (boost::signals2::connection& i, _audio_analysis_connections) { + for (auto& i: _audio_analysis_connections) { i.disconnect (); } } @@ -288,7 +287,7 @@ Film::audio_analysis_path (shared_ptr playlist) const boost::filesystem::path p = dir ("analysis"); Digester digester; - BOOST_FOREACH (shared_ptr i, playlist->content ()) { + for (auto i: playlist->content ()) { if (!i->audio) { continue; } @@ -329,7 +328,7 @@ Film::subtitle_analysis_path (shared_ptr content) const shared_ptr tc = content->text.front(); digester.add (tc->x_scale()); digester.add (tc->y_scale()); - BOOST_FOREACH (shared_ptr i, tc->fonts()) { + for (auto i: tc->fonts()) { digester.add (i->id()); } if (tc->effect()) { @@ -380,7 +379,7 @@ Film::make_dcp (bool gui, bool check) set_name ("DCP"); } - BOOST_FOREACH (shared_ptr i, content ()) { + for (auto i: content ()) { if (!i->paths_valid()) { throw runtime_error (_("some of your content is missing")); } @@ -395,11 +394,11 @@ Film::make_dcp (bool gui, bool check) set_isdcf_date_today (); - BOOST_FOREACH (string i, environment_info ()) { + for (auto i: environment_info ()) { LOG_GENERAL_NC (i); } - BOOST_FOREACH (shared_ptr i, content ()) { + for (auto i: content ()) { LOG_GENERAL ("Content: %1", i->technical_summary()); } LOG_GENERAL ("DCP video rate %1 fps", video_frame_rate()); @@ -470,10 +469,10 @@ Film::metadata (bool with_content_paths) const m->set_attribute("Type", dcp::marker_to_string(i->first)); m->add_child_text(raw_convert(i->second.get())); } - BOOST_FOREACH (dcp::Rating i, _ratings) { + for (auto i: _ratings) { i.as_xml (root->add_child("Rating")); } - BOOST_FOREACH (string i, _content_versions) { + for (auto i: _content_versions) { root->add_child("ContentVersion")->add_child_text(i); } root->add_child("NameLanguage")->add_child_text(_name_language.to_string()); @@ -488,7 +487,7 @@ Film::metadata (bool with_content_paths) const root->add_child("LuminanceUnit")->add_child_text(dcp::Luminance::unit_to_string(_luminance.unit())); root->add_child("UserExplicitContainer")->add_child_text(_user_explicit_container ? "1" : "0"); root->add_child("UserExplicitResolution")->add_child_text(_user_explicit_resolution ? "1" : "0"); - BOOST_FOREACH (dcp::LanguageTag i, _subtitle_languages) { + for (auto i: _subtitle_languages) { root->add_child("SubtitleLanguage")->add_child_text(i.to_string()); } _playlist->as_xml (root->add_child ("Playlist"), with_content_paths); @@ -628,15 +627,15 @@ Film::read_metadata (optional path) _reencode_j2k = f.optional_bool_child("ReencodeJ2K").get_value_or(false); _user_explicit_video_frame_rate = f.optional_bool_child("UserExplicitVideoFrameRate").get_value_or(false); - BOOST_FOREACH (cxml::ConstNodePtr i, f.node_children("Marker")) { + for (auto i: f.node_children("Marker")) { _markers[dcp::marker_from_string(i->string_attribute("Type"))] = DCPTime(dcp::raw_convert(i->content())); } - BOOST_FOREACH (cxml::ConstNodePtr i, f.node_children("Rating")) { + for (auto i: f.node_children("Rating")) { _ratings.push_back (dcp::Rating(i)); } - BOOST_FOREACH (cxml::ConstNodePtr i, f.node_children("ContentVersion")) { + for (auto i: f.node_children("ContentVersion")) { _content_versions.push_back (i->content()); } @@ -674,7 +673,7 @@ Film::read_metadata (optional path) _user_explicit_container = f.optional_bool_child("UserExplicitContainer").get_value_or(true); _user_explicit_resolution = f.optional_bool_child("UserExplicitResolution").get_value_or(true); - BOOST_FOREACH (cxml::ConstNodePtr i, f.node_children("SubtitleLanguage")) { + for (auto i: f.node_children("SubtitleLanguage")) { _subtitle_languages.push_back (dcp::LanguageTag(i->content())); } @@ -693,7 +692,7 @@ Film::read_metadata (optional path) optional found_language; - BOOST_FOREACH (cxml::ConstNodePtr i, f.node_child("Playlist")->node_children("Content")) { + for (auto i: f.node_child("Playlist")->node_children("Content")) { cxml::ConstNodePtr text = i->optional_node_child("Text"); if (text && text->optional_string_child("Language") && !found_language) { try { @@ -773,7 +772,7 @@ Film::mapped_audio_channels () const mapped.push_back (i); } } else { - BOOST_FOREACH (shared_ptr i, content ()) { + for (auto i: content ()) { if (i->audio) { list c = i->audio->mapping().mapped_output_channels (); copy (c.begin(), c.end(), back_inserter (mapped)); @@ -884,7 +883,7 @@ Film::isdcf_name (bool if_created_now) const /* Interior aspect ratio. The standard says we don't do this for trailers, for some strange reason */ if (dcp_content_type() && dcp_content_type()->libdcp_kind() != dcp::TRAILER) { Ratio const * content_ratio = 0; - BOOST_FOREACH (shared_ptr i, content ()) { + for (auto i: content ()) { if (i->video) { /* Here's the first piece of video content */ content_ratio = Ratio::nearest_from_ratio(i->video->scaled_size(frame_size()).ratio()); @@ -907,8 +906,8 @@ Film::isdcf_name (bool if_created_now) const bool burnt_in = true; bool ccap = false; - BOOST_FOREACH (shared_ptr i, content()) { - BOOST_FOREACH (shared_ptr j, i->text) { + for (auto i: content()) { + for (auto j: i->text) { if (j->type() == TEXT_OPEN_SUBTITLE && j->use() && !j->burn()) { burnt_in = false; } else if (j->type() == TEXT_CLOSED_CAPTION && j->use()) { @@ -989,7 +988,7 @@ Film::isdcf_name (bool if_created_now) const } bool vf = false; - BOOST_FOREACH (shared_ptr i, content ()) { + for (auto i: content()) { shared_ptr dc = dynamic_pointer_cast (i); if (!dc) { continue; @@ -1345,7 +1344,7 @@ Film::add_content (shared_ptr c) if (_template_film) { /* Take settings from the first piece of content of c's type in _template */ - BOOST_FOREACH (shared_ptr i, _template_film->content()) { + for (auto i: _template_film->content()) { c->take_settings_from (i); } } @@ -1365,7 +1364,7 @@ Film::maybe_set_container_and_resolution () { /* Get the only piece of video content, if there is only one */ shared_ptr video; - BOOST_FOREACH (shared_ptr i, _playlist->content()) { + for (auto i: _playlist->content()) { if (i->video) { if (!video) { video = i->video; @@ -1490,7 +1489,7 @@ void Film::check_settings_consistency () { optional atmos_rate; - BOOST_FOREACH (shared_ptr i, content()) { + for (auto i: content()) { if (i->atmos) { int rate = lrintf (i->atmos->edit_rate().as_float()); @@ -1505,7 +1504,7 @@ Film::check_settings_consistency () } bool change_made = false; - BOOST_FOREACH (shared_ptr i, content()) { + for (auto i: content()) { shared_ptr d = dynamic_pointer_cast(i); if (!d) { continue; @@ -1593,7 +1592,7 @@ Film::active_area () const dcp::Size const frame = frame_size (); dcp::Size active; - BOOST_FOREACH (shared_ptr i, content()) { + for (auto i: content()) { if (i->video) { dcp::Size s = i->video->scaled_size (frame); active.width = max(active.width, s.width); @@ -1639,7 +1638,7 @@ Film::make_kdm ( /* Find keys that have been added to imported, encrypted DCP content */ list imported_keys; - BOOST_FOREACH (shared_ptr i, content()) { + for (auto i: content()) { shared_ptr d = dynamic_pointer_cast (i); if (d && d->kdm()) { dcp::DecryptedKDM kdm (d->kdm().get(), Config::instance()->decryption_chain()->key().get()); @@ -1650,14 +1649,14 @@ Film::make_kdm ( map, dcp::Key> keys; - BOOST_FOREACH(shared_ptr i, cpl->reel_mxfs()) { + for (auto i: cpl->reel_mxfs()) { if (!i->key_id()) { continue; } /* Get any imported key for this ID */ bool done = false; - BOOST_FOREACH (dcp::DecryptedKDMKey j, imported_keys) { + for (auto j: imported_keys) { if (j.id() == i->key_id().get()) { LOG_GENERAL ("Using imported key for %1", i->key_id().get()); keys[i] = j.key(); @@ -1779,9 +1778,9 @@ Film::reels () const list split_points; split_points.push_back (DCPTime()); split_points.push_back (len); - BOOST_FOREACH (shared_ptr c, content()) { + for (auto c: content()) { if (c->video) { - BOOST_FOREACH (DCPTime t, c->reel_split_points(shared_from_this())) { + for (auto t: c->reel_split_points(shared_from_this())) { split_points.push_back (t); } split_points.push_back (c->end(shared_from_this())); @@ -1793,7 +1792,7 @@ Film::reels () const /* Make them into periods, coalescing any that are less than 1 second long */ optional last; - BOOST_FOREACH (DCPTime t, split_points) { + for (auto t: split_points) { if (last && (t - *last) >= DCPTime::from_seconds(1)) { /* Period from *last to t is long enough; use it and start a new one */ p.push_back (DCPTimePeriod(*last, t)); @@ -1870,7 +1869,7 @@ Film::copy_from (shared_ptr film) bool Film::references_dcp_video () const { - BOOST_FOREACH (shared_ptr i, _playlist->content()) { + for (auto i: _playlist->content()) { shared_ptr d = dynamic_pointer_cast(i); if (d && d->reference_video()) { return true; @@ -1883,7 +1882,7 @@ Film::references_dcp_video () const bool Film::references_dcp_audio () const { - BOOST_FOREACH (shared_ptr i, _playlist->content()) { + for (auto i: _playlist->content()) { shared_ptr d = dynamic_pointer_cast(i); if (d && d->reference_audio()) { return true; @@ -1897,7 +1896,7 @@ Film::references_dcp_audio () const bool Film::contains_atmos_content () const { - BOOST_FOREACH (shared_ptr i, _playlist->content()) { + for (auto i: _playlist->content()) { if (i->atmos) { return true; } @@ -1911,8 +1910,8 @@ list Film::closed_caption_tracks () const { list tt; - BOOST_FOREACH (shared_ptr i, content()) { - BOOST_FOREACH (shared_ptr j, i->text) { + for (auto i: content()) { + for (auto j: i->text) { /* XXX: Empty DCPTextTrack ends up being a magic value here - the "unknown" or "not specified" track */ DCPTextTrack dtt = j->dcp_track().get_value_or(DCPTextTrack()); if (j->type() == TEXT_CLOSED_CAPTION && find(tt.begin(), tt.end(), dtt) == tt.end()) { diff --git a/src/lib/filter.cc b/src/lib/filter.cc index 663d14547..6869d26c9 100644 --- a/src/lib/filter.cc +++ b/src/lib/filter.cc @@ -26,7 +26,6 @@ extern "C" { #include } -#include #include #include "i18n.h" @@ -103,7 +102,7 @@ Filter::ffmpeg_string (vector const & filters) { string ff; - BOOST_FOREACH (Filter const * i, filters) { + for (auto const i: filters) { if (!ff.empty ()) { ff += N_(","); } diff --git a/src/lib/font.cc b/src/lib/font.cc index a52957376..aa9a8aaef 100644 --- a/src/lib/font.cc +++ b/src/lib/font.cc @@ -24,7 +24,6 @@ DCPOMATIC_DISABLE_WARNINGS #include DCPOMATIC_ENABLE_WARNINGS -#include using std::string; using namespace dcpomatic; @@ -32,7 +31,7 @@ using namespace dcpomatic; Font::Font (cxml::NodePtr node) : _id (node->string_child ("Id")) { - BOOST_FOREACH (cxml::NodePtr i, node->node_children("File")) { + for (auto i: node->node_children("File")) { string variant = i->optional_string_attribute("Variant").get_value_or ("Normal"); if (variant == "Normal") { _file = i->content(); diff --git a/src/lib/frame_interval_checker.cc b/src/lib/frame_interval_checker.cc index 27c0224ec..dcb9aeaf5 100644 --- a/src/lib/frame_interval_checker.cc +++ b/src/lib/frame_interval_checker.cc @@ -55,7 +55,7 @@ FrameIntervalChecker::guess () const } int near_1 = 0; - BOOST_FOREACH (double i, _intervals) { + for (auto i: _intervals) { if (i > 0.5) { ++near_1; } diff --git a/src/lib/hints.cc b/src/lib/hints.cc index e52e448cf..ca697ad74 100644 --- a/src/lib/hints.cc +++ b/src/lib/hints.cc @@ -40,7 +40,6 @@ #include #include #include -#include #include #include @@ -126,7 +125,7 @@ Hints::check_incorrect_container () { int narrower_than_scope = 0; int scope = 0; - BOOST_FOREACH (shared_ptr i, film()->content()) { + for (auto i: film()->content()) { if (i->video) { Ratio const * r = Ratio::nearest_from_ratio(i->video->scaled_size(film()->frame_size()).ratio()); if (r && r->id() == "239") { @@ -206,7 +205,7 @@ Hints::check_speed_up () { optional lowest_speed_up; optional highest_speed_up; - BOOST_FOREACH (shared_ptr i, film()->content()) { + for (auto i: film()->content()) { double spu = film()->active_frame_rate_change(i->position()).speed_up; if (!lowest_speed_up || spu < *lowest_speed_up) { lowest_speed_up = spu; @@ -236,9 +235,9 @@ Hints::check_big_font_files () { bool big_font_files = false; if (film()->interop ()) { - BOOST_FOREACH (shared_ptr i, film()->content()) { - BOOST_FOREACH (shared_ptr j, i->text) { - BOOST_FOREACH (shared_ptr k, j->fonts()) { + for (auto i: film()->content()) { + for (auto j: i->text) { + for (auto k: j->fonts()) { optional const p = k->file (); if (p && boost::filesystem::file_size(p.get()) >= (MAX_FONT_FILE_SIZE - SIZE_SLACK)) { big_font_files = true; @@ -258,7 +257,7 @@ void Hints::check_vob () { int vob = 0; - BOOST_FOREACH (shared_ptr i, film()->content()) { + for (auto i: film()->content()) { if (boost::algorithm::starts_with (i->path(0).filename().string(), "VTS_")) { ++vob; } @@ -274,7 +273,7 @@ void Hints::check_3d_in_2d () { int three_d = 0; - BOOST_FOREACH (shared_ptr i, film()->content()) { + for (auto i: film()->content()) { if (i->video && i->video->frame_type() != VIDEO_FRAME_TYPE_2D) { ++three_d; } @@ -403,8 +402,8 @@ Hints::thread () dcp::DCP dcp (dcp_dir); dcp.read (); DCPOMATIC_ASSERT (dcp.cpls().size() == 1); - BOOST_FOREACH (shared_ptr reel, dcp.cpls().front()->reels()) { - BOOST_FOREACH (shared_ptr ccap, reel->closed_captions()) { + for (auto reel: dcp.cpls().front()->reels()) { + for (auto ccap: reel->closed_captions()) { if (ccap->asset() && ccap->asset()->xml_as_string().length() > static_cast(MAX_CLOSED_CAPTION_XML_SIZE - SIZE_SLACK) && !ccap_xml_too_big) { hint (_( "At least one of your closed caption files' XML part is larger than " MAX_CLOSED_CAPTION_XML_SIZE_TEXT @@ -461,7 +460,7 @@ void Hints::closed_caption (PlayerText text, DCPTimePeriod period) { int lines = text.string.size(); - BOOST_FOREACH (StringText i, text.string) { + for (auto i: text.string) { if (utf8_strlen(i.text()) > MAX_CLOSED_CAPTION_LENGTH) { ++lines; if (!_long_ccap) { @@ -518,7 +517,7 @@ Hints::open_subtitle (PlayerText text, DCPTimePeriod period) } size_t longest_line = 0; - BOOST_FOREACH (StringText const& i, text.string) { + for (auto const& i: text.string) { longest_line = max (longest_line, i.text().length()); } diff --git a/src/lib/image_content.cc b/src/lib/image_content.cc index 20f32c05d..517d6792f 100644 --- a/src/lib/image_content.cc +++ b/src/lib/image_content.cc @@ -29,7 +29,6 @@ #include "image_filename_sorter.h" #include #include -#include #include #include "i18n.h" @@ -163,7 +162,7 @@ ImageContent::still () const void ImageContent::set_default_colour_conversion () { - BOOST_FOREACH (boost::filesystem::path i, paths()) { + for (auto i: paths()) { if (valid_j2k_file (i)) { /* We default to no colour conversion if we have JPEG2000 files */ video->unset_colour_conversion (); diff --git a/src/lib/image_filename_sorter.cc b/src/lib/image_filename_sorter.cc index 47f46e81d..ea5f46da6 100644 --- a/src/lib/image_filename_sorter.cc +++ b/src/lib/image_filename_sorter.cc @@ -21,7 +21,6 @@ #include "image_filename_sorter.h" #include #include -#include #include #include diff --git a/src/lib/j2k_encoder.cc b/src/lib/j2k_encoder.cc index 273bce8fb..acd27932e 100644 --- a/src/lib/j2k_encoder.cc +++ b/src/lib/j2k_encoder.cc @@ -37,7 +37,6 @@ #include "encode_server_description.h" #include "compose.hpp" #include -#include #include #include "i18n.h" @@ -396,7 +395,7 @@ J2KEncoder::servers_list_changed () } } - BOOST_FOREACH (EncodeServerDescription i, EncodeServerFinder::instance()->servers()) { + for (auto i: EncodeServerFinder::instance()->servers()) { if (!i.current_link_version()) { continue; } diff --git a/src/lib/job.cc b/src/lib/job.cc index 525f86b2c..f0d8fcbbc 100644 --- a/src/lib/job.cc +++ b/src/lib/job.cc @@ -34,7 +34,6 @@ #include #include #include -#include #include #include @@ -196,7 +195,7 @@ Job::run_wrapper () } catch (sub::SubripError& e) { string extra = "Error is near:\n"; - BOOST_FOREACH (string i, e.context()) { + for (auto i: e.context()) { extra += i + "\n"; } diff --git a/src/lib/job_manager.cc b/src/lib/job_manager.cc index 358820c6a..1724879d0 100644 --- a/src/lib/job_manager.cc +++ b/src/lib/job_manager.cc @@ -29,7 +29,6 @@ #include "analyse_subtitles_job.h" #include "film.h" #include -#include #include using std::string; @@ -64,7 +63,7 @@ JobManager::~JobManager () { boost::this_thread::disable_interruption dis; - BOOST_FOREACH (boost::signals2::connection& i, _connections) { + for (auto& i: _connections) { i.disconnect (); } @@ -132,7 +131,7 @@ bool JobManager::errors () const { boost::mutex::scoped_lock lm (_mutex); - BOOST_FOREACH (shared_ptr i, _jobs) { + for (auto i: _jobs) { if (i->finished_in_error ()) { return true; } @@ -151,7 +150,7 @@ JobManager::scheduler () while (true) { bool have_new = false; bool have_running = false; - BOOST_FOREACH (shared_ptr i, _jobs) { + for (auto i: _jobs) { if (i->running()) { have_running = true; } @@ -171,7 +170,7 @@ JobManager::scheduler () break; } - BOOST_FOREACH (shared_ptr i, _jobs) { + for (auto i: _jobs) { if (i->is_new()) { _connections.push_back (i->FinishedImmediate.connect(bind(&JobManager::job_finished, this))); i->start (); @@ -226,7 +225,7 @@ JobManager::analyse_audio ( { boost::mutex::scoped_lock lm (_mutex); - BOOST_FOREACH (shared_ptr i, _jobs) { + for (auto i: _jobs) { shared_ptr a = dynamic_pointer_cast (i); if (a && a->path() == film->audio_analysis_path(playlist) && !i->finished_cancelled()) { i->when_finished (connection, ready); @@ -261,7 +260,7 @@ JobManager::analyse_subtitles ( { boost::mutex::scoped_lock lm (_mutex); - BOOST_FOREACH (shared_ptr i, _jobs) { + for (auto i: _jobs) { shared_ptr a = dynamic_pointer_cast (i); if (a && a->path() == film->subtitle_analysis_path(content)) { i->when_finished (connection, ready); @@ -315,7 +314,7 @@ JobManager::priority_changed () boost::mutex::scoped_lock lm (_mutex); bool first = true; - BOOST_FOREACH (shared_ptr i, _jobs) { + for (auto i: _jobs) { if (first) { if (i->is_new ()) { i->start (); @@ -366,7 +365,7 @@ JobManager::pause () return; } - BOOST_FOREACH (shared_ptr i, _jobs) { + for (auto i: _jobs) { if (i->pause_by_user()) { _paused_job = i; } diff --git a/src/lib/kdm_with_metadata.cc b/src/lib/kdm_with_metadata.cc index 2747e4140..92c95a401 100644 --- a/src/lib/kdm_with_metadata.cc +++ b/src/lib/kdm_with_metadata.cc @@ -26,7 +26,6 @@ #include "config.h" #include "dcpomatic_log.h" #include "emailer.h" -#include #include #include @@ -51,7 +50,7 @@ write_files ( if (directory == "-") { /* Write KDMs to the stdout */ - BOOST_FOREACH (KDMWithMetadataPtr i, kdms) { + for (auto i: kdms) { cout << i->kdm_as_xml (); ++written; } @@ -64,7 +63,7 @@ write_files ( } /* Write KDMs to the specified directory */ - BOOST_FOREACH (KDMWithMetadataPtr i, kdms) { + for (auto i: kdms) { boost::filesystem::path out = directory / careful_string_filter(name_format.get(i->name_values(), ".xml")); if (!boost::filesystem::exists (out) || confirm_overwrite (out)) { i->kdm_as_xml (out); @@ -93,7 +92,7 @@ make_zip_file (list kdms, boost::filesystem::path zip_file, { Zipper zipper (zip_file); - BOOST_FOREACH (KDMWithMetadataPtr i, kdms) { + for (auto i: kdms) { string const name = careful_string_filter(name_format.get(i->name_values(), ".xml")); zipper.add (name, i->kdm_as_xml()); } @@ -110,7 +109,7 @@ collect (list kdms) { list > grouped; - BOOST_FOREACH (KDMWithMetadataPtr i, kdms) { + for (auto i: kdms) { list >::iterator j = grouped.begin (); @@ -144,7 +143,7 @@ write_directories ( { int written = 0; - BOOST_FOREACH (list const & i, kdms) { + for (auto const& i: kdms) { boost::filesystem::path path = directory; path /= container_name_format.get(i.front()->name_values(), "", "s"); if (!boost::filesystem::exists (path) || confirm_overwrite (path)) { @@ -170,7 +169,7 @@ write_zip_files ( { int written = 0; - BOOST_FOREACH (list const & i, kdms) { + for (auto const& i: kdms) { boost::filesystem::path path = directory; path /= container_name_format.get(i.front()->name_values(), ".zip", "s"); if (!boost::filesystem::exists (path) || confirm_overwrite (path)) { @@ -208,7 +207,7 @@ email ( throw NetworkError (_("No mail server configured in preferences")); } - BOOST_FOREACH (list const & i, kdms) { + for (auto const& i: kdms) { if (i.front()->emails().empty()) { continue; @@ -232,7 +231,7 @@ email ( boost::algorithm::replace_all (body, "$CINEMA_NAME", i.front()->get('c').get_value_or("")); string screens; - BOOST_FOREACH (KDMWithMetadataPtr j, i) { + for (auto j: i) { optional screen_name = j->get('n'); if (screen_name) { screens += *screen_name + ", "; @@ -242,7 +241,7 @@ email ( Emailer email (config->kdm_from(), i.front()->emails(), subject, body); - BOOST_FOREACH (string i, config->kdm_cc()) { + for (auto i: config->kdm_cc()) { email.add_cc (i); } if (!config->kdm_bcc().empty ()) { diff --git a/src/lib/overlaps.cc b/src/lib/overlaps.cc index f5ccd48d0..32801de39 100644 --- a/src/lib/overlaps.cc +++ b/src/lib/overlaps.cc @@ -21,7 +21,6 @@ #include "overlaps.h" #include "types.h" #include "content.h" -#include using std::shared_ptr; using boost::function; @@ -31,7 +30,7 @@ ContentList overlaps (shared_ptr film, ContentList cl, function i, cl) { + for (auto i: cl) { if (part(i) && DCPTimePeriod(i->position(), i->end(film)).overlap(period)) { overlaps.push_back (i); } diff --git a/src/lib/player.cc b/src/lib/player.cc index e6e8aca86..503452b59 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -56,7 +56,6 @@ #include #include #include -#include #include #include #include @@ -177,7 +176,7 @@ Player::setup_pieces_unlocked () _shuffler = new Shuffler(); _shuffler->Video.connect(bind(&Player::video, this, _1, _2)); - BOOST_FOREACH (shared_ptr i, playlist()->content()) { + for (auto i: playlist()->content()) { if (!i->paths_valid ()) { continue; @@ -189,7 +188,7 @@ Player::setup_pieces_unlocked () } shared_ptr old_decoder; - BOOST_FOREACH (shared_ptr j, old_pieces) { + for (auto j: old_pieces) { if (j->content == i) { old_decoder = j->decoder; break; @@ -210,7 +209,7 @@ Player::setup_pieces_unlocked () } if (_ignore_text) { - BOOST_FOREACH (shared_ptr i, decoder->text) { + for (auto i: decoder->text) { i->set_ignore (true); } } @@ -261,9 +260,9 @@ Player::setup_pieces_unlocked () } _stream_states.clear (); - BOOST_FOREACH (shared_ptr i, _pieces) { + for (auto i: _pieces) { if (i->content->audio) { - BOOST_FOREACH (AudioStreamPtr j, i->content->audio->streams()) { + for (auto j: i->content->audio->streams()) { _stream_states[j] = StreamState (i, i->content->position ()); } } @@ -454,7 +453,7 @@ Player::get_subtitle_fonts () boost::mutex::scoped_lock lm (_mutex); vector fonts; - BOOST_FOREACH (shared_ptr i, _pieces) { + for (auto i: _pieces) { /* XXX: things may go wrong if there are duplicate font IDs with different font files. */ @@ -535,7 +534,7 @@ Player::get_reel_assets () list a; - BOOST_FOREACH (shared_ptr i, playlist()->content()) { + for (auto i: playlist()->content()) { shared_ptr j = dynamic_pointer_cast (i); if (!j) { continue; @@ -558,12 +557,12 @@ Player::get_reel_assets () int64_t offset_from_start = 0; /* position in the asset from the end */ int64_t offset_from_end = 0; - BOOST_FOREACH (shared_ptr k, decoder->reels()) { + for (auto k: decoder->reels()) { /* Assume that main picture duration is the length of the reel */ offset_from_end += k->main_picture()->actual_duration(); } - BOOST_FOREACH (shared_ptr k, decoder->reels()) { + for (auto k: decoder->reels()) { /* Assume that main picture duration is the length of the reel */ int64_t const reel_duration = k->main_picture()->actual_duration(); @@ -586,7 +585,7 @@ Player::get_reel_assets () } if (j->reference_text (TEXT_CLOSED_CAPTION)) { - BOOST_FOREACH (shared_ptr l, k->closed_captions()) { + for (auto l: k->closed_captions()) { maybe_add_asset (a, l, reel_trim_start, reel_trim_end, from, ffr); } } @@ -621,7 +620,7 @@ Player::pass () shared_ptr earliest_content; optional earliest_time; - BOOST_FOREACH (shared_ptr i, _pieces) { + for (auto i: _pieces) { if (i->done) { continue; } @@ -765,13 +764,13 @@ Player::open_subtitles_for_frame (DCPTime time) const list captions; int const vfr = _film->video_frame_rate(); - BOOST_FOREACH ( - PlayerText j, + for ( + auto j: _active_texts[TEXT_OPEN_SUBTITLE].get_burnt(DCPTimePeriod(time, time + DCPTime::from_frames(1, vfr)), _always_burn_open_subtitles) ) { /* Bitmap subtitles */ - BOOST_FOREACH (BitmapText i, j.bitmap) { + for (auto i: j.bitmap) { if (!i.image) { continue; } @@ -1034,7 +1033,7 @@ Player::plain_text_start (weak_ptr wp, weak_ptr wc, Co return; } - BOOST_FOREACH (dcp::SubtitleString s, subtitle.subs) { + for (auto s: subtitle.subs) { s.set_h_position (s.h_position() + text->x_offset ()); s.set_v_position (s.v_position() + text->y_offset ()); float const xs = text->x_scale(); @@ -1119,7 +1118,7 @@ Player::seek (DCPTime time, bool accurate) _active_texts[i].clear (); } - BOOST_FOREACH (shared_ptr i, _pieces) { + for (auto i: _pieces) { if (time < i->content->position()) { /* Before; seek to the start of the content. Even if this request is for an inaccurate seek we must seek this (following) content accurately, otherwise when we come to the end of the current @@ -1274,7 +1273,7 @@ Player::content_time_to_dcp (shared_ptr content, ContentTime t) { boost::mutex::scoped_lock lm (_mutex); - BOOST_FOREACH (shared_ptr i, _pieces) { + for (auto i: _pieces) { if (i->content == content) { return content_time_to_dcp (i, t); } diff --git a/src/lib/player_text.cc b/src/lib/player_text.cc index d2448efa6..5456b06c4 100644 --- a/src/lib/player_text.cc +++ b/src/lib/player_text.cc @@ -20,7 +20,6 @@ #include "player_text.h" #include "font.h" -#include using std::list; using std::shared_ptr; @@ -29,9 +28,9 @@ using namespace dcpomatic; void PlayerText::add_fonts (list > fonts_) { - BOOST_FOREACH (shared_ptr i, fonts_) { + for (auto i: fonts_) { bool got = false; - BOOST_FOREACH (shared_ptr j, fonts) { + for (auto j: fonts) { if (*i == *j) { got = true; } diff --git a/src/lib/playlist.cc b/src/lib/playlist.cc index 287f23fd4..ab7649be1 100644 --- a/src/lib/playlist.cc +++ b/src/lib/playlist.cc @@ -35,7 +35,6 @@ #include #include #include -#include #include #include "i18n.h" @@ -138,7 +137,7 @@ Playlist::maybe_sequence (shared_ptr film) DCPTime next_left; DCPTime next_right; - BOOST_FOREACH (shared_ptr i, cont) { + for (auto i: cont) { if (!i->video) { continue; } @@ -157,7 +156,7 @@ Playlist::maybe_sequence (shared_ptr film) /* Captions */ DCPTime next; - BOOST_FOREACH (shared_ptr i, cont) { + for (auto i: cont) { if (i->text.empty() || find (placed.begin(), placed.end(), i) != placed.end()) { continue; } @@ -177,9 +176,9 @@ Playlist::video_identifier () const { string t; - BOOST_FOREACH (shared_ptr i, content()) { + for (auto i: content()) { bool burn = false; - BOOST_FOREACH (shared_ptr j, i->text) { + for (auto j: i->text) { if (j->burn()) { burn = true; } @@ -204,7 +203,7 @@ Playlist::set_from_xml (shared_ptr film, cxml::ConstNodePtr node, in { boost::mutex::scoped_lock lm (_mutex); - BOOST_FOREACH (cxml::NodePtr i, node->node_children ("Content")) { + for (auto i: node->node_children ("Content")) { shared_ptr content = content_factory (i, version, notes); /* See if this content should be nudged to start on a video frame */ @@ -262,7 +261,7 @@ Playlist::set_from_xml (shared_ptr film, cxml::ConstNodePtr node, in void Playlist::as_xml (xmlpp::Node* node, bool with_content_paths) { - BOOST_FOREACH (shared_ptr i, content()) { + for (auto i: content()) { i->as_xml (node->add_child ("Content"), with_content_paths); } } @@ -325,7 +324,7 @@ Playlist::remove (ContentList c) { boost::mutex::scoped_lock lm (_mutex); - BOOST_FOREACH (shared_ptr i, c) { + for (auto i: c) { ContentList::iterator j = _content.begin (); while (j != _content.end() && *j != i) { ++j; @@ -366,12 +365,12 @@ Playlist::best_video_frame_rate () const list candidates; /* Start with the ones without skip / repeat so they will get matched in preference to skipped/repeated ones */ - BOOST_FOREACH (int i, allowed_dcp_frame_rates) { + for (auto i: allowed_dcp_frame_rates) { candidates.push_back (FrameRateCandidate(i, i)); } /* Then the skip/repeat ones */ - BOOST_FOREACH (int i, allowed_dcp_frame_rates) { + for (auto i: allowed_dcp_frame_rates) { candidates.push_back (FrameRateCandidate (float(i) / 2, i)); candidates.push_back (FrameRateCandidate (float(i) * 2, i)); } @@ -383,7 +382,7 @@ Playlist::best_video_frame_rate () const while (i != candidates.end()) { float this_error = 0; - BOOST_FOREACH (shared_ptr j, content()) { + for (auto j: content()) { if (!j->video || !j->video_frame_rate()) { continue; } @@ -418,7 +417,7 @@ DCPTime Playlist::length (shared_ptr film) const { DCPTime len; - BOOST_FOREACH (shared_ptr i, content()) { + for (auto i: content()) { len = max (len, i->end(film)); } @@ -435,7 +434,7 @@ Playlist::start () const } DCPTime start = DCPTime::max (); - BOOST_FOREACH (shared_ptr i, cont) { + for (auto i: cont) { start = min (start, i->position ()); } @@ -446,7 +445,7 @@ Playlist::start () const void Playlist::disconnect () { - BOOST_FOREACH (boost::signals2::connection& i, _content_connections) { + for (auto& i: _content_connections) { i.disconnect (); } @@ -459,7 +458,7 @@ Playlist::reconnect (shared_ptr film) { disconnect (); - BOOST_FOREACH (shared_ptr i, _content) { + for (auto i: _content) { _content_connections.push_back (i->Change.connect(boost::bind(&Playlist::content_change, this, film, _1, _2, _3, _4))); } } @@ -468,7 +467,7 @@ DCPTime Playlist::video_end (shared_ptr film) const { DCPTime end; - BOOST_FOREACH (shared_ptr i, content()) { + for (auto i: content()) { if (i->video) { end = max (end, i->end(film)); } @@ -481,7 +480,7 @@ DCPTime Playlist::text_end (shared_ptr film) const { DCPTime end; - BOOST_FOREACH (shared_ptr i, content()) { + for (auto i: content()) { if (!i->text.empty ()) { end = max (end, i->end(film)); } @@ -552,7 +551,7 @@ void Playlist::repeat (shared_ptr film, ContentList c, int n) { pair range (DCPTime::max (), DCPTime ()); - BOOST_FOREACH (shared_ptr i, c) { + for (auto i: c) { range.first = min (range.first, i->position ()); range.second = max (range.second, i->position ()); range.first = min (range.first, i->end(film)); @@ -566,7 +565,7 @@ Playlist::repeat (shared_ptr film, ContentList c, int n) DCPTime pos = range.second; for (int i = 0; i < n; ++i) { - BOOST_FOREACH (shared_ptr j, c) { + for (auto j: c) { shared_ptr copy = j->clone (); copy->set_position (film, pos + copy->position() - range.first); _content.push_back (copy); @@ -634,7 +633,7 @@ Playlist::required_disk_space (shared_ptr film, int j2k_bandwidth, i int64_t video = uint64_t (j2k_bandwidth / 8) * length(film).seconds(); int64_t audio = uint64_t (audio_channels * audio_frame_rate * 3) * length(film).seconds(); - BOOST_FOREACH (shared_ptr i, content()) { + for (auto i: content()) { shared_ptr d = dynamic_pointer_cast (i); if (d) { if (d->reference_video()) { @@ -655,7 +654,7 @@ Playlist::content_summary (shared_ptr film, DCPTimePeriod period) co { string best_summary; int best_score = -1; - BOOST_FOREACH (shared_ptr i, content()) { + for (auto i: content()) { int score = 0; optional const o = DCPTimePeriod(i->position(), i->end(film)).overlap (period); if (o) { @@ -680,7 +679,7 @@ Playlist::speed_up_range (int dcp_video_frame_rate) const { pair range (DBL_MAX, -DBL_MAX); - BOOST_FOREACH (shared_ptr i, content()) { + for (auto i: content()) { if (!i->video) { continue; } diff --git a/src/lib/reel_writer.cc b/src/lib/reel_writer.cc index 110102b70..b81c225c2 100644 --- a/src/lib/reel_writer.cc +++ b/src/lib/reel_writer.cc @@ -51,7 +51,6 @@ #include #include #include -#include #include "i18n.h" @@ -179,7 +178,7 @@ ReelWriter::ReelWriter ( DCPOMATIC_ASSERT (film()->directory()); vector active; - BOOST_FOREACH (int i, film()->mapped_audio_channels()) { + for (auto i: film()->mapped_audio_channels()) { active.push_back (static_cast(i)); } @@ -460,7 +459,7 @@ maybe_add_text ( if (asset) { /* Add the font to the subtitle content */ - BOOST_FOREACH (FontData const& j, fonts) { + for (auto const& j: fonts) { asset->add_font (j.id, j.data.get_value_or(default_font)); } @@ -491,7 +490,7 @@ maybe_add_text ( ); } else { /* We don't have a subtitle asset of our own; hopefully we have one to reference */ - BOOST_FOREACH (ReferencedReelAsset j, refs) { + for (auto j: refs) { shared_ptr k = dynamic_pointer_cast (j.asset); if (k && j.period == period) { reel_asset = k; @@ -536,7 +535,7 @@ ReelWriter::create_reel_picture (shared_ptr reel, list k = dynamic_pointer_cast (j.asset); if (k) { LOG_GENERAL ("candidate picture asset period is %1-%2", j.period.from.get(), j.period.to.get()); @@ -578,7 +577,7 @@ ReelWriter::create_reel_sound (shared_ptr reel, list k = dynamic_pointer_cast (j.asset); if (k) { LOG_GENERAL ("candidate sound asset period is %1-%2", j.period.from.get(), j.period.to.get()); @@ -664,7 +663,7 @@ ReelWriter::create_reel_text ( } /* Make empty tracks for anything we've been asked to ensure but that we haven't added */ - BOOST_FOREACH (DCPTextTrack i, ensure_closed_captions) { + for (auto i: ensure_closed_captions) { shared_ptr a = maybe_add_text ( empty_text_asset(TEXT_CLOSED_CAPTION, i), duration, reel, refs, fonts, _default_font, film(), _period, output_dcp, _text_only ); @@ -847,14 +846,14 @@ ReelWriter::write (PlayerText subs, TextType type, optional track, DCPOMATIC_ASSERT (false); } - BOOST_FOREACH (StringText i, subs.string) { + for (auto i: subs.string) { /* XXX: couldn't / shouldn't we use period here rather than getting time from the subtitle? */ i.set_in (i.in() - dcp::Time (_period.from.seconds(), i.in().tcr)); i.set_out (i.out() - dcp::Time (_period.from.seconds(), i.out().tcr)); asset->add (shared_ptr(new dcp::SubtitleString(i))); } - BOOST_FOREACH (BitmapText i, subs.bitmap) { + for (auto i: subs.bitmap) { asset->add ( shared_ptr( new dcp::SubtitleImage( diff --git a/src/lib/render_text.cc b/src/lib/render_text.cc index 3129c220f..3dc1e9ff0 100644 --- a/src/lib/render_text.cc +++ b/src/lib/render_text.cc @@ -36,7 +36,6 @@ DCPOMATIC_ENABLE_WARNINGS #ifndef DCPOMATIC_HAVE_SHOW_IN_CAIRO_CONTEXT #include #endif -#include #include #include @@ -61,7 +60,7 @@ marked_up (list subtitles, int target_height, float fade_factor) { string out; - BOOST_FOREACH (StringText const & i, subtitles) { + for (auto const& i: subtitles) { out += " > const& fonts) optional font_file = default_font_file (); - BOOST_FOREACH (shared_ptr i, fonts) { + for (auto i: fonts) { if (i->id() == subtitle.font() && i->file()) { font_file = i->file (); } @@ -404,7 +403,7 @@ render_text (list subtitles, list > fonts, dcp::Siz list pending; list images; - BOOST_FOREACH (StringText const & i, subtitles) { + for (auto const& i: subtitles) { if (!pending.empty() && (i.v_align() != pending.back().v_align() || fabs(i.v_position() - pending.back().v_position()) > 1e-4)) { images.push_back (render_line (pending, fonts, target, time, frame_rate)); pending.clear (); diff --git a/src/lib/screen.cc b/src/lib/screen.cc index dea513ab0..8e1e83e36 100644 --- a/src/lib/screen.cc +++ b/src/lib/screen.cc @@ -23,7 +23,6 @@ #include "film.h" #include "cinema.h" #include -#include #include #include @@ -37,7 +36,7 @@ using namespace dcpomatic; Screen::Screen (cxml::ConstNodePtr node) : KDMRecipient (node) { - BOOST_FOREACH (cxml::ConstNodePtr i, node->node_children ("TrustedDevice")) { + for (auto i: node->node_children ("TrustedDevice")) { if (boost::algorithm::starts_with(i->content(), "-----BEGIN CERTIFICATE-----")) { trusted_devices.push_back (TrustedDevice(dcp::Certificate(i->content()))); } else { @@ -50,7 +49,7 @@ void Screen::as_xml (xmlpp::Element* parent) const { KDMRecipient::as_xml (parent); - BOOST_FOREACH (TrustedDevice i, trusted_devices) { + for (auto i: trusted_devices) { parent->add_child("TrustedDevice")->add_child_text(i.as_string()); } } @@ -59,7 +58,7 @@ vector Screen::trusted_device_thumbprints () const { vector t; - BOOST_FOREACH (TrustedDevice i, trusted_devices) { + for (auto i: trusted_devices) { t.push_back (i.thumbprint()); } return t; diff --git a/src/lib/send_kdm_email_job.cc b/src/lib/send_kdm_email_job.cc index cea35e3c5..8ed08f2a3 100644 --- a/src/lib/send_kdm_email_job.cc +++ b/src/lib/send_kdm_email_job.cc @@ -42,7 +42,7 @@ SendKDMEmailJob::SendKDMEmailJob ( , _filename_format (filename_format) , _cpl_name (cpl_name) { - BOOST_FOREACH (KDMWithMetadataPtr i, kdms) { + for (auto i: kdms) { list s; s.push_back (i); _kdms.push_back (s); diff --git a/src/lib/send_notification_email_job.cc b/src/lib/send_notification_email_job.cc index 41d215ba2..e5edc49ee 100644 --- a/src/lib/send_notification_email_job.cc +++ b/src/lib/send_notification_email_job.cc @@ -23,7 +23,6 @@ #include "config.h" #include "emailer.h" #include "compose.hpp" -#include #include #include "i18n.h" @@ -70,7 +69,7 @@ SendNotificationEmailJob::run () list to; to.push_back (config->notification_to ()); Emailer email (config->notification_from(), to, config->notification_subject(), _body); - BOOST_FOREACH (string i, config->notification_cc()) { + for (auto i: config->notification_cc()) { email.add_cc (i); } if (!config->notification_bcc().empty()) { diff --git a/src/lib/send_problem_report_job.cc b/src/lib/send_problem_report_job.cc index 143baaa1b..cff1c8e9f 100644 --- a/src/lib/send_problem_report_job.cc +++ b/src/lib/send_problem_report_job.cc @@ -28,7 +28,6 @@ #include "emailer.h" #include "environment_info.h" #include -#include #include "i18n.h" @@ -83,7 +82,7 @@ SendProblemReportJob::run () body += "Version: " + string (dcpomatic_version) + " " + string (dcpomatic_git_commit) + "\n\n"; - BOOST_FOREACH (string i, environment_info ()) { + for (auto i: environment_info ()) { body += i + "\n"; } diff --git a/src/lib/shuffler.cc b/src/lib/shuffler.cc index 2689fb837..0e478a562 100644 --- a/src/lib/shuffler.cc +++ b/src/lib/shuffler.cc @@ -22,7 +22,6 @@ #include "content_video.h" #include "dcpomatic_assert.h" #include "dcpomatic_log.h" -#include #include #include @@ -115,8 +114,7 @@ Shuffler::clear () void Shuffler::flush () { - BOOST_FOREACH (Store i, _store) { - LOG_DEBUG_PLAYER("Flushing %1 from shuffler", i.second.frame); + for (auto i: _store) { Video (i.first, i.second); } } diff --git a/src/lib/spl.cc b/src/lib/spl.cc index 512fe253c..1677e626f 100644 --- a/src/lib/spl.cc +++ b/src/lib/spl.cc @@ -26,7 +26,6 @@ DCPOMATIC_DISABLE_WARNINGS #include DCPOMATIC_ENABLE_WARNINGS -#include #include using std::cout; @@ -43,7 +42,7 @@ SPL::read (boost::filesystem::path path, ContentStore* store) doc.read_file (path); _id = doc.string_child("Id"); _name = doc.string_child("Name"); - BOOST_FOREACH (cxml::ConstNodePtr i, doc.node_children("Entry")) { + for (auto i: doc.node_children("Entry")) { shared_ptr c = store->get(i->string_child("Digest")); if (c) { add (SPLEntry(c)); @@ -60,7 +59,7 @@ SPL::write (boost::filesystem::path path) const xmlpp::Element* root = doc.create_root_node ("SPL"); root->add_child("Id")->add_child_text (_id); root->add_child("Name")->add_child_text (_name); - BOOST_FOREACH (SPLEntry i, _spl) { + for (auto i: _spl) { i.as_xml (root->add_child("Entry")); } doc.write_to_file_formatted (path.string()); diff --git a/src/lib/string_text_file_decoder.cc b/src/lib/string_text_file_decoder.cc index 415851aef..f24147851 100644 --- a/src/lib/string_text_file_decoder.cc +++ b/src/lib/string_text_file_decoder.cc @@ -23,7 +23,6 @@ #include "text_content.h" #include "text_decoder.h" #include -#include #include using std::list; @@ -95,8 +94,8 @@ vector StringTextFileDecoder::fonts () const { vector data; - BOOST_FOREACH (shared_ptr i, text) { - BOOST_FOREACH (shared_ptr j, i->content()->fonts()) { + for (auto i: text) { + for (auto j: i->content()->fonts()) { data.push_back (FontData(j)); } } diff --git a/src/lib/subtitle_encoder.cc b/src/lib/subtitle_encoder.cc index 1a83c5c67..cc42f1204 100644 --- a/src/lib/subtitle_encoder.cc +++ b/src/lib/subtitle_encoder.cc @@ -77,7 +77,7 @@ SubtitleEncoder::SubtitleEncoder (shared_ptr film, shared_ptr j _assets.push_back (make_pair(shared_ptr(), boost::filesystem::change_extension(filename, extension))); } - BOOST_FOREACH (dcpomatic::DCPTimePeriod i, film->reels()) { + for (auto i: film->reels()) { _reels.push_back (i); } @@ -115,7 +115,7 @@ SubtitleEncoder::go () } if (!_film->interop() || _include_font) { - BOOST_FOREACH (dcpomatic::FontData j, _player->get_subtitle_fonts()) { + for (auto j: _player->get_subtitle_fonts()) { i->first->add_font (j.id, _default_font); } } @@ -162,7 +162,7 @@ SubtitleEncoder::text (PlayerText subs, TextType type, optional tr } } - BOOST_FOREACH (StringText i, subs.string) { + for (auto i: subs.string) { /* XXX: couldn't / shouldn't we use period here rather than getting time from the subtitle? */ i.set_in (i.in()); i.set_out (i.out()); diff --git a/src/lib/text_content.cc b/src/lib/text_content.cc index 656aec7eb..2f01bb2fa 100644 --- a/src/lib/text_content.cc +++ b/src/lib/text_content.cc @@ -26,7 +26,6 @@ #include #include #include -#include #include #include "i18n.h" @@ -105,7 +104,7 @@ TextContent::from_xml (Content* parent, cxml::ConstNodePtr node, int version) } list > c; - BOOST_FOREACH (cxml::ConstNodePtr i, node->node_children("Text")) { + for (auto i: node->node_children("Text")) { c.push_back (shared_ptr (new TextContent (parent, i, version))); } @@ -397,7 +396,7 @@ TextContent::identifier () const /* XXX: I suppose really _fonts shouldn't be in here, since not all types of subtitle content involve fonts. */ - BOOST_FOREACH (shared_ptr f, _fonts) { + for (auto f: _fonts) { s += "_" + f->file().get_value_or("Default").string(); } @@ -416,13 +415,13 @@ TextContent::add_font (shared_ptr font) void TextContent::connect_to_fonts () { - BOOST_FOREACH (boost::signals2::connection& i, _font_connections) { + for (auto const& i: _font_connections) { i.disconnect (); } _font_connections.clear (); - BOOST_FOREACH (shared_ptr i, _fonts) { + for (auto i: _fonts) { _font_connections.push_back (i->Changed.connect (boost::bind (&TextContent::font_changed, this))); } } diff --git a/src/lib/text_decoder.cc b/src/lib/text_decoder.cc index 3f6afd710..a2241c50b 100644 --- a/src/lib/text_decoder.cc +++ b/src/lib/text_decoder.cc @@ -24,7 +24,6 @@ #include "log.h" #include "compose.hpp" #include -#include #include #include @@ -67,7 +66,7 @@ TextDecoder::emit_bitmap_start (ContentTime from, shared_ptr image, dcpom void TextDecoder::emit_plain_start (ContentTime from, list s) { - BOOST_FOREACH (dcp::SubtitleString& i, s) { + for (auto& i: s) { /* We must escape < and > in strings, otherwise they might confuse our subtitle renderer (which uses some HTML-esque markup to do bold/italic etc.) */ @@ -104,7 +103,7 @@ TextDecoder::emit_plain_start (ContentTime from, sub::Subtitle const & subtitle) /* See if our next subtitle needs to be vertically placed on screen by us */ bool needs_placement = false; optional bottom_line; - BOOST_FOREACH (sub::Line i, subtitle.lines) { + for (auto i: subtitle.lines) { if (!i.vertical_position.reference || (i.vertical_position.line && !i.vertical_position.lines) || i.vertical_position.reference.get() == sub::TOP_OF_SUBTITLE) { needs_placement = true; if (!bottom_line || bottom_line.get() < i.vertical_position.line.get()) { @@ -115,7 +114,7 @@ TextDecoder::emit_plain_start (ContentTime from, sub::Subtitle const & subtitle) /* Find the lowest proportional position */ optional lowest_proportional; - BOOST_FOREACH (sub::Line i, subtitle.lines) { + for (auto i: subtitle.lines) { if (i.vertical_position.proportional) { if (!lowest_proportional) { lowest_proportional = i.vertical_position.proportional; @@ -126,8 +125,8 @@ TextDecoder::emit_plain_start (ContentTime from, sub::Subtitle const & subtitle) } list out; - BOOST_FOREACH (sub::Line i, subtitle.lines) { - BOOST_FOREACH (sub::Block j, i.blocks) { + for (auto i: subtitle.lines) { + for (auto j: i.blocks) { if (!j.font_size.specified()) { /* Fallback default font size if no other has been specified */ diff --git a/src/lib/types.cc b/src/lib/types.cc index 6729628cd..68d97b8ff 100644 --- a/src/lib/types.cc +++ b/src/lib/types.cc @@ -31,7 +31,6 @@ DCPOMATIC_DISABLE_WARNINGS #include DCPOMATIC_ENABLE_WARNINGS #include -#include #include "i18n.h" @@ -200,7 +199,7 @@ CPLSummary::CPLSummary (boost::filesystem::path p) list notes; dcp.read (¬es); - BOOST_FOREACH (dcp::VerificationNote i, notes) { + for (auto i: notes) { if (i.code() != dcp::VerificationNote::EXTERNAL_ASSET) { /* It's not just a warning about this DCP being a VF */ throw dcp::ReadError(dcp::note_to_string(i)); @@ -212,8 +211,8 @@ CPLSummary::CPLSummary (boost::filesystem::path p) cpl_file = dcp.cpls().front()->file().get(); encrypted = false; - BOOST_FOREACH (shared_ptr j, dcp.cpls()) { - BOOST_FOREACH (shared_ptr k, j->reel_mxfs()) { + for (auto j: dcp.cpls()) { + for (auto k: j->reel_mxfs()) { if (k->key_id()) { encrypted = true; } diff --git a/src/lib/util.cc b/src/lib/util.cc index 45b517c7f..c7b3281da 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -810,7 +810,7 @@ audio_channel_types (list mapped, int channels) int non_lfe = 0; int lfe = 0; - BOOST_FOREACH (int i, mapped) { + for (auto i: mapped) { if (i >= channels) { /* This channel is mapped but is not included in the DCP */ continue; @@ -1007,7 +1007,7 @@ show_jobs_on_console (bool progress) first = false; - BOOST_FOREACH (shared_ptr i, jobs) { + for (auto i: jobs) { if (progress) { cout << i->name(); if (!i->sub_name().empty()) { @@ -1135,7 +1135,7 @@ decrypt_kdm_with_helpful_error (dcp::EncryptedKDM kdm) string const kdm_subject_name = kdm.recipient_x509_subject_name(); bool on_chain = false; shared_ptr dc = Config::instance()->decryption_chain(); - BOOST_FOREACH (dcp::Certificate i, dc->root_to_leaf()) { + for (auto i: dc->root_to_leaf()) { if (i.subject() == kdm_subject_name) { on_chain = true; } diff --git a/src/lib/util.h b/src/lib/util.h index 564e376ad..ceb30701c 100644 --- a/src/lib/util.h +++ b/src/lib/util.h @@ -128,7 +128,7 @@ std::list vector_to_list (std::vector v) { std::list l; - BOOST_FOREACH (T& i, v) { + for (auto& i: v) { l.push_back (i); } return l; @@ -139,7 +139,7 @@ std::vector list_to_vector (std::list v) { std::vector l; - BOOST_FOREACH (T& i, v) { + for (auto& i: v) { l.push_back (i); } return l; diff --git a/src/lib/verify_dcp_job.cc b/src/lib/verify_dcp_job.cc index 88e44c4f9..bbcce7208 100644 --- a/src/lib/verify_dcp_job.cc +++ b/src/lib/verify_dcp_job.cc @@ -71,7 +71,7 @@ VerifyDCPJob::run () _notes = dcp::verify (_directories, bind (&VerifyDCPJob::update_stage, this, _1, _2), bind (&VerifyDCPJob::set_progress, this, _1, false), xsd_path()); bool failed = false; - BOOST_FOREACH (dcp::VerificationNote i, _notes) { + for (auto i: _notes) { if (i.type() == dcp::VerificationNote::VERIFY_ERROR) { failed = true; } diff --git a/src/lib/video_decoder.cc b/src/lib/video_decoder.cc index 5bf067283..cab8197cb 100644 --- a/src/lib/video_decoder.cc +++ b/src/lib/video_decoder.cc @@ -25,7 +25,6 @@ #include "log.h" #include "frame_interval_checker.h" #include "compose.hpp" -#include #include #include "i18n.h" diff --git a/src/lib/video_ring_buffers.cc b/src/lib/video_ring_buffers.cc index 1c08d44b3..8c73aba25 100644 --- a/src/lib/video_ring_buffers.cc +++ b/src/lib/video_ring_buffers.cc @@ -21,7 +21,6 @@ #include "video_ring_buffers.h" #include "player_video.h" #include "compose.hpp" -#include #include #include diff --git a/src/lib/writer.cc b/src/lib/writer.cc index ff2adeb00..8c5a82415 100644 --- a/src/lib/writer.cc +++ b/src/lib/writer.cc @@ -39,7 +39,6 @@ #include #include #include -#include #include #include #include @@ -101,7 +100,7 @@ Writer::Writer (weak_ptr weak_film, weak_ptr j, bool text_only) int reel_index = 0; list const reels = film()->reels(); - BOOST_FOREACH (DCPTimePeriod p, reels) { + for (auto p: reels) { _reels.push_back (ReelWriter(weak_film, p, job, reel_index++, reels.size(), text_only)); } @@ -112,7 +111,7 @@ Writer::Writer (weak_ptr weak_film, weak_ptr j, bool text_only) */ _audio_reel = _reels.begin (); _subtitle_reel = _reels.begin (); - BOOST_FOREACH (DCPTextTrack i, film()->closed_caption_tracks()) { + for (auto i: film()->closed_caption_tracks()) { _caption_reels[i] = _reels.begin (); } _atmos_reel = _reels.begin (); @@ -413,7 +412,7 @@ try /* (Hopefully temporarily) log anything that was not written */ if (!_queue.empty() && !have_sequenced_image_at_queue_head()) { LOG_WARNING (N_("Finishing writer with a left-over queue of %1:"), _queue.size()); - BOOST_FOREACH (QueueItem const& i, _queue) { + for (auto const& i: _queue) { if (i.type == QueueItem::FULL) { LOG_WARNING (N_("- type FULL, frame %1, eyes %2"), i.frame, (int) i.eyes); } else { @@ -537,7 +536,7 @@ Writer::finish (boost::filesystem::path output_dcp) LOG_GENERAL_NC ("Finishing ReelWriters"); - BOOST_FOREACH (ReelWriter& i, _reels) { + for (auto& i: _reels) { i.finish (output_dcp); } @@ -579,7 +578,7 @@ Writer::finish (boost::filesystem::path output_dcp) set_progress = &ignore_progress; } - BOOST_FOREACH (ReelWriter& i, _reels) { + for (auto& i: _reels) { service.post (boost::bind (&ReelWriter::calculate_digests, &i, set_progress)); } service.post (boost::bind (&Writer::calculate_referenced_digests, this, set_progress)); @@ -590,7 +589,7 @@ Writer::finish (boost::filesystem::path output_dcp) /* Add reels */ - BOOST_FOREACH (ReelWriter& i, _reels) { + for (auto& i: _reels) { cpl->add (i.create_reel(_reel_assets, _fonts, output_dcp, _have_subtitles, _have_closed_captions)); } @@ -609,7 +608,7 @@ Writer::finish (boost::filesystem::path output_dcp) cpl->set_ratings (film()->ratings()); vector cv; - BOOST_FOREACH (string i, film()->content_versions()) { + for (auto i: film()->content_versions()) { cv.push_back (dcp::ContentVersion(i)); } cpl->set_content_versions (cv); @@ -631,7 +630,7 @@ Writer::finish (boost::filesystem::path output_dcp) ) ? dcp::SEVEN_POINT_ONE : dcp::FIVE_POINT_ONE; dcp::MainSoundConfiguration msc (field, film()->audio_channels()); - BOOST_FOREACH (int i, ac) { + for (auto i: ac) { if (i < film()->audio_channels()) { msc.set_mapping (i, static_cast(i)); } @@ -796,9 +795,9 @@ Writer::write (vector fonts) { /* Just keep a list of unique fonts and we'll deal with them in ::finish */ - BOOST_FOREACH (FontData const& i, fonts) { + for (auto const& i: fonts) { bool got = false; - BOOST_FOREACH (FontData const& j, _fonts) { + for (auto& j: _fonts) { if (i == j) { got = true; } @@ -879,7 +878,7 @@ Writer::set_digest_progress (Job* job, float progress) void Writer::calculate_referenced_digests (boost::function set_progress) { - BOOST_FOREACH (ReferencedReelAsset const& i, _reel_assets) { + for (auto const& i: _reel_assets) { shared_ptr mxf = dynamic_pointer_cast(i.asset); if (mxf && !mxf->hash()) { mxf->asset_ref().asset()->hash (set_progress); diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index 386e40cb2..bcef19f59 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -103,7 +103,6 @@ DCPOMATIC_ENABLE_WARNINGS #endif #include #include -#include #include #include #include @@ -445,7 +444,7 @@ public: ); } - BOOST_FOREACH (string i, notes) { + for (auto i: notes) { error_dialog (0, std_to_wx(i)); } @@ -687,7 +686,7 @@ private: PasteDialog* d = new PasteDialog (this, static_cast(_clipboard->video), static_cast(_clipboard->audio), !_clipboard->text.empty()); if (d->ShowModal() == wxID_OK) { - BOOST_FOREACH (shared_ptr i, _film_editor->content_panel()->selected()) { + for (auto i: _film_editor->content_panel()->selected()) { if (d->video() && i->video) { DCPOMATIC_ASSERT (_clipboard->video); i->video->take_settings_from (_clipboard->video); @@ -1638,7 +1637,7 @@ private: if (!_film_to_create.empty ()) { _frame->new_film (_film_to_create, optional ()); if (!_content_to_add.empty ()) { - BOOST_FOREACH (shared_ptr i, content_factory(_content_to_add)) { + for (auto i: content_factory(_content_to_add)) { _frame->film()->examine_and_add_content (i); } } diff --git a/src/tools/dcpomatic_batch.cc b/src/tools/dcpomatic_batch.cc index 46c66d2c9..9cb6ddc55 100644 --- a/src/tools/dcpomatic_batch.cc +++ b/src/tools/dcpomatic_batch.cc @@ -40,7 +40,6 @@ #include #include #include -#include #include #include @@ -179,13 +178,13 @@ public: set > films; - BOOST_FOREACH (shared_ptr i, JobManager::instance()->get()) { + for (auto i: JobManager::instance()->get()) { films.insert (i->film()); } - BOOST_FOREACH (shared_ptr i, films) { + for (auto i: films) { double progress = 0; - BOOST_FOREACH (shared_ptr j, JobManager::instance()->get()) { + for (auto j: JobManager::instance()->get()) { if (i == j->film() && dynamic_pointer_cast(j)) { progress = j->progress().get_value_or(0); } @@ -438,7 +437,7 @@ class App : public wxApp this->Bind (wxEVT_IDLE, boost::bind (&App::idle, this)); shared_ptr film; - BOOST_FOREACH (boost::filesystem::path i, films_to_load) { + for (auto i: films_to_load) { if (boost::filesystem::is_directory (i)) { try { film.reset (new Film (i)); diff --git a/src/tools/dcpomatic_cli.cc b/src/tools/dcpomatic_cli.cc index 2d70fb578..46ae790cc 100644 --- a/src/tools/dcpomatic_cli.cc +++ b/src/tools/dcpomatic_cli.cc @@ -35,7 +35,6 @@ #include "lib/audio_content.h" #include "lib/dcpomatic_log.h" #include -#include #include #include #include @@ -82,7 +81,7 @@ print_dump (shared_ptr film) << "Output " << film->video_frame_rate() << "fps " << (film->three_d() ? "3D" : "2D") << " " << (film->audio_frame_rate() / 1000) << "kHz\n" << (film->interop() ? "Inter-Op" : "SMPTE") << " " << (film->encrypted() ? "encrypted" : "unencrypted") << "\n"; - BOOST_FOREACH (shared_ptr c, film->content ()) { + for (auto c: film->content()) { cout << "\n" << c->path(0) << "\n" << "\tat " << c->position().seconds () @@ -140,7 +139,7 @@ list_servers () ++N; /* Report the state of configured servers */ - BOOST_FOREACH (string i, Config::instance()->servers()) { + for (auto i: Config::instance()->servers()) { cout << std::left << setw(24) << i << " "; /* See if this server is on the active list; if so, remove it and note @@ -168,7 +167,7 @@ list_servers () } /* Now report any left that have been found by broadcast */ - BOOST_FOREACH (EncodeServerDescription const & i, servers) { + for (auto const& i: servers) { if (i.current_link_version()) { cout << std::left << setw(24) << i.host_name() << " UP " << i.threads() << "\n"; } else { diff --git a/src/tools/dcpomatic_create.cc b/src/tools/dcpomatic_create.cc index 568dfa56c..1d3387f18 100644 --- a/src/tools/dcpomatic_create.cc +++ b/src/tools/dcpomatic_create.cc @@ -38,7 +38,6 @@ #include #include #include -#include #include #include #include @@ -111,7 +110,7 @@ main (int argc, char* argv[]) film->set_j2k_bandwidth (*cc.j2k_bandwidth); } - BOOST_FOREACH (CreateCLI::Content i, cc.content) { + for (auto i: cc.content) { boost::filesystem::path const can = boost::filesystem::canonical (i.path); list > content; @@ -122,7 +121,7 @@ main (int argc, char* argv[]) content = content_factory (can); } - BOOST_FOREACH (shared_ptr j, content) { + for (auto j: content) { film->examine_and_add_content (j); } @@ -132,7 +131,7 @@ main (int argc, char* argv[]) while (signal_manager->ui_idle() > 0) {} - BOOST_FOREACH (shared_ptr j, content) { + for (auto j: content) { if (j->video) { j->video->set_frame_type (i.frame_type); } @@ -143,7 +142,7 @@ main (int argc, char* argv[]) film->set_video_frame_rate (*cc.dcp_frame_rate); } - BOOST_FOREACH (shared_ptr i, film->content()) { + for (auto i: film->content()) { shared_ptr ic = dynamic_pointer_cast (i); if (ic && ic->still()) { ic->video->set_length (cc.still_length * 24); @@ -151,7 +150,7 @@ main (int argc, char* argv[]) } if (jm->errors ()) { - BOOST_FOREACH (shared_ptr i, jm->get()) { + for (auto i: jm->get()) { if (i->finished_in_error()) { cerr << i->error_summary() << "\n" << i->error_details() << "\n"; diff --git a/src/tools/dcpomatic_disk.cc b/src/tools/dcpomatic_disk.cc index ac0bb68df..17a24d4c1 100644 --- a/src/tools/dcpomatic_disk.cc +++ b/src/tools/dcpomatic_disk.cc @@ -317,7 +317,7 @@ private: int re_select = wxNOT_FOUND; int j = 0; _drives = Drive::get (); - BOOST_FOREACH (Drive i, _drives) { + for (auto i: _drives) { wxString const s = std_to_wx(i.description()); if (s == current) { re_select = j; diff --git a/src/tools/dcpomatic_disk_writer.cc b/src/tools/dcpomatic_disk_writer.cc index 695a0b033..6c4221d8a 100644 --- a/src/tools/dcpomatic_disk_writer.cc +++ b/src/tools/dcpomatic_disk_writer.cc @@ -64,7 +64,6 @@ DCPOMATIC_ENABLE_WARNINGS #include #include #include -#include #include using std::cin; diff --git a/src/tools/dcpomatic_kdm.cc b/src/tools/dcpomatic_kdm.cc index 874573ce2..3547d0f59 100644 --- a/src/tools/dcpomatic_kdm.cc +++ b/src/tools/dcpomatic_kdm.cc @@ -59,7 +59,6 @@ DCPOMATIC_ENABLE_WARNINGS #include #endif #include -#include #ifdef check #undef check @@ -321,7 +320,7 @@ private: throw InvalidSignerError (); } - BOOST_FOREACH (shared_ptr i, _screens->screens()) { + for (auto i: _screens->screens()) { if (!i->recipient) { continue; @@ -340,7 +339,7 @@ private: ); /* Add keys from the DKDM */ - BOOST_FOREACH (dcp::DecryptedKDMKey const & j, decrypted.keys()) { + for (auto const& j: decrypted.keys()) { kdm.add_key (j); } @@ -522,7 +521,7 @@ private: /* Add children */ shared_ptr g = dynamic_pointer_cast (base); if (g) { - BOOST_FOREACH (shared_ptr i, g->children()) { + for (auto i: g->children()) { add_dkdm_view (i); } } diff --git a/src/tools/dcpomatic_kdm_cli.cc b/src/tools/dcpomatic_kdm_cli.cc index fef5dea04..d0ee0cad9 100644 --- a/src/tools/dcpomatic_kdm_cli.cc +++ b/src/tools/dcpomatic_kdm_cli.cc @@ -226,7 +226,7 @@ from_film ( try { list kdms; - BOOST_FOREACH (shared_ptr i, screens) { + for (auto i: screens) { KDMWithMetadataPtr p = kdm_for_screen (film, cpl, i, valid_from, valid_to, formulation, disable_forensic_marking_picture, disable_forensic_marking_audio); if (p) { kdms.push_back (p); @@ -248,7 +248,7 @@ from_film ( optional sub_find_dkdm (shared_ptr group, string cpl_id) { - BOOST_FOREACH (shared_ptr i, group->children()) { + for (auto i: group->children()) { shared_ptr g = dynamic_pointer_cast(i); if (g) { optional dkdm = sub_find_dkdm (g, cpl_id); @@ -300,7 +300,7 @@ kdm_from_dkdm ( dcp::LocalTime().as_string() ); - BOOST_FOREACH (dcp::DecryptedKDMKey const & j, dkdm.keys()) { + for (auto const& j: dkdm.keys()) { kdm.add_key(j); } @@ -327,7 +327,7 @@ from_dkdm ( try { list kdms; - BOOST_FOREACH (shared_ptr i, screens) { + for (auto i: screens) { if (!i->recipient) { continue; } @@ -375,7 +375,7 @@ dump_dkdm_group (shared_ptr group, int indent) } cout << group->name() << "\n"; } - BOOST_FOREACH (shared_ptr i, group->children()) { + for (auto i: group->children()) { shared_ptr g = dynamic_pointer_cast(i); if (g) { dump_dkdm_group (g, indent + 2); diff --git a/src/tools/dcpomatic_player.cc b/src/tools/dcpomatic_player.cc index 5b2c9a56a..0586db975 100644 --- a/src/tools/dcpomatic_player.cc +++ b/src/tools/dcpomatic_player.cc @@ -278,7 +278,7 @@ public: } bool ok = true; - BOOST_FOREACH (shared_ptr i, _film->content()) { + for (auto i: _film->content()) { shared_ptr d = dynamic_pointer_cast(i); if (d && !d->kdm_timing_window_valid()) { ok = false; @@ -303,7 +303,7 @@ public: if (dcp) { DCPExaminer ex (dcp, true); shared_ptr playing_cpl; - BOOST_FOREACH (shared_ptr i, ex.cpls()) { + for (auto i: ex.cpls()) { if (!dcp->cpl() || i->id() == *dcp->cpl()) { playing_cpl = i; } @@ -415,10 +415,10 @@ public: /* Start off as Flat */ _film->set_container (Ratio::from_id("185")); - BOOST_FOREACH (shared_ptr i, _film->content()) { + for (auto i: _film->content()) { shared_ptr dcp = dynamic_pointer_cast(i); - BOOST_FOREACH (shared_ptr j, i->text) { + for (auto j: i->text) { j->set_use (true); } @@ -452,7 +452,7 @@ public: if (first) { DCPExaminer ex (first, true); int id = ID_view_cpl; - BOOST_FOREACH (shared_ptr i, ex.cpls()) { + for (auto i: ex.cpls()) { wxMenuItem* j = _cpl_menu->AppendRadioItem( id, wxString::Format("%s (%s)", std_to_wx(i->annotation_text()).data(), std_to_wx(i->id()).data()) @@ -612,7 +612,7 @@ private: if (!ok || !report_errors_from_last_job(this)) { return; } - BOOST_FOREACH (shared_ptr i, dcp->text) { + for (auto i: dcp->text) { i->set_use (true); } if (dcp->video) { diff --git a/src/tools/dcpomatic_playlist.cc b/src/tools/dcpomatic_playlist.cc index 261f08972..1dca8c182 100644 --- a/src/tools/dcpomatic_playlist.cc +++ b/src/tools/dcpomatic_playlist.cc @@ -36,7 +36,6 @@ #include #include #include -#include using std::exception; using std::cout; @@ -171,7 +170,7 @@ private: } int N = 0; - BOOST_FOREACH (shared_ptr i, _playlists) { + for (auto i: _playlists) { if (i == playlist) { _list->SetItem (N, 0, std_to_wx(i->name())); } @@ -196,7 +195,7 @@ private: } catch (...) {} } - BOOST_FOREACH (shared_ptr i, _playlists) { + for (auto i: _playlists) { add_playlist_to_view (i); } } @@ -318,7 +317,7 @@ public: _playlist = playlist; _list->DeleteAllItems (); if (_playlist) { - BOOST_FOREACH (SPLEntry i, _playlist->get()) { + for (auto i: _playlist->get()) { add (i); } _name->SetValue (std_to_wx(_playlist->name())); diff --git a/src/tools/dcpomatic_server.cc b/src/tools/dcpomatic_server.cc index c59fefe8f..4039a07ed 100644 --- a/src/tools/dcpomatic_server.cc +++ b/src/tools/dcpomatic_server.cc @@ -36,7 +36,6 @@ DCPOMATIC_DISABLE_WARNINGS #include DCPOMATIC_ENABLE_WARNINGS #include -#include #include #include @@ -72,7 +71,7 @@ public: string get () const { string a; - BOOST_FOREACH (string const & i, _log) { + for (auto const& i: _log) { a += i + "\n"; } return a; diff --git a/src/wx/audio_dialog.cc b/src/wx/audio_dialog.cc index 1cb167c95..41b2a9d39 100644 --- a/src/wx/audio_dialog.cc +++ b/src/wx/audio_dialog.cc @@ -30,7 +30,6 @@ #include "lib/job_manager.h" #include #include -#include #include using std::cout; @@ -204,7 +203,7 @@ AudioDialog::try_to_load_analysis () _plot->set_analysis (shared_ptr ()); _analysis.reset (); - BOOST_FOREACH (shared_ptr i, JobManager::instance()->get()) { + for (auto i: JobManager::instance()->get()) { if (dynamic_pointer_cast(i)) { i->cancel (); } @@ -256,7 +255,7 @@ AudioDialog::try_to_load_analysis () mapped = film->mapped_audio_channels (); } - BOOST_FOREACH (int i, mapped) { + for (auto i: mapped) { if (_channel_checkbox[i]) { _channel_checkbox[i]->SetValue (true); _plot->set_channel_visible (i, true); diff --git a/src/wx/audio_mapping_view.cc b/src/wx/audio_mapping_view.cc index 04a468416..60606b166 100644 --- a/src/wx/audio_mapping_view.cc +++ b/src/wx/audio_mapping_view.cc @@ -36,7 +36,6 @@ DCPOMATIC_DISABLE_WARNINGS #include #include DCPOMATIC_ENABLE_WARNINGS -#include #include using std::cout; @@ -191,7 +190,7 @@ AudioMappingView::paint_column_labels (wxDC& dc) wxCoord label_width; wxCoord label_height; int N = 0; - BOOST_FOREACH (NamedChannel const& i, _output_channels) { + for (auto const& i: _output_channels) { dc.GetTextExtent (std_to_wx(i.name), &label_width, &label_height); dc.DrawText (std_to_wx(i.name), LEFT_WIDTH + GRID_SPACING * N + (GRID_SPACING - label_width) / 2, GRID_SPACING + (GRID_SPACING - label_height) / 2); ++N; @@ -226,7 +225,7 @@ AudioMappingView::paint_row_labels (wxDC& dc) /* Row channel labels */ int N = 0; - BOOST_FOREACH (NamedChannel const& i, _input_channels) { + for (auto const& i: _input_channels) { dc.GetTextExtent (std_to_wx(i.name), &label_width, &label_height); dc.DrawText (std_to_wx(i.name), GRID_SPACING * 2 + (GRID_SPACING - label_width) / 2, TOP_HEIGHT + GRID_SPACING * N + (GRID_SPACING - label_height) / 2); ++N; @@ -244,7 +243,7 @@ AudioMappingView::paint_row_labels (wxDC& dc) /* Group labels and lines */ int y = TOP_HEIGHT; - BOOST_FOREACH (Group i, _input_groups) { + for (auto i: _input_groups) { int const height = (i.to - i.from + 1) * GRID_SPACING; dc.GetTextExtent (std_to_wx(i.name), &label_width, &label_height); if (label_width > height) { @@ -440,7 +439,7 @@ AudioMappingView::mouse_event_to_input_group_name (wxMouseEvent& ev) const } int y = (ev.GetY() + _vertical_scroll->GetThumbPosition() - (GRID_SPACING * 2)) / GRID_SPACING; - BOOST_FOREACH (Group i, _input_groups) { + for (auto i: _input_groups) { if (i.from <= y && y <= i.to) { return i.name; } @@ -551,7 +550,7 @@ wxString AudioMappingView::input_channel_name_with_group (NamedChannel const& n) const { optional group; - BOOST_FOREACH (Group i, _input_groups) { + for (auto i: _input_groups) { if (i.from <= n.index && n.index <= i.to) { group = std_to_wx (i.name); } diff --git a/src/wx/audio_panel.cc b/src/wx/audio_panel.cc index bf73798da..dc2b91f47 100644 --- a/src/wx/audio_panel.cc +++ b/src/wx/audio_panel.cc @@ -35,7 +35,6 @@ #include "lib/dcp_content.h" #include "lib/audio_content.h" #include -#include #include using std::vector; @@ -196,7 +195,7 @@ AudioPanel::film_content_changed (int property) vector groups; int c = 0; - BOOST_FOREACH (shared_ptr i, ac.front()->audio->streams()) { + for (auto i: ac.front()->audio->streams()) { shared_ptr f = dynamic_pointer_cast (i); string name = ""; if (f) { diff --git a/src/wx/audio_plot.cc b/src/wx/audio_plot.cc index 682abe432..cb10908df 100644 --- a/src/wx/audio_plot.cc +++ b/src/wx/audio_plot.cc @@ -310,7 +310,7 @@ AudioPlot::plot_peak (wxGraphicsPath& path, int channel, Metrics const & metrics DCPOMATIC_ASSERT (_peak.find(channel) != _peak.end()); path.MoveToPoint (_peak[channel][0].draw); - BOOST_FOREACH (Point const & i, _peak[channel]) { + for (auto const& i: _peak[channel]) { path.AddLineToPoint (i.draw); } } @@ -379,7 +379,7 @@ AudioPlot::plot_rms (wxGraphicsPath& path, int channel, Metrics const & metrics) DCPOMATIC_ASSERT (_rms.find(channel) != _rms.end()); path.MoveToPoint (_rms[channel][0].draw); - BOOST_FOREACH (Point const & i, _rms[channel]) { + for (auto const& i: _rms[channel]) { path.AddLineToPoint (i.draw); } } @@ -425,7 +425,7 @@ void AudioPlot::search (map const & search, wxMouseEvent const & ev, double& min_dist, Point& min_point) const { for (map::const_iterator i = search.begin(); i != search.end(); ++i) { - BOOST_FOREACH (Point const & j, i->second) { + for (auto const& j: i->second) { double const dist = pow(ev.GetX() - j.draw.x, 2) + pow(ev.GetY() - j.draw.y, 2); if (dist < min_dist) { min_dist = dist; diff --git a/src/wx/cinema_dialog.cc b/src/wx/cinema_dialog.cc index ecb7d8107..e67fe77ed 100644 --- a/src/wx/cinema_dialog.cc +++ b/src/wx/cinema_dialog.cc @@ -22,7 +22,6 @@ #include "wx_util.h" #include "lib/dcpomatic_assert.h" #include "lib/util.h" -#include using std::string; using std::vector; diff --git a/src/wx/closed_captions_dialog.cc b/src/wx/closed_captions_dialog.cc index 71fc15272..4f34f0531 100644 --- a/src/wx/closed_captions_dialog.cc +++ b/src/wx/closed_captions_dialog.cc @@ -237,8 +237,8 @@ ClosedCaptionsDialog::update_tracks (shared_ptr film) { _tracks.clear (); - BOOST_FOREACH (shared_ptr i, film->content()) { - BOOST_FOREACH (shared_ptr j, i->text) { + for (auto i: film->content()) { + for (auto j: i->text) { if (j->use() && j->type() == TEXT_CLOSED_CAPTION && j->dcp_track()) { if (find(_tracks.begin(), _tracks.end(), j->dcp_track()) == _tracks.end()) { _tracks.push_back (*j->dcp_track()); @@ -248,7 +248,7 @@ ClosedCaptionsDialog::update_tracks (shared_ptr film) } _track->Clear (); - BOOST_FOREACH (DCPTextTrack const & i, _tracks) { + for (auto const& i: _tracks) { _track->Append (std_to_wx(String::compose("%1 (%2)", i.name, i.language))); } diff --git a/src/wx/config_dialog.cc b/src/wx/config_dialog.cc index 0d341ba73..14abc286b 100644 --- a/src/wx/config_dialog.cc +++ b/src/wx/config_dialog.cc @@ -488,7 +488,7 @@ CertificateChainEditor::update_certificate_list () _certificates->DeleteAllItems (); size_t n = 0; dcp::CertificateChain::List certs = _get()->root_to_leaf (); - BOOST_FOREACH (dcp::Certificate const & i, certs) { + for (auto const& i: certs) { wxListItem item; item.SetId (n); _certificates->InsertItem (item); diff --git a/src/wx/config_dialog.h b/src/wx/config_dialog.h index b2ebbe605..818ab4def 100644 --- a/src/wx/config_dialog.h +++ b/src/wx/config_dialog.h @@ -44,7 +44,6 @@ DCPOMATIC_DISABLE_WARNINGS DCPOMATIC_ENABLE_WARNINGS #include #include -#include #include class AudioMappingView; diff --git a/src/wx/confirm_kdm_email_dialog.cc b/src/wx/confirm_kdm_email_dialog.cc index 5b0c1510f..7709442c9 100644 --- a/src/wx/confirm_kdm_email_dialog.cc +++ b/src/wx/confirm_kdm_email_dialog.cc @@ -23,7 +23,6 @@ #include "static_text.h" #include "check_box.h" #include "lib/config.h" -#include using std::list; using std::string; @@ -35,7 +34,7 @@ ConfirmKDMEmailDialog::ConfirmKDMEmailDialog (wxWindow* parent, list ema : QuestionDialog (parent, _("Confirm KDM email"), _("Send emails"), _("Don't send emails")) { wxString message = _("Are you sure you want to send emails to the following addresses?\n\n"); - BOOST_FOREACH (string i, emails) { + for (auto i: emails) { message += "\t" + std_to_wx (i) + "\n"; } diff --git a/src/wx/content_colour_conversion_dialog.cc b/src/wx/content_colour_conversion_dialog.cc index 351d5aa65..da9e1a41b 100644 --- a/src/wx/content_colour_conversion_dialog.cc +++ b/src/wx/content_colour_conversion_dialog.cc @@ -26,7 +26,6 @@ #include "lib/config.h" #include "lib/util.h" #include -#include #include using std::string; @@ -65,7 +64,7 @@ ContentColourConversionDialog::ContentColourConversionDialog (wxWindow* parent, _editor_connection = _editor->Changed.connect (boost::bind (&ContentColourConversionDialog::check_for_preset, this)); - BOOST_FOREACH (PresetColourConversion const &i, PresetColourConversion::all ()) { + for (auto const& i: PresetColourConversion::all ()) { _preset_choice->Append (std_to_wx (i.name)); } } diff --git a/src/wx/content_menu.cc b/src/wx/content_menu.cc index 57c6afeb3..d93fd31b2 100644 --- a/src/wx/content_menu.cc +++ b/src/wx/content_menu.cc @@ -43,7 +43,6 @@ #include #include #include -#include #include using std::cout; @@ -122,7 +121,7 @@ ContentMenu::popup (weak_ptr film, ContentList c, TimelineContentViewList _repeat->Enable (!_content.empty ()); int n = 0; - BOOST_FOREACH (shared_ptr i, _content) { + for (auto i: _content) { if (dynamic_pointer_cast (i)) { ++n; } @@ -147,7 +146,7 @@ ContentMenu::popup (weak_ptr film, ContentList c, TimelineContentViewList _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 i, cpls) { + for (auto i: cpls) { wxMenuItem* item = _cpl_menu->AppendRadioItem ( id++, wxString::Format ( @@ -228,7 +227,7 @@ void ContentMenu::join () { vector > fc; - BOOST_FOREACH (shared_ptr i, _content) { + for (auto i: _content) { shared_ptr f = dynamic_pointer_cast (i); if (f) { fc.push_back (f); @@ -269,7 +268,7 @@ ContentMenu::remove () /* 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 i, _content) { + for (auto i: _content) { shared_ptr fc = dynamic_pointer_cast (i); if (!fc) { continue; @@ -278,7 +277,7 @@ ContentMenu::remove () shared_ptr video; shared_ptr audio; - BOOST_FOREACH (shared_ptr j, _views) { + for (auto j: _views) { shared_ptr v = dynamic_pointer_cast (j); shared_ptr a = dynamic_pointer_cast (j); if (v && v->content() == fc) { @@ -350,7 +349,7 @@ ContentMenu::find_missing () return; } - BOOST_FOREACH (shared_ptr i, content) { + for (auto i: content) { shared_ptr j (new ExamineContentJob (film, i)); j->Finished.connect ( @@ -375,7 +374,7 @@ ContentMenu::re_examine () return; } - BOOST_FOREACH (shared_ptr i, _content) { + for (auto i: _content) { JobManager::instance()->add (shared_ptr (new ExamineContentJob (film, i))); } } @@ -434,7 +433,7 @@ ContentMenu::kdm () DCPExaminer ex (dcp, true); bool kdm_matches_any_cpl = false; - BOOST_FOREACH (shared_ptr i, ex.cpls()) { + for (auto i: ex.cpls()) { if (i->id() == kdm->cpl_id()) { kdm_matches_any_cpl = true; } diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc index 7114e8337..83539403d 100644 --- a/src/wx/content_panel.cc +++ b/src/wx/content_panel.cc @@ -48,7 +48,6 @@ #include #include #include -#include #include using std::list; @@ -183,7 +182,7 @@ ContentPanel::selected_video () { ContentList vc; - BOOST_FOREACH (shared_ptr i, selected ()) { + for (auto i: selected()) { if (i->video) { vc.push_back (i); } @@ -197,7 +196,7 @@ ContentPanel::selected_audio () { ContentList ac; - BOOST_FOREACH (shared_ptr i, selected ()) { + for (auto i: selected()) { if (i->audio) { ac.push_back (i); } @@ -211,7 +210,7 @@ ContentPanel::selected_text () { ContentList sc; - BOOST_FOREACH (shared_ptr i, selected ()) { + for (auto i: selected()) { if (!i->text.empty()) { sc.push_back (i); } @@ -225,7 +224,7 @@ ContentPanel::selected_ffmpeg () { FFmpegContentList sc; - BOOST_FOREACH (shared_ptr i, selected ()) { + for (auto i: selected()) { shared_ptr t = dynamic_pointer_cast (i); if (t) { sc.push_back (t); @@ -247,7 +246,7 @@ ContentPanel::film_changed (Film::Property p) break; } - BOOST_FOREACH (ContentSubPanel* i, panels()) { + for (auto i: panels()) { i->film_changed (p); } } @@ -286,12 +285,12 @@ ContentPanel::check_selection () setup_sensitivity (); - BOOST_FOREACH (ContentSubPanel* i, panels()) { + for (auto i: panels()) { i->content_selection_changed (); } optional go_to; - BOOST_FOREACH (shared_ptr i, selected()) { + for (auto i: selected()) { DCPTime p; p = i->position(); if (dynamic_pointer_cast(i) && i->paths_valid()) { @@ -333,14 +332,14 @@ ContentPanel::check_selection () bool have_video = false; bool have_audio = false; bool have_text[TEXT_COUNT] = { false, false }; - BOOST_FOREACH (shared_ptr i, selected()) { + for (auto i: selected()) { if (i->video) { have_video = true; } if (i->audio) { have_audio = true; } - BOOST_FOREACH (shared_ptr j, i->text) { + for (auto j: i->text) { have_text[j->original_type()] = true; } } @@ -468,7 +467,7 @@ ContentPanel::add_folder_clicked () return; } - BOOST_FOREACH (shared_ptr i, content) { + for (auto i: content) { shared_ptr ic = dynamic_pointer_cast (i); if (ic) { ImageSequenceDialog* e = new ImageSequenceDialog (_splitter); @@ -517,7 +516,7 @@ ContentPanel::remove_clicked (bool hotkey) return true; } - BOOST_FOREACH (shared_ptr i, selected ()) { + for (auto i: selected ()) { _film->remove_content (i); } @@ -669,7 +668,7 @@ ContentPanel::film_content_changed (int property) setup (); } - BOOST_FOREACH (ContentSubPanel* i, panels()) { + for (auto i: panels()) { i->film_content_changed (property); } } @@ -697,7 +696,7 @@ ContentPanel::setup () _content->DeleteAllItems (); - BOOST_FOREACH (shared_ptr i, content) { + for (auto i: content) { int const t = _content->GetItemCount (); bool const valid = i->paths_valid (); @@ -771,8 +770,8 @@ ContentPanel::add_files (list paths) /* XXX: check for lots of files here and do something */ try { - BOOST_FOREACH (boost::filesystem::path i, paths) { - BOOST_FOREACH (shared_ptr j, content_factory(i)) { + for (auto i: paths) { + for (auto j: content_factory(i)) { _film->examine_and_add_content (j); } } diff --git a/src/wx/content_properties_dialog.cc b/src/wx/content_properties_dialog.cc index bf1f67ace..2e0e360d9 100644 --- a/src/wx/content_properties_dialog.cc +++ b/src/wx/content_properties_dialog.cc @@ -25,7 +25,6 @@ #include "lib/video_content.h" #include "lib/audio_content.h" #include -#include using std::string; using std::list; @@ -38,7 +37,7 @@ ContentPropertiesDialog::ContentPropertiesDialog (wxWindow* parent, shared_ptr > grouped; - BOOST_FOREACH (UserProperty i, content->user_properties(film)) { + for (auto i: content->user_properties(film)) { if (grouped.find(i.category) == grouped.end()) { grouped[i.category] = list (); } @@ -91,7 +90,7 @@ ContentPropertiesDialog::maybe_add_group (mapsecond) { + for (auto j: i->second) { add (std_to_wx (j.key), true); add (new StaticText (this, std_to_wx (j.value + " " + j.unit))); } diff --git a/src/wx/content_sub_panel.cc b/src/wx/content_sub_panel.cc index b4ba55175..e0a1a52bd 100644 --- a/src/wx/content_sub_panel.cc +++ b/src/wx/content_sub_panel.cc @@ -25,7 +25,6 @@ #include "lib/compose.hpp" #include "lib/log.h" #include -#include using std::list; using std::string; diff --git a/src/wx/content_view.cc b/src/wx/content_view.cc index 67a9a3fa5..44e575d93 100644 --- a/src/wx/content_view.cc +++ b/src/wx/content_view.cc @@ -106,7 +106,7 @@ ContentView::update () while (jm->work_to_do()) { if (!progress.Pulse()) { /* user pressed cancel */ - BOOST_FOREACH (shared_ptr i, jm->get()) { + for (auto i: jm->get()) { i->cancel(); } return; @@ -115,7 +115,7 @@ ContentView::update () } /* Add content from successful jobs and report errors */ - BOOST_FOREACH (shared_ptr i, jobs) { + for (auto i: jobs) { if (i->finished_in_error()) { error_dialog(this, std_to_wx(i->error_summary()) + ".\n", std_to_wx(i->error_details())); } else { @@ -156,7 +156,7 @@ ContentView::add (shared_ptr content) shared_ptr ContentView::get (string digest) const { - BOOST_FOREACH (shared_ptr i, _content) { + for (auto i: _content) { if (i->digest() == digest) { return i; } diff --git a/src/wx/dcp_panel.cc b/src/wx/dcp_panel.cc index 972b30bac..5d941301b 100644 --- a/src/wx/dcp_panel.cc +++ b/src/wx/dcp_panel.cc @@ -47,7 +47,6 @@ #include #include #include -#include #include using std::cout; @@ -137,7 +136,7 @@ DCPPanel::DCPPanel (wxNotebook* n, shared_ptr film, weak_ptr v _markers->Bind (wxEVT_BUTTON, boost::bind (&DCPPanel::markers_clicked, this)); _metadata->Bind (wxEVT_BUTTON, boost::bind (&DCPPanel::metadata_clicked, this)); - BOOST_FOREACH (DCPContentType const * i, DCPContentType::all()) { + for (auto i: DCPContentType::all()) { _dcp_content_type->Append (std_to_wx (i->pretty_name ())); } @@ -746,11 +745,11 @@ DCPPanel::make_video_panel () _three_d->Bind (wxEVT_CHECKBOX, boost::bind(&DCPPanel::three_d_changed, this)); _reencode_j2k->Bind (wxEVT_CHECKBOX, boost::bind(&DCPPanel::reencode_j2k_changed, this)); - BOOST_FOREACH (Ratio const * i, Ratio::containers()) { + for (auto i: Ratio::containers()) { _container->Append (std_to_wx(i->container_nickname())); } - BOOST_FOREACH (int i, Config::instance()->allowed_dcp_frame_rates()) { + for (auto i: Config::instance()->allowed_dcp_frame_rates()) { _frame_rate_choice->Append (std_to_wx (boost::lexical_cast (i))); } @@ -923,7 +922,7 @@ void DCPPanel::add_audio_processors () { _audio_processor->Append (_("None"), new wxStringClientData (N_("none"))); - BOOST_FOREACH (AudioProcessor const * ap, AudioProcessor::visible()) { + for (auto ap: AudioProcessor::visible()) { _audio_processor->Append (std_to_wx(ap->name()), new wxStringClientData(std_to_wx(ap->id()))); } _audio_panel_sizer->Layout(); diff --git a/src/wx/dkdm_dialog.cc b/src/wx/dkdm_dialog.cc index fe97cf642..c46fed760 100644 --- a/src/wx/dkdm_dialog.cc +++ b/src/wx/dkdm_dialog.cc @@ -91,7 +91,7 @@ DKDMDialog::DKDMDialog (wxWindow* parent, shared_ptr film) right->Add (h); vector cpls; - BOOST_FOREACH (CPLSummary const & i, film->cpls()) { + for (auto const& i: film->cpls()) { if (i.encrypted) { cpls.push_back (i); } @@ -153,7 +153,7 @@ DKDMDialog::make_clicked () list kdms; try { - BOOST_FOREACH (shared_ptr i, _recipients->recipients()) { + for (auto i: _recipients->recipients()) { KDMWithMetadataPtr p = kdm_for_dkdm_recipient (film, _cpl->cpl(), i, _timing->from(), _timing->until()); if (p) { kdms.push_back (p); diff --git a/src/wx/dkdm_output_panel.cc b/src/wx/dkdm_output_panel.cc index 762ed7b7e..964662f0e 100644 --- a/src/wx/dkdm_output_panel.cc +++ b/src/wx/dkdm_output_panel.cc @@ -119,7 +119,7 @@ DKDMOutputPanel::make ( } bool kdms_with_no_email = false; - BOOST_FOREACH (KDMWithMetadataPtr i, kdms) { + for (auto i: kdms) { if (i->emails().empty()) { kdms_with_no_email = true; } @@ -134,8 +134,8 @@ DKDMOutputPanel::make ( if (proceed && Config::instance()->confirm_kdm_email()) { list emails; - BOOST_FOREACH (KDMWithMetadataPtr const& i, kdms) { - BOOST_FOREACH (string j, i->emails()) { + for (auto const& i: kdms) { + for (auto j: i->emails()) { emails.push_back (j); } } diff --git a/src/wx/dolby_doremi_certificate_panel.cc b/src/wx/dolby_doremi_certificate_panel.cc index e30ef30a4..6eaa1d3ae 100644 --- a/src/wx/dolby_doremi_certificate_panel.cc +++ b/src/wx/dolby_doremi_certificate_panel.cc @@ -28,7 +28,6 @@ #include #include #include -#include #include using std::string; @@ -195,7 +194,7 @@ DolbyDoremiCertificatePanel::do_download () _dialog->message()->SetLabel (wxT ("")); string s; - BOOST_FOREACH (string e, errors) { + for (auto e: errors) { s += e + "\n"; } diff --git a/src/wx/download_certificate_dialog.cc b/src/wx/download_certificate_dialog.cc index ec9f6dade..627223c46 100644 --- a/src/wx/download_certificate_dialog.cc +++ b/src/wx/download_certificate_dialog.cc @@ -55,7 +55,7 @@ DownloadCertificateDialog::DownloadCertificateDialog (wxWindow* parent) _pages.push_back (new QubeCertificatePanel (this, N_("QXI"))); _pages.push_back (new QubeCertificatePanel (this, N_("QXPD"))); - BOOST_FOREACH (DownloadCertificatePanel* i, _pages) { + for (auto i: _pages) { _notebook->AddPage (i, i->name(), true); } diff --git a/src/wx/editable_list.h b/src/wx/editable_list.h index 7902d0b79..f90d219f8 100644 --- a/src/wx/editable_list.h +++ b/src/wx/editable_list.h @@ -83,7 +83,7 @@ public: } int total_width = 0; - BOOST_FOREACH (EditableListColumn i, _columns) { + for (auto i: _columns) { total_width += i.width.get_value_or (_default_width); } @@ -101,7 +101,7 @@ public: #endif int j = 0; - BOOST_FOREACH (EditableListColumn i, _columns) { + for (auto i: _columns) { wxListItem ip; ip.SetId (j); ip.SetText (i.name); @@ -268,7 +268,7 @@ private: int fixed_width = 0; int growable = 0; int j = 0; - BOOST_FOREACH (EditableListColumn i, _columns) { + for (auto i: _columns) { fixed_width += i.width.get_value_or (_default_width); if (!i.growable) { _list->SetColumnWidth (j, i.width.get_value_or(_default_width)); @@ -279,7 +279,7 @@ private: } j = 0; - BOOST_FOREACH (EditableListColumn i, _columns) { + for (auto i: _columns) { if (i.growable) { _list->SetColumnWidth (j, i.width.get_value_or(_default_width) + (w - fixed_width) / growable); } diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc index ce91c3cc4..bb40dad9f 100644 --- a/src/wx/film_editor.cc +++ b/src/wx/film_editor.cc @@ -32,7 +32,6 @@ #include "lib/dcp_content.h" #include #include -#include #include using std::cout; diff --git a/src/wx/film_name_location_dialog.cc b/src/wx/film_name_location_dialog.cc index 2c9b165d0..2ef6c9955 100644 --- a/src/wx/film_name_location_dialog.cc +++ b/src/wx/film_name_location_dialog.cc @@ -28,7 +28,6 @@ #include "lib/compose.hpp" #include #include -#include using namespace std; using namespace boost; @@ -68,7 +67,7 @@ FilmNameLocationDialog::FilmNameLocationDialog (wxWindow* parent, wxString title if (offer_templates) { _template_name->Enable (false); - BOOST_FOREACH (string i, Config::instance()->templates ()) { + for (auto i: Config::instance()->templates ()) { _template_name->Append (std_to_wx (i)); } diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index cc25ccdd5..6e5b486d5 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -463,7 +463,7 @@ FilmViewer::set_coalesce_player_changes (bool c) _coalesce_player_changes = c; if (!c) { - BOOST_FOREACH (int i, _pending_player_changes) { + for (auto i: _pending_player_changes) { player_change (CHANGE_TYPE_DONE, i, false); } _pending_player_changes.clear (); @@ -622,7 +622,7 @@ FilmViewer::average_latency () const } Frame total = 0; - BOOST_FOREACH (Frame i, _latency_history) { + for (auto i: _latency_history) { total += i; } diff --git a/src/wx/filter_dialog.cc b/src/wx/filter_dialog.cc index 6f479e546..a65f5153a 100644 --- a/src/wx/filter_dialog.cc +++ b/src/wx/filter_dialog.cc @@ -28,7 +28,6 @@ #include "wx_util.h" #include "lib/film.h" #include "lib/filter.h" -#include using namespace std; @@ -46,7 +45,7 @@ FilterDialog::FilterDialog (wxWindow* parent, vector const & act typedef map > CategoryMap; CategoryMap categories; - BOOST_FOREACH (Filter const* i, filters) { + for (auto i: filters) { CategoryMap::iterator j = categories.find (i->category()); if (j == categories.end ()) { list c; @@ -65,7 +64,7 @@ FilterDialog::FilterDialog (wxWindow* parent, vector const & act c->SetFont(font); sizer->Add (c, 1, wxTOP | wxBOTTOM, DCPOMATIC_SIZER_GAP); - BOOST_FOREACH (Filter const* j, i->second) { + for (auto j: i->second) { wxCheckBox* b = new CheckBox(panel, std_to_wx(j->name())); bool const a = find (active.begin(), active.end(), j) != active.end(); b->SetValue (a); diff --git a/src/wx/fonts_dialog.cc b/src/wx/fonts_dialog.cc index 8ff6cf13e..29af6a739 100644 --- a/src/wx/fonts_dialog.cc +++ b/src/wx/fonts_dialog.cc @@ -26,7 +26,6 @@ #include "lib/content.h" #include "lib/text_content.h" #include -#include #include using std::list; @@ -92,7 +91,7 @@ FontsDialog::setup () _fonts->DeleteAllItems (); size_t n = 0; - BOOST_FOREACH (shared_ptr i, caption->fonts ()) { + for (auto i: caption->fonts ()) { wxListItem item; item.SetId (n); _fonts->InsertItem (item); @@ -131,7 +130,7 @@ FontsDialog::edit_clicked () int const item = _fonts->GetNextItem (-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); string const id = wx_to_std (_fonts->GetItemText (item, 0)); shared_ptr font; - BOOST_FOREACH (shared_ptr i, caption->fonts()) { + for (auto i: caption->fonts()) { if (i->id() == id) { font = i; } diff --git a/src/wx/full_config_dialog.cc b/src/wx/full_config_dialog.cc index f376d9682..ea84136e1 100644 --- a/src/wx/full_config_dialog.cc +++ b/src/wx/full_config_dialog.cc @@ -57,7 +57,6 @@ #include #include #include -#include #include using std::vector; @@ -331,13 +330,13 @@ private: _isdcf_metadata_button->Bind (wxEVT_BUTTON, boost::bind (&DefaultsPage::edit_isdcf_metadata_clicked, this)); - BOOST_FOREACH (Ratio const * i, Ratio::containers()) { + for (auto i: Ratio::containers()) { _container->Append (std_to_wx(i->container_nickname())); } _container->Bind (wxEVT_CHOICE, boost::bind (&DefaultsPage::container_changed, this)); - BOOST_FOREACH (DCPContentType const * i, DCPContentType::all()) { + for (auto i: DCPContentType::all()) { _dcp_content_type->Append (std_to_wx (i->pretty_name ())); } diff --git a/src/wx/gain_calculator_dialog.cc b/src/wx/gain_calculator_dialog.cc index 701856610..9c8b87dac 100644 --- a/src/wx/gain_calculator_dialog.cc +++ b/src/wx/gain_calculator_dialog.cc @@ -37,7 +37,7 @@ GainCalculatorDialog::GainCalculatorDialog (wxWindow* parent) add (_("But I have to use fader"), true); _actual = add (new wxTextCtrl (this, wxID_ANY, wxT (""), wxDefaultPosition, wxDefaultSize, 0, wxTextValidator (wxFILTER_NUMERIC))); - BOOST_FOREACH (CinemaSoundProcessor const * i, CinemaSoundProcessor::all()) { + for (auto i: CinemaSoundProcessor::all()) { _processor->Append (std_to_wx(i->name())); } diff --git a/src/wx/hints_dialog.cc b/src/wx/hints_dialog.cc index 78aa237e1..2c6bac14a 100644 --- a/src/wx/hints_dialog.cc +++ b/src/wx/hints_dialog.cc @@ -29,7 +29,6 @@ DCPOMATIC_DISABLE_WARNINGS #include DCPOMATIC_ENABLE_WARNINGS -#include using std::max; using std::vector; @@ -139,7 +138,7 @@ HintsDialog::update () } } else { _text->BeginStandardBullet (N_("standard/circle"), 1, 50); - BOOST_FOREACH (string i, _current) { + for (auto i: _current) { _text->WriteText (std_to_wx (i)); _text->Newline (); } diff --git a/src/wx/job_manager_view.cc b/src/wx/job_manager_view.cc index 3c0f44675..6b341307d 100644 --- a/src/wx/job_manager_view.cc +++ b/src/wx/job_manager_view.cc @@ -31,7 +31,6 @@ #include "lib/util.h" #include "lib/exceptions.h" #include "lib/compose.hpp" -#include #include using std::string; @@ -109,9 +108,9 @@ JobManagerView::replace () list > new_job_records; - BOOST_FOREACH (shared_ptr i, JobManager::instance()->get()) { + for (auto i: JobManager::instance()->get()) { /* Find this job's JobView */ - BOOST_FOREACH (shared_ptr j, _job_records) { + for (auto j: _job_records) { if (j->job() == i) { new_job_records.push_back (j); break; @@ -119,13 +118,13 @@ JobManagerView::replace () } } - BOOST_FOREACH (shared_ptr i, _job_records) { + for (auto i: _job_records) { i->detach (); } _job_records = new_job_records; - BOOST_FOREACH (shared_ptr i, _job_records) { + for (auto i: _job_records) { i->insert (i->insert_position ()); } @@ -135,7 +134,7 @@ JobManagerView::replace () void JobManagerView::job_list_changed () { - BOOST_FOREACH (shared_ptr i, _job_records) { + for (auto i: _job_records) { i->job_list_changed (); } } diff --git a/src/wx/kdm_cpl_panel.cc b/src/wx/kdm_cpl_panel.cc index 88c73ed11..be5e42dd8 100644 --- a/src/wx/kdm_cpl_panel.cc +++ b/src/wx/kdm_cpl_panel.cc @@ -27,7 +27,6 @@ DCPOMATIC_DISABLE_WARNINGS #include DCPOMATIC_ENABLE_WARNINGS #include -#include using std::vector; @@ -72,7 +71,7 @@ KDMCPLPanel::update_cpl_choice () { _cpl->Clear (); - BOOST_FOREACH (CPLSummary const & i, _cpls) { + for (auto const& i: _cpls) { _cpl->Append (std_to_wx(i.cpl_id)); if (_cpls.size() > 0) { @@ -116,10 +115,10 @@ KDMCPLPanel::cpl_browse_clicked () cpl_document.read_file (cpl_file); bool encrypted = false; - BOOST_FOREACH (cxml::ConstNodePtr i, cpl_document.node_children("ReelList")) { - BOOST_FOREACH (cxml::ConstNodePtr j, i->node_children("Reel")) { - BOOST_FOREACH (cxml::ConstNodePtr k, j->node_children("AssetList")) { - BOOST_FOREACH (cxml::ConstNodePtr l, k->node_children()) { + for (auto i: cpl_document.node_children("ReelList")) { + for (auto j: i->node_children("Reel")) { + for (auto k: j->node_children("AssetList")) { + for (auto l: k->node_children()) { if (!l->node_children("KeyId").empty()) { encrypted = true; } diff --git a/src/wx/kdm_dialog.cc b/src/wx/kdm_dialog.cc index 666701168..601562b27 100644 --- a/src/wx/kdm_dialog.cc +++ b/src/wx/kdm_dialog.cc @@ -92,7 +92,7 @@ KDMDialog::KDMDialog (wxWindow* parent, shared_ptr film) right->Add (h); vector cpls; - BOOST_FOREACH (CPLSummary const & i, film->cpls()) { + for (auto const& i: film->cpls()) { if (i.encrypted) { cpls.push_back (i); } @@ -164,7 +164,7 @@ KDMDialog::make_clicked () for_audio = _output->forensic_mark_audio_up_to(); } - BOOST_FOREACH (shared_ptr i, _screens->screens()) { + for (auto i: _screens->screens()) { KDMWithMetadataPtr p = kdm_for_screen (film, _cpl->cpl(), i, _timing->from(), _timing->until(), _output->formulation(), !_output->forensic_mark_video(), for_audio); if (p) { kdms.push_back (p); diff --git a/src/wx/kdm_output_panel.cc b/src/wx/kdm_output_panel.cc index c08a76732..b002a765c 100644 --- a/src/wx/kdm_output_panel.cc +++ b/src/wx/kdm_output_panel.cc @@ -209,7 +209,7 @@ KDMOutputPanel::make ( } bool cinemas_with_no_email = false; - BOOST_FOREACH (list i, cinema_kdms) { + for (auto i: cinema_kdms) { if (i.front()->emails().empty()) { cinemas_with_no_email = true; } @@ -224,8 +224,8 @@ KDMOutputPanel::make ( if (proceed && Config::instance()->confirm_kdm_email ()) { list emails; - BOOST_FOREACH (list const& i, cinema_kdms) { - BOOST_FOREACH (string j, i.front()->emails()) { + for (auto const& i: cinema_kdms) { + for (auto j: i.front()->emails()) { emails.push_back (j); } } diff --git a/src/wx/language_tag_dialog.cc b/src/wx/language_tag_dialog.cc index 2d2fc81f6..d9add6dca 100644 --- a/src/wx/language_tag_dialog.cc +++ b/src/wx/language_tag_dialog.cc @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include @@ -85,7 +84,7 @@ public: _matching_subtags.clear (); boost::algorithm::to_lower(search); - BOOST_FOREACH (dcp::LanguageTag::SubtagData const& i, _all_subtags) { + for (auto const& i: _all_subtags) { if ( (boost::algorithm::to_lower_copy(i.subtag).find(search) != string::npos) || (boost::algorithm::to_lower_copy(i.description).find(search) != string::npos)) { @@ -262,7 +261,7 @@ dcp::LanguageTag LanguageTagDialog::get () const vector variants; vector extlangs; - BOOST_FOREACH (Subtag i, _current_tag_subtags) { + for (auto i: _current_tag_subtags) { if (!i.subtag) { continue; } @@ -401,7 +400,7 @@ LanguageTagDialog::setup_sensitivity () _add_region->Enable (); _add_variant->Enable (); _add_external->Enable (); - BOOST_FOREACH (Subtag const& i, _current_tag_subtags) { + for (auto const& i: _current_tag_subtags) { switch (i.type) { case dcp::LanguageTag::SCRIPT: _add_script->Enable (false); diff --git a/src/wx/move_to_dialog.cc b/src/wx/move_to_dialog.cc index b4b6e3ae3..542655477 100644 --- a/src/wx/move_to_dialog.cc +++ b/src/wx/move_to_dialog.cc @@ -21,7 +21,6 @@ #include "move_to_dialog.h" #include "lib/film.h" #include -#include using std::list; using std::shared_ptr; @@ -41,7 +40,7 @@ MoveToDialog::MoveToDialog (wxWindow* parent, optional position, shared if (position) { int j = 0; - BOOST_FOREACH (DCPTimePeriod i, film->reels()) { + for (auto i: film->reels()) { if (i.from == position.get()) { _reel->SetValue (j + 1); } diff --git a/src/wx/nag_dialog.cc b/src/wx/nag_dialog.cc index 5b989bdb5..466b80b6b 100644 --- a/src/wx/nag_dialog.cc +++ b/src/wx/nag_dialog.cc @@ -22,7 +22,6 @@ #include "wx_util.h" #include "static_text.h" #include "check_box.h" -#include using std::shared_ptr; #if BOOST_VERSION >= 106100 diff --git a/src/wx/name_format_editor.h b/src/wx/name_format_editor.h index 32c78ea25..e3728615f 100644 --- a/src/wx/name_format_editor.h +++ b/src/wx/name_format_editor.h @@ -27,7 +27,6 @@ DCPOMATIC_DISABLE_WARNINGS #include DCPOMATIC_ENABLE_WARNINGS -#include #include class NameFormatEditor diff --git a/src/wx/player_config_dialog.cc b/src/wx/player_config_dialog.cc index 3158b279c..06a1ef56b 100644 --- a/src/wx/player_config_dialog.cc +++ b/src/wx/player_config_dialog.cc @@ -54,7 +54,6 @@ #include #include #include -#include #include using std::vector; diff --git a/src/wx/player_stress_tester.cc b/src/wx/player_stress_tester.cc index dfe2d181e..6dd2dd674 100644 --- a/src/wx/player_stress_tester.cc +++ b/src/wx/player_stress_tester.cc @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include @@ -99,7 +98,7 @@ PlayerStressTester::load_script (boost::filesystem::path file) vector lines; string const script = dcp::file_to_string(file); boost::split (lines, script, boost::is_any_of("\n")); - BOOST_FOREACH (string i, lines) { + for (auto i: lines) { _commands.push_back (Command(i)); } _current_command = _commands.begin(); diff --git a/src/wx/playlist_controls.cc b/src/wx/playlist_controls.cc index 56ff5f40d..d65cb0fcc 100644 --- a/src/wx/playlist_controls.cc +++ b/src/wx/playlist_controls.cc @@ -288,7 +288,7 @@ PlaylistControls::update_playlist_directory () } sort (_playlists.begin(), _playlists.end(), SPLComparator()); - BOOST_FOREACH (SPL i, _playlists) { + for (auto i: _playlists) { add_playlist_to_list (i); } @@ -349,7 +349,7 @@ PlaylistControls::select_playlist (int selected, int position) wxProgressDialog dialog (_("DCP-o-matic"), "Loading playlist and KDMs"); - BOOST_FOREACH (SPLEntry const & i, _playlists[selected].get()) { + for (auto const& i: _playlists[selected].get()) { dialog.Pulse (); shared_ptr dcp = dynamic_pointer_cast (i.content); if (dcp && dcp->needs_kdm()) { @@ -375,7 +375,7 @@ PlaylistControls::select_playlist (int selected, int position) _current_spl_view->DeleteAllItems (); int N = 0; - BOOST_FOREACH (SPLEntry i, _playlists[selected].get()) { + for (auto i: _playlists[selected].get()) { wxListItem it; it.SetId (N); it.SetColumn (0); diff --git a/src/wx/qube_certificate_panel.cc b/src/wx/qube_certificate_panel.cc index 70fe0ae47..c67cc46f2 100644 --- a/src/wx/qube_certificate_panel.cc +++ b/src/wx/qube_certificate_panel.cc @@ -53,7 +53,7 @@ QubeCertificatePanel::do_download () string const serial = wx_to_std(_serial->GetValue()); optional name; - BOOST_FOREACH (string i, files) { + for (auto i: files) { if (boost::algorithm::starts_with(i, String::compose("%1-%2-", _type, serial))) { name = i; break; diff --git a/src/wx/recipients_panel.cc b/src/wx/recipients_panel.cc index 086eac3e4..e59293fe7 100644 --- a/src/wx/recipients_panel.cc +++ b/src/wx/recipients_panel.cc @@ -23,7 +23,6 @@ #include "recipient_dialog.h" #include "dcpomatic_button.h" #include "lib/config.h" -#include #include #include @@ -225,7 +224,7 @@ RecipientsPanel::add_recipients () { _root = _targets->AddRoot ("Foo"); - BOOST_FOREACH (shared_ptr i, Config::instance()->dkdm_recipients()) { + for (auto i: Config::instance()->dkdm_recipients()) { add_recipient (i); } } diff --git a/src/wx/recreate_chain_dialog.cc b/src/wx/recreate_chain_dialog.cc index 322d5964c..92e71af34 100644 --- a/src/wx/recreate_chain_dialog.cc +++ b/src/wx/recreate_chain_dialog.cc @@ -23,7 +23,6 @@ #include "static_text.h" #include "check_box.h" #include "lib/config.h" -#include using std::list; using std::string; diff --git a/src/wx/save_template_dialog.cc b/src/wx/save_template_dialog.cc index d1f60b8d1..6a6644efe 100644 --- a/src/wx/save_template_dialog.cc +++ b/src/wx/save_template_dialog.cc @@ -21,7 +21,6 @@ #include "save_template_dialog.h" #include "wx_util.h" #include "lib/config.h" -#include using std::string; #if BOOST_VERSION >= 106100 diff --git a/src/wx/screens_panel.cc b/src/wx/screens_panel.cc index ee88d0178..02b51f860 100644 --- a/src/wx/screens_panel.cc +++ b/src/wx/screens_panel.cc @@ -26,7 +26,6 @@ #include "lib/config.h" #include "lib/cinema.h" #include "lib/screen.h" -#include using std::list; using std::pair; @@ -134,7 +133,7 @@ ScreensPanel::add_cinema (shared_ptr c) _cinemas[id] = c; - BOOST_FOREACH (shared_ptr i, c->screens()) { + for (auto i: c->screens()) { add_screen (c, i); } @@ -239,7 +238,7 @@ ScreensPanel::add_screen_clicked () return; } - BOOST_FOREACH (shared_ptr i, c->screens ()) { + for (auto i: c->screens ()) { if (i->name == d->name()) { error_dialog ( GetParent(), @@ -280,7 +279,7 @@ ScreensPanel::edit_screen_clicked () } shared_ptr c = s.second->cinema; - BOOST_FOREACH (shared_ptr i, c->screens ()) { + for (auto i: c->screens ()) { if (i != s.second && i->name == d->name()) { error_dialog ( GetParent(), @@ -399,7 +398,7 @@ ScreensPanel::add_cinemas () { _root = _targets->AddRoot ("Foo"); - BOOST_FOREACH (shared_ptr i, Config::instance()->cinemas ()) { + for (auto i: Config::instance()->cinemas()) { add_cinema (i); } } diff --git a/src/wx/servers_list_dialog.cc b/src/wx/servers_list_dialog.cc index 37a143384..d904a2ef0 100644 --- a/src/wx/servers_list_dialog.cc +++ b/src/wx/servers_list_dialog.cc @@ -23,7 +23,6 @@ #include "lib/encode_server_finder.h" #include "lib/encode_server_description.h" #include -#include using std::list; using std::string; @@ -77,7 +76,7 @@ ServersListDialog::servers_list_changed () int n = 0; - BOOST_FOREACH (EncodeServerDescription i, EncodeServerFinder::instance()->servers()) { + for (auto i: EncodeServerFinder::instance()->servers()) { wxListItem list_item; list_item.SetId (n); _list->InsertItem (list_item); diff --git a/src/wx/suspender.cc b/src/wx/suspender.cc index 9b1b64c85..6cd78326a 100644 --- a/src/wx/suspender.cc +++ b/src/wx/suspender.cc @@ -19,7 +19,6 @@ */ #include "suspender.h" -#include Suspender::Suspender(boost::function handler) : _handler (handler) @@ -56,7 +55,7 @@ Suspender::decrement () { --_count; if (_count == 0) { - BOOST_FOREACH (int i, _pending) { + for (auto i: _pending) { _handler (i); } _pending.clear (); diff --git a/src/wx/system_font_dialog.cc b/src/wx/system_font_dialog.cc index 167f7f75d..6a98ecec6 100644 --- a/src/wx/system_font_dialog.cc +++ b/src/wx/system_font_dialog.cc @@ -22,7 +22,6 @@ #include "wx_util.h" #include #include -#include #include using std::cout; @@ -62,7 +61,7 @@ SystemFontDialog::SystemFontDialog (wxWindow* parent) sizer->Add (_list, 0, wxALL, DCPOMATIC_SIZER_X_GAP); int n = 0; - BOOST_FOREACH (boost::filesystem::path i, _fonts) { + for (auto i: _fonts) { _list->InsertItem (n++, std_to_wx (i.leaf().stem().string ())); } diff --git a/src/wx/templates_dialog.cc b/src/wx/templates_dialog.cc index 53eb2e422..e8f9b8a2b 100644 --- a/src/wx/templates_dialog.cc +++ b/src/wx/templates_dialog.cc @@ -24,7 +24,6 @@ #include "dcpomatic_button.h" #include "lib/config.h" #include -#include using std::string; using boost::bind; @@ -82,7 +81,7 @@ TemplatesDialog::refresh () { _list->DeleteAllItems (); - BOOST_FOREACH (string i, Config::instance()->templates()) { + for (auto i: Config::instance()->templates()) { wxListItem list_item; int const n = _list->GetItemCount (); list_item.SetId (n); diff --git a/src/wx/text_panel.cc b/src/wx/text_panel.cc index 5b54fa35b..521e55fc5 100644 --- a/src/wx/text_panel.cc +++ b/src/wx/text_panel.cc @@ -43,7 +43,6 @@ #include "lib/analyse_subtitles_job.h" #include "lib/subtitle_analysis.h" #include -#include using std::vector; using std::string; @@ -279,7 +278,7 @@ TextPanel::update_dcp_track_selection () optional selected; bool many = false; - BOOST_FOREACH (shared_ptr i, _parent->selected_text()) { + for (auto i: _parent->selected_text()) { shared_ptr t = i->text_of_original_type(_original_type); if (t) { optional dt = t->dcp_track(); @@ -292,7 +291,7 @@ TextPanel::update_dcp_track_selection () } int n = 0; - BOOST_FOREACH (DCPTextTrack i, _parent->film()->closed_caption_tracks()) { + for (auto i: _parent->film()->closed_caption_tracks()) { if (!many && selected && *selected == i) { _dcp_track->SetSelection (n); } @@ -310,7 +309,7 @@ TextPanel::update_dcp_tracks () DCPOMATIC_ASSERT (_dcp_track); _dcp_track->Clear (); - BOOST_FOREACH (DCPTextTrack i, _parent->film()->closed_caption_tracks()) { + for (auto i: _parent->film()->closed_caption_tracks()) { /* XXX: don't display the "magic" track which has empty name and language; this is a nasty hack (see also Film::closed_caption_tracks) */ @@ -339,7 +338,7 @@ TextPanel::dcp_track_changed () d->Destroy (); } else { /* Find the DCPTextTrack that was selected */ - BOOST_FOREACH (DCPTextTrack i, _parent->film()->closed_caption_tracks()) { + for (auto i: _parent->film()->closed_caption_tracks()) { if (i.summary() == wx_to_std(_dcp_track->GetStringSelection())) { track = i; } @@ -347,7 +346,7 @@ TextPanel::dcp_track_changed () } if (track) { - BOOST_FOREACH (shared_ptr i, _parent->selected_text()) { + for (auto i: _parent->selected_text()) { shared_ptr t = i->text_of_original_type(_original_type); if (t && t->type() == TEXT_CLOSED_CAPTION) { t->set_dcp_track(*track); @@ -464,7 +463,7 @@ TextPanel::film_content_changed (int property) void TextPanel::use_toggled () { - BOOST_FOREACH (shared_ptr i, _parent->selected_text()) { + for (auto i: _parent->selected_text()) { i->text_of_original_type(_original_type)->set_use (_use->GetValue()); } } @@ -486,7 +485,7 @@ TextPanel::current_type () const void TextPanel::type_changed () { - BOOST_FOREACH (shared_ptr i, _parent->selected_text()) { + for (auto i: _parent->selected_text()) { i->text_of_original_type(_original_type)->set_type (current_type ()); } @@ -496,7 +495,7 @@ TextPanel::type_changed () void TextPanel::burn_toggled () { - BOOST_FOREACH (shared_ptr i, _parent->selected_text ()) { + for (auto i: _parent->selected_text ()) { i->text_of_original_type(_original_type)->set_burn (_burn->GetValue()); } } @@ -510,7 +509,7 @@ TextPanel::setup_sensitivity () /* DCP subs can't have their line spacing changed */ int dcp_subs = 0; ContentList sel = _parent->selected_text (); - BOOST_FOREACH (shared_ptr i, sel) { + for (auto i: sel) { /* These are the content types that could include subtitles */ shared_ptr fc = std::dynamic_pointer_cast (i); shared_ptr sc = std::dynamic_pointer_cast (i); @@ -616,7 +615,7 @@ TextPanel::stream_changed () void TextPanel::x_offset_changed () { - BOOST_FOREACH (shared_ptr i, _parent->selected_text ()) { + for (auto i: _parent->selected_text ()) { i->text_of_original_type(_original_type)->set_x_offset (_x_offset->GetValue() / 100.0); } } @@ -624,7 +623,7 @@ TextPanel::x_offset_changed () void TextPanel::y_offset_changed () { - BOOST_FOREACH (shared_ptr i, _parent->selected_text ()) { + for (auto i: _parent->selected_text ()) { i->text_of_original_type(_original_type)->set_y_offset (_y_offset->GetValue() / 100.0); } } @@ -641,7 +640,7 @@ TextPanel::x_scale_changed () void TextPanel::y_scale_changed () { - BOOST_FOREACH (shared_ptr i, _parent->selected_text ()) { + for (auto i: _parent->selected_text ()) { i->text_of_original_type(_original_type)->set_y_scale (_y_scale->GetValue() / 100.0); } } @@ -649,7 +648,7 @@ TextPanel::y_scale_changed () void TextPanel::line_spacing_changed () { - BOOST_FOREACH (shared_ptr i, _parent->selected_text ()) { + for (auto i: _parent->selected_text ()) { i->text_of_original_type(_original_type)->set_line_spacing (_line_spacing->GetValue() / 100.0); } } @@ -770,7 +769,7 @@ TextPanel::try_to_load_analysis () boost::filesystem::path const path = _parent->film()->subtitle_analysis_path(content); if (!boost::filesystem::exists(path)) { - BOOST_FOREACH (shared_ptr i, JobManager::instance()->get()) { + for (auto i: JobManager::instance()->get()) { if (dynamic_pointer_cast(i)) { i->cancel (); } diff --git a/src/wx/text_view.cc b/src/wx/text_view.cc index b4b2baae2..3b674b5c1 100644 --- a/src/wx/text_view.cc +++ b/src/wx/text_view.cc @@ -94,7 +94,7 @@ TextView::TextView ( _frc = film->active_frame_rate_change (content->position()); /* Find the decoder that is being used for our TextContent and attach to it */ - BOOST_FOREACH (shared_ptr i, decoder->text) { + for (auto i: decoder->text) { if (i->content() == text) { i->PlainStart.connect (bind (&TextView::data_start, this, _1)); i->Stop.connect (bind (&TextView::data_stop, this, _1)); @@ -107,7 +107,7 @@ TextView::TextView ( void TextView::data_start (ContentStringText cts) { - BOOST_FOREACH (dcp::SubtitleString const & i, cts.subs) { + for (auto const& i: cts.subs) { wxListItem list_item; list_item.SetId (_subs); _list->InsertItem (list_item); diff --git a/src/wx/timeline.cc b/src/wx/timeline.cc index 054eac734..e5182a0a4 100644 --- a/src/wx/timeline.cc +++ b/src/wx/timeline.cc @@ -39,7 +39,6 @@ #include "lib/video_content.h" #include "lib/atmos_mxf_content.h" #include -#include #include #include #include @@ -174,13 +173,13 @@ Timeline::paint_main () gc->SetAntialiasMode (wxANTIALIAS_DEFAULT); - BOOST_FOREACH (shared_ptr i, _views) { + for (auto i: _views) { shared_ptr ic = dynamic_pointer_cast (i); /* Find areas of overlap with other content views, so that we can plot them */ list > overlaps; - BOOST_FOREACH (shared_ptr j, _views) { + for (auto j: _views) { shared_ptr jc = dynamic_pointer_cast (j); /* No overlap with non-content views, views no different tracks, audio views or non-active views */ if (!ic || !jc || i == j || ic->track() != jc->track() || ic->track().get_value_or(2) >= 2 || !ic->active() || !jc->active()) { @@ -251,7 +250,7 @@ Timeline::recreate_views () _views.push_back (_time_axis_view); _views.push_back (_reels_view); - BOOST_FOREACH (shared_ptr i, film->content ()) { + for (auto i: film->content ()) { if (i->video) { _views.push_back (shared_ptr (new TimelineVideoContentView (*this, i))); } @@ -260,7 +259,7 @@ Timeline::recreate_views () _views.push_back (shared_ptr (new TimelineAudioContentView (*this, i))); } - BOOST_FOREACH (shared_ptr j, i->text) { + for (auto j: i->text) { _views.push_back (shared_ptr (new TimelineTextContentView (*this, i, j))); } @@ -299,7 +298,7 @@ place (shared_ptr film, TimelineViewList& views, int& tracks) { int const base = tracks; - BOOST_FOREACH (shared_ptr i, views) { + for (auto i: views) { if (!dynamic_pointer_cast(i)) { continue; } @@ -396,7 +395,7 @@ Timeline::assign_tracks () /* Video */ bool have_3d = false; - BOOST_FOREACH (shared_ptr i, _views) { + for (auto i: _views) { shared_ptr cv = dynamic_pointer_cast (i); if (!cv) { continue; @@ -421,7 +420,7 @@ Timeline::assign_tracks () /* Atmos */ bool have_atmos = false; - BOOST_FOREACH (shared_ptr i, _views) { + for (auto i: _views) { shared_ptr cv = dynamic_pointer_cast(i); if (cv) { cv->set_track (_tracks); @@ -559,7 +558,7 @@ Timeline::left_down_select (wxMouseEvent& ev) _start_snaps.push_back (cv->content()->end(film)); _end_snaps.push_back (cv->content()->end(film)); - BOOST_FOREACH (DCPTime i, cv->content()->reel_split_points(film)) { + for (auto i: cv->content()->reel_split_points(film)) { _start_snaps.push_back (i); } } @@ -776,11 +775,11 @@ Timeline::set_position_from_event (wxMouseEvent& ev, bool force_emit) /* Find the nearest snap point */ - BOOST_FOREACH (DCPTime i, _start_snaps) { + for (auto i: _start_snaps) { maybe_snap (i, new_position, nearest_distance); } - BOOST_FOREACH (DCPTime i, _end_snaps) { + for (auto i: _end_snaps) { maybe_snap (i, new_end, nearest_distance); } diff --git a/src/wx/timeline_audio_content_view.cc b/src/wx/timeline_audio_content_view.cc index d26c40252..03481343c 100644 --- a/src/wx/timeline_audio_content_view.cc +++ b/src/wx/timeline_audio_content_view.cc @@ -71,7 +71,7 @@ TimelineAudioContentView::label () const list mapped = ac->mapping().mapped_output_channels(); if (!mapped.empty ()) { s += " → "; - BOOST_FOREACH (int i, mapped) { + for (auto i: mapped) { s += std_to_wx(short_audio_channel_name(i)) + ", "; } s = s.Left(s.Length() - 2); diff --git a/src/wx/timeline_content_view.cc b/src/wx/timeline_content_view.cc index 2f2b7e3ed..8258a81f9 100644 --- a/src/wx/timeline_content_view.cc +++ b/src/wx/timeline_content_view.cc @@ -23,7 +23,6 @@ #include "wx_util.h" #include "lib/content.h" #include -#include using std::list; using std::shared_ptr; @@ -131,7 +130,7 @@ TimelineContentView::do_paint (wxGraphicsContext* gc, list /* Reel split points */ gc->SetPen (*wxThePenList->FindOrCreatePen (foreground_colour(), 1, wxPENSTYLE_DOT)); - BOOST_FOREACH (DCPTime i, cont->reel_split_points(film)) { + for (auto i: cont->reel_split_points(film)) { path = gc->CreatePath (); path.MoveToPoint (time_x (i), y_pos (_track.get()) + 4); path.AddLineToPoint (time_x (i), y_pos (_track.get() + 1) - 4); diff --git a/src/wx/timeline_reels_view.cc b/src/wx/timeline_reels_view.cc index fa89c60a7..962451ac3 100644 --- a/src/wx/timeline_reels_view.cc +++ b/src/wx/timeline_reels_view.cc @@ -22,7 +22,6 @@ #include "timeline.h" #include #include -#include using std::min; using std::list; @@ -67,7 +66,7 @@ TimelineReelsView::do_paint (wxGraphicsContext* gc, list >) gc->SetFont (gc->CreateFont (*wxNORMAL_FONT, wxColour (0, 0, 255))); int reel = 1; - BOOST_FOREACH (DCPTimePeriod i, _timeline.film()->reels()) { + for (auto i: _timeline.film()->reels()) { int const size = min (8.0, i.duration().seconds() * pps / 2); wxGraphicsPath path = gc->CreatePath (); diff --git a/src/wx/timing_panel.cc b/src/wx/timing_panel.cc index 82aaadedd..ecf55640d 100644 --- a/src/wx/timing_panel.cc +++ b/src/wx/timing_panel.cc @@ -43,7 +43,6 @@ DCPOMATIC_DISABLE_WARNINGS #include DCPOMATIC_ENABLE_WARNINGS #endif -#include #include #include @@ -179,7 +178,7 @@ void TimingPanel::update_full_length () { set check; - BOOST_FOREACH (shared_ptr i, _parent->selected ()) { + for (auto i: _parent->selected()) { check.insert (i->full_length(_parent->film())); } @@ -194,7 +193,7 @@ void TimingPanel::update_play_length () { set check; - BOOST_FOREACH (shared_ptr i, _parent->selected ()) { + for (auto i: _parent->selected()) { check.insert (i->length_after_trim(_parent->film())); } @@ -221,7 +220,7 @@ TimingPanel::film_content_changed (int property) if (property == ContentProperty::POSITION) { set check; - BOOST_FOREACH (shared_ptr i, _parent->selected ()) { + for (auto i: _parent->selected()) { check.insert (i->position ()); } @@ -242,7 +241,7 @@ TimingPanel::film_content_changed (int property) } else if (property == ContentProperty::TRIM_START) { set check; - BOOST_FOREACH (shared_ptr i, _parent->selected ()) { + for (auto i: _parent->selected()) { check.insert (i->trim_start ()); } @@ -255,7 +254,7 @@ TimingPanel::film_content_changed (int property) } else if (property == ContentProperty::TRIM_END) { set check; - BOOST_FOREACH (shared_ptr i, _parent->selected ()) { + for (auto i: _parent->selected()) { check.insert (i->trim_end ()); } @@ -282,7 +281,7 @@ TimingPanel::film_content_changed (int property) shared_ptr content; int count_ac = 0; int count_sc = 0; - BOOST_FOREACH (shared_ptr i, _parent->selected ()) { + for (auto i: _parent->selected()) { if (i->video && i->video_frame_rate()) { check_vc.insert (i->video_frame_rate().get()); content = i; @@ -300,7 +299,7 @@ TimingPanel::film_content_changed (int property) } bool have_still = false; - BOOST_FOREACH (shared_ptr i, _parent->selected ()) { + for (auto i: _parent->selected()) { shared_ptr ic = dynamic_pointer_cast (i); if (ic && ic->still ()) { have_still = true; @@ -316,7 +315,7 @@ void TimingPanel::position_changed () { DCPTime const pos = _position->get (_parent->film()->video_frame_rate ()); - BOOST_FOREACH (shared_ptr i, _parent->selected ()) { + for (auto i: _parent->selected()) { i->set_position (_parent->film(), pos); } } @@ -326,7 +325,7 @@ TimingPanel::full_length_changed () { int const vfr = _parent->film()->video_frame_rate (); Frame const len = _full_length->get (vfr).frames_round (vfr); - BOOST_FOREACH (shared_ptr i, _parent->selected ()) { + for (auto i: _parent->selected()) { shared_ptr ic = dynamic_pointer_cast (i); if (ic && ic->still ()) { ic->video->set_length (len); @@ -351,7 +350,7 @@ TimingPanel::trim_start_changed () optional ref_ph; Suspender::Block bl = _film_content_changed_suspender.block (); - BOOST_FOREACH (shared_ptr i, _parent->selected ()) { + for (auto i: _parent->selected()) { if (i->position() <= ph && ph < i->end(_parent->film())) { /* The playhead is in i. Use it as a reference to work out where to put the playhead post-trim; we're trying to keep the playhead @@ -384,7 +383,7 @@ TimingPanel::trim_end_changed () fv->set_coalesce_player_changes (true); Suspender::Block bl = _film_content_changed_suspender.block (); - BOOST_FOREACH (shared_ptr i, _parent->selected ()) { + for (auto i: _parent->selected()) { ContentTime const trim = _trim_end->get (i->video_frame_rate().get_value_or(_parent->film()->video_frame_rate())); i->set_trim_end (trim); } @@ -402,7 +401,7 @@ TimingPanel::play_length_changed () { DCPTime const play_length = _play_length->get (_parent->film()->video_frame_rate()); Suspender::Block bl = _film_content_changed_suspender.block (); - BOOST_FOREACH (shared_ptr i, _parent->selected ()) { + for (auto i: _parent->selected()) { FrameRateChange const frc = _parent->film()->active_frame_rate_change (i->position ()); i->set_trim_end ( ContentTime (max(DCPTime(), i->full_length(_parent->film()) - play_length), frc) - i->trim_start() @@ -446,7 +445,7 @@ TimingPanel::trim_start_to_playhead_clicked () fv->set_coalesce_player_changes (true); - BOOST_FOREACH (shared_ptr i, _parent->selected ()) { + for (auto i: _parent->selected()) { if (i->position() < ph && ph < i->end(film)) { FrameRateChange const frc = film->active_frame_rate_change (i->position()); i->set_trim_start (i->trim_start() + ContentTime (ph - i->position(), frc)); @@ -471,7 +470,7 @@ TimingPanel::trim_end_to_playhead_clicked () shared_ptr film = _parent->film (); DCPTime const ph = fv->position().floor (film->video_frame_rate ()); - BOOST_FOREACH (shared_ptr i, _parent->selected ()) { + for (auto i: _parent->selected()) { if (i->position() < ph && ph < i->end(film)) { FrameRateChange const frc = film->active_frame_rate_change (i->position ()); i->set_trim_end (ContentTime(i->position() + i->full_length(film) - ph, frc) - i->trim_start()); @@ -495,7 +494,7 @@ TimingPanel::setup_sensitivity () DCPOMATIC_ASSERT (fv); DCPTime const ph = fv->position (); bool any_over_ph = false; - BOOST_FOREACH (shared_ptr i, _parent->selected ()) { + for (auto i: _parent->selected()) { if (i->position() <= ph && ph < i->end(_parent->film())) { any_over_ph = true; } @@ -511,7 +510,7 @@ TimingPanel::move_to_start_of_reel_clicked () /* Find common position of all selected content, if it exists */ optional position; - BOOST_FOREACH (shared_ptr i, _parent->selected ()) { + for (auto i: _parent->selected()) { if (!position) { position = i->position(); } else { @@ -525,7 +524,7 @@ TimingPanel::move_to_start_of_reel_clicked () MoveToDialog* d = new MoveToDialog (this, position, _parent->film()); if (d->ShowModal() == wxID_OK) { - BOOST_FOREACH (shared_ptr i, _parent->selected()) { + for (auto i: _parent->selected()) { i->set_position (_parent->film(), d->position()); } } diff --git a/src/wx/verify_dcp_dialog.cc b/src/wx/verify_dcp_dialog.cc index bf78113d9..55360dc39 100644 --- a/src/wx/verify_dcp_dialog.cc +++ b/src/wx/verify_dcp_dialog.cc @@ -26,7 +26,6 @@ DCPOMATIC_DISABLE_WARNINGS #include DCPOMATIC_ENABLE_WARNINGS -#include using std::list; using std::shared_ptr; @@ -63,7 +62,7 @@ VerifyDCPDialog::VerifyDCPDialog (wxWindow* parent, shared_ptr job _text->Newline(); } - BOOST_FOREACH (dcp::VerificationNote i, job->notes()) { + for (auto i: job->notes()) { switch (i.type()) { case dcp::VerificationNote::VERIFY_WARNING: _text->BeginStandardBullet (N_("standard/diamond"), 1, 50); diff --git a/src/wx/video_panel.cc b/src/wx/video_panel.cc index 5fcd527b8..81f78b9c0 100644 --- a/src/wx/video_panel.cc +++ b/src/wx/video_panel.cc @@ -39,7 +39,6 @@ #include "lib/video_content.h" #include #include -#include #include #include #include @@ -171,7 +170,7 @@ VideoPanel::VideoPanel (ContentPanel* p) _colour_conversion_label = create_label (this, _("Colour conversion"), true); _colour_conversion = new wxChoice (this, wxID_ANY, wxDefaultPosition, size); _colour_conversion->Append (_("None")); - BOOST_FOREACH (PresetColourConversion const & i, PresetColourConversion::all()) { + for (auto const& i: PresetColourConversion::all()) { _colour_conversion->Append (std_to_wx (i.name)); } @@ -371,7 +370,7 @@ VideoPanel::film_content_changed (int property) setup_description (); } else if (property == VideoContentProperty::COLOUR_CONVERSION) { boost::unordered_set > check; - BOOST_FOREACH (shared_ptr i, vc) { + for (auto i: vc) { check.insert (i->video->colour_conversion()); } @@ -408,7 +407,7 @@ VideoPanel::film_content_changed (int property) setup_sensitivity (); } else if (property == VideoContentProperty::FADE_IN) { set check; - BOOST_FOREACH (shared_ptr i, vc) { + for (auto i: vc) { check.insert (i->video->fade_in ()); } @@ -422,7 +421,7 @@ VideoPanel::film_content_changed (int property) } } else if (property == VideoContentProperty::FADE_OUT) { set check; - BOOST_FOREACH (shared_ptr i, vc) { + for (auto i: vc) { check.insert (i->video->fade_out ()); } @@ -453,7 +452,7 @@ VideoPanel::film_content_changed (int property) setup_sensitivity (); } else if (property == VideoContentProperty::CUSTOM_RATIO || property == VideoContentProperty::CUSTOM_SIZE) { set check; - BOOST_FOREACH (shared_ptr i, vc) { + for (auto i: vc) { check.insert (i->video->custom_ratio() || i->video->custom_size()); } @@ -503,7 +502,7 @@ VideoPanel::colour_conversion_changed () if (s == int(all.size() + 1)) { edit_colour_conversion_clicked (); } else { - BOOST_FOREACH (shared_ptr i, _parent->selected_video()) { + for (auto i: _parent->selected_video()) { if (s == 0) { i->video->unset_colour_conversion (); } else if (s != int(all.size() + 2)) { @@ -521,7 +520,7 @@ VideoPanel::edit_colour_conversion_clicked () ContentColourConversionDialog* d = new ContentColourConversionDialog (this, vc.front()->video->yuv ()); d->set (vc.front()->video->colour_conversion().get_value_or (PresetColourConversion::all().front().conversion)); if (d->ShowModal() == wxID_OK) { - BOOST_FOREACH (shared_ptr i, vc) { + for (auto i: vc) { i->video->set_colour_conversion (d->get ()); } } else { @@ -578,7 +577,7 @@ VideoPanel::setup_sensitivity () setup_refer_button (_reference, _reference_note, dcp, can_reference, cannot); bool any_use = false; - BOOST_FOREACH (shared_ptr i, _parent->selected_video()) { + for (auto i: _parent->selected_video()) { if (i->video && i->video->use()) { any_use = true; } @@ -636,7 +635,7 @@ VideoPanel::setup_sensitivity () void VideoPanel::fade_in_changed () { - BOOST_FOREACH (shared_ptr i, _parent->selected_video ()) { + for (auto i: _parent->selected_video ()) { double const vfr = i->active_video_frame_rate (_parent->film()); i->video->set_fade_in (_fade_in->get(vfr).frames_round(vfr)); } @@ -645,7 +644,7 @@ VideoPanel::fade_in_changed () void VideoPanel::fade_out_changed () { - BOOST_FOREACH (shared_ptr i, _parent->selected_video ()) { + for (auto i: _parent->selected_video ()) { double const vfr = i->active_video_frame_rate (_parent->film()); i->video->set_fade_out (_fade_out->get(vfr).frames_round(vfr)); } @@ -672,7 +671,7 @@ VideoPanel::reference_clicked () void VideoPanel::scale_fit_clicked () { - BOOST_FOREACH (shared_ptr i, _parent->selected_video()) { + for (auto i: _parent->selected_video()) { i->video->set_custom_ratio (optional()); } } @@ -694,7 +693,7 @@ VideoPanel::scale_custom_edit_clicked () CustomScaleDialog* d = new CustomScaleDialog (this, vc->size(), _parent->film()->frame_size(), vc->custom_ratio(), vc->custom_size()); int const r = d->ShowModal (); if (r == wxID_OK) { - BOOST_FOREACH (shared_ptr i, _parent->selected_video()) { + for (auto i: _parent->selected_video()) { i->video->set_custom_ratio (d->custom_ratio()); i->video->set_custom_size (d->custom_size()); } @@ -722,7 +721,7 @@ void VideoPanel::left_crop_changed () { if (_left_right_link->GetValue()) { - BOOST_FOREACH (shared_ptr i, _parent->selected_video()) { + for (auto i: _parent->selected_video()) { i->video->set_right_crop (i->video->left_crop()); } } @@ -733,7 +732,7 @@ void VideoPanel::right_crop_changed () { if (_left_right_link->GetValue()) { - BOOST_FOREACH (shared_ptr i, _parent->selected_video()) { + for (auto i: _parent->selected_video()) { i->video->set_left_crop (i->video->right_crop()); } } @@ -744,7 +743,7 @@ void VideoPanel::top_crop_changed () { if (_top_bottom_link->GetValue()) { - BOOST_FOREACH (shared_ptr i, _parent->selected_video()) { + for (auto i: _parent->selected_video()) { i->video->set_bottom_crop (i->video->top_crop()); } } @@ -755,7 +754,7 @@ void VideoPanel::bottom_crop_changed () { if (_top_bottom_link->GetValue()) { - BOOST_FOREACH (shared_ptr i, _parent->selected_video()) { + for (auto i: _parent->selected_video()) { i->video->set_top_crop (i->video->bottom_crop()); } } diff --git a/src/wx/wx_util.cc b/src/wx/wx_util.cc index 5d02d27bf..3386b2700 100644 --- a/src/wx/wx_util.cc +++ b/src/wx/wx_util.cc @@ -522,7 +522,7 @@ display_progress (wxString title, wxString task) dcpomatic_sleep_seconds (1); if (!progress.Pulse()) { /* user pressed cancel */ - BOOST_FOREACH (shared_ptr i, jm->get()) { + for (auto i: jm->get()) { i->cancel(); } ok = false; diff --git a/test/colour_conversion_test.cc b/test/colour_conversion_test.cc index f277edd9a..28545b3f0 100644 --- a/test/colour_conversion_test.cc +++ b/test/colour_conversion_test.cc @@ -28,7 +28,6 @@ #include #include #include -#include #include using std::cout; @@ -105,7 +104,7 @@ BOOST_AUTO_TEST_CASE (colour_conversion_test3) /** Test a round trip via the XML representation */ BOOST_AUTO_TEST_CASE (colour_conversion_test4) { - BOOST_FOREACH (PresetColourConversion const & i, PresetColourConversion::all ()) { + for (auto const& i: PresetColourConversion::all ()) { xmlpp::Document out; xmlpp::Element* out_root = out.create_root_node ("Test"); i.conversion.as_xml (out_root); diff --git a/test/dcp_subtitle_test.cc b/test/dcp_subtitle_test.cc index a3ef673fe..025d33c6a 100644 --- a/test/dcp_subtitle_test.cc +++ b/test/dcp_subtitle_test.cc @@ -55,7 +55,7 @@ store (ContentStringText sub) if (!stored) { stored = sub; } else { - BOOST_FOREACH (dcp::SubtitleString i, sub.subs) { + for (auto i: sub.subs) { stored->subs.push_back (i); } } @@ -190,7 +190,7 @@ static void check_font_tags (list nodes) { - BOOST_FOREACH (cxml::NodePtr i, nodes) { + for (auto i: nodes) { if (i->name() == "Font") { BOOST_CHECK (!i->optional_string_attribute("Id") || i->string_attribute("Id") != ""); } diff --git a/test/ffmpeg_encoder_test.cc b/test/ffmpeg_encoder_test.cc index 684a67cf5..e43ea76e8 100644 --- a/test/ffmpeg_encoder_test.cc +++ b/test/ffmpeg_encoder_test.cc @@ -303,7 +303,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test6) shared_ptr subs = content_factory("test/data/subrip.srt").front(); film2->examine_and_add_content (subs); BOOST_REQUIRE (!wait_for_jobs()); - BOOST_FOREACH (shared_ptr i, subs->text) { + for (auto i: subs->text) { i->set_use (true); } diff --git a/test/kdm_naming_test.cc b/test/kdm_naming_test.cc index bd329eeee..85a0b60f6 100644 --- a/test/kdm_naming_test.cc +++ b/test/kdm_naming_test.cc @@ -162,7 +162,7 @@ BOOST_AUTO_TEST_CASE (directory_kdm_naming_test, * boost::unit_test::depends_on( string const cpl_id = cpls.front().cpl_id; list kdms; - BOOST_FOREACH (shared_ptr i, screens) { + for (auto i: screens) { KDMWithMetadataPtr kdm = kdm_for_screen ( film, cpls.front().cpl_file, diff --git a/test/reels_test.cc b/test/reels_test.cc index b609052b9..c7b33d394 100644 --- a/test/reels_test.cc +++ b/test/reels_test.cc @@ -34,7 +34,6 @@ #include "lib/content_factory.h" #include "test.h" #include -#include #include using std::list; @@ -496,7 +495,7 @@ no_op () static void dump_notes (list const & notes) { - BOOST_FOREACH (dcp::VerificationNote i, notes) { + for (auto i: notes) { std::cout << dcp::note_to_string(i) << "\n"; } } diff --git a/test/subtitle_reel_number_test.cc b/test/subtitle_reel_number_test.cc index e5f1667ef..d8c596c94 100644 --- a/test/subtitle_reel_number_test.cc +++ b/test/subtitle_reel_number_test.cc @@ -61,7 +61,7 @@ BOOST_AUTO_TEST_CASE (subtitle_reel_number_test) BOOST_REQUIRE_EQUAL (cpl->reels().size(), 6U); int n = 1; - BOOST_FOREACH (shared_ptr i, cpl->reels()) { + for (auto i: cpl->reels()) { if (i->main_subtitle()) { shared_ptr ass = dynamic_pointer_cast(i->main_subtitle()->asset()); BOOST_REQUIRE (ass); diff --git a/test/subtitle_reel_test.cc b/test/subtitle_reel_test.cc index 6e55ee62f..2eee36ffa 100644 --- a/test/subtitle_reel_test.cc +++ b/test/subtitle_reel_test.cc @@ -31,7 +31,6 @@ #include #include #include -#include #include @@ -125,7 +124,7 @@ BOOST_AUTO_TEST_CASE (subtitle_in_all_reels_test) shared_ptr cpl = dcp.cpls().front(); BOOST_REQUIRE_EQUAL (cpl->reels().size(), 3U); - BOOST_FOREACH (shared_ptr i, cpl->reels()) { + for (auto i: cpl->reels()) { BOOST_CHECK (i->main_subtitle()); } } @@ -170,7 +169,7 @@ BOOST_AUTO_TEST_CASE (closed_captions_in_all_reels_test) shared_ptr cpl = dcp.cpls().front(); BOOST_REQUIRE_EQUAL (cpl->reels().size(), 3U); - BOOST_FOREACH (shared_ptr i, cpl->reels()) { + for (auto i: cpl->reels()) { BOOST_REQUIRE_EQUAL (i->closed_captions().size(), 2U); optional first = i->closed_captions().front()->language(); optional second = i->closed_captions().back()->language(); diff --git a/test/threed_test.cc b/test/threed_test.cc index e6a91a910..b12eb328d 100644 --- a/test/threed_test.cc +++ b/test/threed_test.cc @@ -198,13 +198,13 @@ BOOST_AUTO_TEST_CASE (threed_test7) while (signal_manager->ui_idle ()) {} std::cout << "Here's the jobs:\n"; - BOOST_FOREACH (shared_ptr i, jm->_jobs) { + for (auto i: jm->_jobs) { std::cout << i->name() << " " << i->status() << " " << i->is_new() << " " << i->running() << " " << i->finished() << " " << i->finished_ok() << " " << i->finished_in_error() << "\n"; } BOOST_REQUIRE (jm->errors()); shared_ptr failed; - BOOST_FOREACH (shared_ptr i, jm->_jobs) { + for (auto i: jm->_jobs) { if (i->finished_in_error()) { BOOST_REQUIRE (!failed); failed = i; diff --git a/test/vf_test.cc b/test/vf_test.cc index 9fc02412a..aff9bdae9 100644 --- a/test/vf_test.cc +++ b/test/vf_test.cc @@ -37,7 +37,6 @@ #include #include #include -#include #include using std::list; -- 2.30.2