BOOST_FOREACH.
authorCarl Hetherington <cth@carlh.net>
Mon, 4 Jan 2021 20:32:13 +0000 (21:32 +0100)
committerCarl Hetherington <cth@carlh.net>
Thu, 7 Jan 2021 22:27:56 +0000 (23:27 +0100)
157 files changed:
src/lib/active_text.cc
src/lib/analyse_audio_job.cc
src/lib/analyse_subtitles_job.cc
src/lib/audio_analysis.cc
src/lib/audio_content.cc
src/lib/audio_decoder.cc
src/lib/audio_mapping.cc
src/lib/audio_merger.cc
src/lib/audio_ring_buffers.cc
src/lib/case_insensitive_sorter.cc
src/lib/check_content_change_job.cc
src/lib/cinema.cc
src/lib/colour_conversion.cc
src/lib/config.cc
src/lib/content.cc
src/lib/cross_common.cc
src/lib/cross_linux.cc
src/lib/cross_osx.cc
src/lib/cross_windows.cc
src/lib/dcp.cc
src/lib/dcp_content.cc
src/lib/dcp_content_type.cc
src/lib/dcp_decoder.cc
src/lib/dcp_encoder.cc
src/lib/dcp_examiner.cc
src/lib/dcp_subtitle_content.cc
src/lib/dcp_subtitle_decoder.cc
src/lib/dcpomatic_time.h
src/lib/decoder.cc
src/lib/decoder_factory.cc
src/lib/dkdm_recipient.cc
src/lib/dkdm_wrapper.cc
src/lib/emailer.cc
src/lib/empty.cc
src/lib/encode_server.cc
src/lib/encode_server_finder.cc
src/lib/ext.cc
src/lib/ffmpeg.cc
src/lib/ffmpeg_content.cc
src/lib/ffmpeg_decoder.cc
src/lib/ffmpeg_encoder.cc
src/lib/ffmpeg_examiner.cc
src/lib/ffmpeg_file_encoder.cc
src/lib/ffmpeg_subtitle_stream.cc
src/lib/film.cc
src/lib/filter.cc
src/lib/font.cc
src/lib/frame_interval_checker.cc
src/lib/hints.cc
src/lib/image_content.cc
src/lib/image_filename_sorter.cc
src/lib/j2k_encoder.cc
src/lib/job.cc
src/lib/job_manager.cc
src/lib/kdm_with_metadata.cc
src/lib/overlaps.cc
src/lib/player.cc
src/lib/player_text.cc
src/lib/playlist.cc
src/lib/reel_writer.cc
src/lib/render_text.cc
src/lib/screen.cc
src/lib/send_kdm_email_job.cc
src/lib/send_notification_email_job.cc
src/lib/send_problem_report_job.cc
src/lib/shuffler.cc
src/lib/spl.cc
src/lib/string_text_file_decoder.cc
src/lib/subtitle_encoder.cc
src/lib/text_content.cc
src/lib/text_decoder.cc
src/lib/types.cc
src/lib/util.cc
src/lib/util.h
src/lib/verify_dcp_job.cc
src/lib/video_decoder.cc
src/lib/video_ring_buffers.cc
src/lib/writer.cc
src/tools/dcpomatic.cc
src/tools/dcpomatic_batch.cc
src/tools/dcpomatic_cli.cc
src/tools/dcpomatic_create.cc
src/tools/dcpomatic_disk.cc
src/tools/dcpomatic_disk_writer.cc
src/tools/dcpomatic_kdm.cc
src/tools/dcpomatic_kdm_cli.cc
src/tools/dcpomatic_player.cc
src/tools/dcpomatic_playlist.cc
src/tools/dcpomatic_server.cc
src/wx/audio_dialog.cc
src/wx/audio_mapping_view.cc
src/wx/audio_panel.cc
src/wx/audio_plot.cc
src/wx/cinema_dialog.cc
src/wx/closed_captions_dialog.cc
src/wx/config_dialog.cc
src/wx/config_dialog.h
src/wx/confirm_kdm_email_dialog.cc
src/wx/content_colour_conversion_dialog.cc
src/wx/content_menu.cc
src/wx/content_panel.cc
src/wx/content_properties_dialog.cc
src/wx/content_sub_panel.cc
src/wx/content_view.cc
src/wx/dcp_panel.cc
src/wx/dkdm_dialog.cc
src/wx/dkdm_output_panel.cc
src/wx/dolby_doremi_certificate_panel.cc
src/wx/download_certificate_dialog.cc
src/wx/editable_list.h
src/wx/film_editor.cc
src/wx/film_name_location_dialog.cc
src/wx/film_viewer.cc
src/wx/filter_dialog.cc
src/wx/fonts_dialog.cc
src/wx/full_config_dialog.cc
src/wx/gain_calculator_dialog.cc
src/wx/hints_dialog.cc
src/wx/job_manager_view.cc
src/wx/kdm_cpl_panel.cc
src/wx/kdm_dialog.cc
src/wx/kdm_output_panel.cc
src/wx/language_tag_dialog.cc
src/wx/move_to_dialog.cc
src/wx/nag_dialog.cc
src/wx/name_format_editor.h
src/wx/player_config_dialog.cc
src/wx/player_stress_tester.cc
src/wx/playlist_controls.cc
src/wx/qube_certificate_panel.cc
src/wx/recipients_panel.cc
src/wx/recreate_chain_dialog.cc
src/wx/save_template_dialog.cc
src/wx/screens_panel.cc
src/wx/servers_list_dialog.cc
src/wx/suspender.cc
src/wx/system_font_dialog.cc
src/wx/templates_dialog.cc
src/wx/text_panel.cc
src/wx/text_view.cc
src/wx/timeline.cc
src/wx/timeline_audio_content_view.cc
src/wx/timeline_content_view.cc
src/wx/timeline_reels_view.cc
src/wx/timing_panel.cc
src/wx/verify_dcp_dialog.cc
src/wx/video_panel.cc
src/wx/wx_util.cc
test/colour_conversion_test.cc
test/dcp_subtitle_test.cc
test/ffmpeg_encoder_test.cc
test/kdm_naming_test.cc
test/reels_test.cc
test/subtitle_reel_number_test.cc
test/subtitle_reel_test.cc
test/threed_test.cc
test/vf_test.cc

index 30f3b8ca661a5f68f406ec729b6c72df088cb1ed..1180ce7b0bc42f3c6b1deb7ef1fb0fdbb789eecd 100644 (file)
@@ -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<DCPTimePeriod> 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<Period> 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<const TextContent> 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));
        }
 
index 0d6a5e8b8a5e5d950184255f2d5f0fe555c3595a..c94e0b91ff715ebeadc6e9b162cdf29b0800a8a6 100644 (file)
@@ -37,7 +37,6 @@ extern "C" {
 #include <libavfilter/f_ebur128.h>
 #endif
 }
-#include <boost/foreach.hpp>
 #include <iostream>
 
 #include "i18n.h"
@@ -123,7 +122,7 @@ AnalyseAudioJob::AnalyseAudioJob (shared_ptr<const Film> film, shared_ptr<const
 AnalyseAudioJob::~AnalyseAudioJob ()
 {
        stop_thread ();
-       BOOST_FOREACH (Filter const * i, _filters) {
+       for (auto i: _filters) {
                delete const_cast<Filter*> (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<Content> c, _playlist->content ()) {
+       for (auto c: _playlist->content()) {
                if (c->audio) {
                        has_any_audio = true;
                }
index df3cb3181a6b62ad66993c7c184c1cb541090640..b941824d6382fa0744c8b9e826f3e7ea45777893 100644 (file)
@@ -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<double> 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
index 41591b062c0f610ef5aa1e0c45db90fa54b620e4..22c14c7647ecc3de54f5a918ea1820e47623c485 100644 (file)
@@ -29,7 +29,6 @@ DCPOMATIC_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
 DCPOMATIC_ENABLE_WARNINGS
 #include <boost/filesystem.hpp>
-#include <boost/foreach.hpp>
 #include <stdint.h>
 #include <cmath>
 #include <cstdio>
@@ -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<AudioPoint> 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<float>(i->content()), DCPTime(i->number_attribute<Frame>("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<float> (i->content ()));
        }
 
@@ -135,9 +134,9 @@ AudioAnalysis::write (boost::filesystem::path filename)
 
        root->add_child("Version")->add_child_text (raw_convert<string> (_current_state_version));
 
-       BOOST_FOREACH (vector<AudioPoint>& 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<string> (_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<string> (i));
        }
 
@@ -213,7 +212,7 @@ AudioAnalysis::overall_true_peak () const
 {
        optional<float> p;
 
-       BOOST_FOREACH (float i, _true_peak) {
+       for (auto i: _true_peak) {
                if (!p || i > *p) {
                        p = i;
                }
index 79a00b24934a577be5298ae716b2f76428c06070..c70afcda43576113f6f907e08f553db7c6e0f9e2 100644 (file)
@@ -27,7 +27,6 @@
 #include <dcp/raw_convert.h>
 #include <libcxml/cxml.h>
 #include <libxml++/libxml++.h>
-#include <boost/foreach.hpp>
 #include <iostream>
 
 #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<Content> 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<const Film> film) const
        bool same = true;
 
        optional<int> 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++));
                }
index 5334dfa345071e887fa6e9f7a04d34701d23054b..095be0aae50e7aa0f1d4a16e2ab893691449bacb 100644 (file)
@@ -25,7 +25,6 @@
 #include "log.h"
 #include "resampler.h"
 #include "compose.hpp"
-#include <boost/foreach.hpp>
 #include <iostream>
 
 #include "i18n.h"
@@ -43,7 +42,7 @@ AudioDecoder::AudioDecoder (Decoder* parent, shared_ptr<const AudioContent> 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<AudioBuffers> silence (new AudioBuffers (i->channels(), samples));
                silence->make_silent ();
index 37a3d5fa22b8d8dc03b684e08a4f7842b747391f..da9f9822ec6644f8a9ae8b034cd6653d90701dee 100644 (file)
@@ -237,7 +237,7 @@ AudioMapping::mapped_output_channels () const
        list<int> mapped;
 
        for (vector<vector<float> >::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);
                        }
index 347a96f5a96969869fb591efcf84644e6f259fb6..06eba098f4dd6424f5c096baa6a25cbcb9f18e30 100644 (file)
@@ -60,7 +60,7 @@ AudioMerger::pull (DCPTime time)
        list<Buffer> 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<const AudioBuffers> 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<DCPTimePeriod> 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<const AudioBuffers> audio, DCPTime time)
        }
 
        list<DCPTimePeriod> 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<Buffer>::iterator before = _buffers.end();
                list<Buffer>::iterator after = _buffers.end();
                for (list<Buffer>::iterator j = _buffers.begin(); j != _buffers.end(); ++j) {
index c0559f61c5b11283ef3e67f22ffcaea33c7f0a97..289045ff529b445d8aa2ce0927423fd9a38820bd 100644 (file)
@@ -21,7 +21,6 @@
 #include "audio_ring_buffers.h"
 #include "dcpomatic_assert.h"
 #include "exceptions.h"
-#include <boost/foreach.hpp>
 #include <iostream>
 
 using std::min;
index 1dfdb01f35f7d48e89f3f89863cc058ef560a9be..c26f1e64263a606a456426ca5b33ae218c8e9c2e 100644 (file)
@@ -20,7 +20,6 @@
 
 #include "case_insensitive_sorter.h"
 #include <boost/filesystem.hpp>
-#include <boost/foreach.hpp>
 #include <iostream>
 
 using std::string;
index 45a662e37e216dc3a5720441651ec6390c6887fb..c4d050c0e19ea09b7dc6d7e6c8d42568d8876a7f 100644 (file)
@@ -23,7 +23,6 @@
 #include "examine_content_job.h"
 #include "content.h"
 #include "film.h"
-#include <boost/foreach.hpp>
 #include <iostream>
 
 #include "i18n.h"
@@ -66,7 +65,7 @@ CheckContentChangeJob::run ()
 
        list<shared_ptr<Content> > changed;
 
-       BOOST_FOREACH (shared_ptr<Content> 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<Content> i, changed) {
+                       for (auto i: changed) {
                                JobManager::instance()->add(shared_ptr<Job>(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.");
index 48cba2b8fcf58e0e387289c985d1ebed3bfb3a12..42557efc3135c4614fdb1dfbec294b61c71941b4 100644 (file)
@@ -24,7 +24,6 @@
 #include <libcxml/cxml.h>
 #include <dcp/raw_convert.h>
 #include <libxml++/libxml++.h>
-#include <boost/foreach.hpp>
 #include <iostream>
 
 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<string> (_utc_offset_hour));
        parent->add_child("UTCOffsetMinute")->add_child_text (raw_convert<string> (_utc_offset_minute));
 
-       BOOST_FOREACH (shared_ptr<Screen> i, _screens) {
+       for (auto i: _screens) {
                i->as_xml (parent->add_child ("Screen"));
        }
 }
index d0e0f46388a87c080acd7c547e833bf7e60ef07b..e0158b7356ddd4a846d2eb2e5d06558906424ca1 100644 (file)
@@ -33,7 +33,6 @@
 DCPOMATIC_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
 DCPOMATIC_ENABLE_WARNINGS
-#include <boost/foreach.hpp>
 #include <iostream>
 
 #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;
                }
index e2425799d16f8253efb1fd6ba88b3a9fe5a50e30..a3eb1b77ad73b6b4fcdc3b8787ee7e048390106a 100644 (file)
@@ -41,7 +41,6 @@
 #include <libxml++/libxml++.h>
 #include <boost/filesystem.hpp>
 #include <boost/algorithm/string.hpp>
-#include <boost/foreach.hpp>
 #include <boost/thread.hpp>
 #include <cstdlib>
 #include <fstream>
@@ -262,7 +261,7 @@ try
        boost::optional<bool> 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<dcp::CertificateChain> 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<dcp::CertificateChain> 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<int>("Id");
                if (id >= 0 && id < NAG_COUNT) {
                        _nagged[id] = raw_convert<int>(i->content());
@@ -430,7 +429,7 @@ try
 
        optional<BadReason> 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<int>("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<int>("Id");
                if (id >= 0 && id < NOTIFICATION_COUNT) {
                        _notification[id] = raw_convert<int>(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 <guilabel>File</guilabel> 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 <guilabel>File</guilabel> 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<shared_ptr<T> >
        xmlpp::Element* root = doc.create_root_node (root_node);
        root->add_child("Version")->add_child_text(version);
 
-       BOOST_FOREACH (shared_ptr<T> i, things) {
+       for (auto i: things) {
                i->as_xml (root->add_child(node));
        }
 
@@ -1172,7 +1171,7 @@ Config::clean_history_internal (vector<boost::filesystem::path>& h)
 {
        vector<boost::filesystem::path> 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<cxml::NodePtr> 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<cxml::NodePtr> 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<DKDMRecipient>(new DKDMRecipient(i)));
        }
 }
index efcec534c433ec9b1b36c6903eb4d061504dcb28..5fb9d324ac8142953edfafe33ab2c4759af59068 100644 (file)
@@ -92,7 +92,7 @@ Content::Content (cxml::ConstNodePtr node)
        : _change_signals_frequent (false)
 {
        list<cxml::NodePtr> path_children = node->node_children ("Path");
-       BOOST_FOREACH (cxml::NodePtr i, path_children) {
+       for (auto i: path_children) {
                _paths.push_back (i->content());
                optional<time_t> const mod = i->optional_number_attribute<time_t>("mtime");
                if (mod) {
@@ -192,7 +192,7 @@ Content::examine (shared_ptr<const Film>, shared_ptr<Job> 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<boost::filesystem::path> 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<TextContent>
 Content::text_of_original_type (TextType type) const
 {
-       BOOST_FOREACH (shared_ptr<TextContent> i, text) {
+       for (auto i: text) {
                if (i->original_type() == type) {
                        return i;
                }
index edc806b584fed235a947e53a46751725bac7424c..f8556b1fdc1d29d742e3193598fa9562ab1dc7b4 100644 (file)
@@ -23,7 +23,6 @@
 #include "dcpomatic_log.h"
 #include "warnings.h"
 #include <dcp/raw_convert.h>
-#include <boost/foreach.hpp>
 DCPOMATIC_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
 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<uint64_t>("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<string>(_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()) {
index 247bf4aabc3f6addcffb7d821a483c467de273d9..c001cbf353fab9129ba9d5b9bf79b0f5d155c196 100644 (file)
@@ -31,7 +31,6 @@ extern "C" {
 #include <libavformat/avio.h>
 }
 #include <boost/algorithm/string.hpp>
-#include <boost/foreach.hpp>
 #include <boost/function.hpp>
 #if BOOST_VERSION >= 106100
 #include <boost/dll/runtime_symbol_info.hpp>
@@ -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) {
index 76c451a6f3df2078b77d3ed951421318592f0f18..8b60ff492f2cc8ea4234fa5fd309ce64c852d631 100644 (file)
@@ -31,7 +31,6 @@ extern "C" {
 #include <libavformat/avio.h>
 }
 #include <boost/algorithm/string.hpp>
-#include <boost/foreach.hpp>
 #include <boost/regex.hpp>
 #if BOOST_VERSION >= 106100
 #include <boost/dll/runtime_symbol_info.hpp>
@@ -331,7 +330,7 @@ analyse_media_path (CFDictionaryRef& description)
 
        vector<string> 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<string, vector<boost::filesystem::path> > 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<string, vector<boost::filesystem::path> >::const_iterator j = mounted_synths.find(i.prt);
                        if (j != mounted_synths.end()) {
@@ -501,7 +500,7 @@ Drive::get ()
        }
 
        vector<Drive> 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));
index 1fe5556484e6b7a505a447dd77cc4e8c5972cbf1..0ab56bb6b24f9e4ca24a069402d9d06b475bb943 100644 (file)
@@ -31,7 +31,6 @@ extern "C" {
 #include <libavformat/avio.h>
 }
 #include <boost/algorithm/string.hpp>
-#include <boost/foreach.hpp>
 #include <boost/dll/runtime_symbol_info.hpp>
 #include <windows.h>
 #include <winternl.h>
index 8baf489d1c2b71d353d69c167b405ef2e3883abb..421dbbf83b605fd23efa3aa4278e467af9a69a55 100644 (file)
@@ -28,7 +28,6 @@
 #include <dcp/dcp.h>
 #include <dcp/decrypted_kdm.h>
 #include <dcp/exceptions.h>
-#include <boost/foreach.hpp>
 
 #include "i18n.h"
 
@@ -46,13 +45,13 @@ DCP::cpls () const
        list<shared_ptr<dcp::CPL> > 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::DCP> dcp (new dcp::DCP (i));
                list<dcp::VerificationNote> notes;
                dcp->read (&notes, 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<dcp::CPL> i, dcp->cpls()) {
+               for (auto i: dcp->cpls()) {
                        cpls.push_back (i);
                }
        }
 
-       BOOST_FOREACH (shared_ptr<dcp::DCP> i, dcps) {
-               BOOST_FOREACH (shared_ptr<dcp::DCP> 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<dcp::DCP> i, dcps) {
+               for (auto i: dcps) {
                        i->add (k);
                }
        }
index d4bd58e584099c9d937f5209e97639dbeb2a0f85..e43d88a3472b2050f139c784c742611ee94d7419 100644 (file)
@@ -40,7 +40,6 @@
 #include <dcp/reel_subtitle_asset.h>
 #include <dcp/reel.h>
 #include <libxml++/libxml++.h>
-#include <boost/foreach.hpp>
 #include <iterator>
 #include <iostream>
 
@@ -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<int64_t> (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<int64_t>(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<TextContent> 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<string> (i));
        }
 
@@ -401,12 +400,12 @@ DCPContent::as_xml (xmlpp::Node* node, bool with_paths) const
                marker->add_child_text(raw_convert<string>(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<TextContent> i, text) {
+       for (auto i: text) {
                s += i->identifier () + " ";
        }
 
@@ -566,7 +565,7 @@ DCPContent::reels (shared_ptr<const Film> 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<DCPTime>
 DCPContent::reel_split_points (shared_ptr<const Film> film) const
 {
        list<DCPTime> 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<const Film> film, function<bool (shared_pt
        /* fr must contain reels().  It can also contain other reels, but it must at
           least contain reels().
        */
-       BOOST_FOREACH (DCPTimePeriod i, reel_list) {
+       for (auto i: reel_list) {
                if (find (fr.begin(), fr.end(), i) == fr.end ()) {
                        /// TRANSLATORS: this string will follow "Cannot reference this DCP: "
                        why_not = _("its reel lengths differ from those in the film; set the reel mode to 'split by video content'.");
@@ -703,7 +702,7 @@ DCPContent::can_reference_audio (shared_ptr<const Film> film, string& why_not) c
                return false;
        }
 
-        BOOST_FOREACH (shared_ptr<dcp::Reel> 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<const Film> film, TextType type, stri
                return false;
        }
 
-        BOOST_FOREACH (shared_ptr<dcp::Reel> 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<const Film> film, TextType type, stri
                                why_not = _("it does not have closed captions in all its reels.");
                                return false;
                        }
-                       BOOST_FOREACH (shared_ptr<dcp::ReelClosedCaptionAsset> 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.");
index 4fedd366c896c15adae703f09ce38a0f53729a67..c31c507b0786c92bd3223061872f3d735bc1a124 100644 (file)
@@ -24,7 +24,6 @@
 
 #include "dcp_content_type.h"
 #include "dcpomatic_assert.h"
-#include <boost/foreach.hpp>
 
 #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;
                }
index aa8fed2b4019f64331c8d1fc215a8ac06d835c8c..71eb0bae0b04503fe23935d915cb4be39d3e05b1 100644 (file)
@@ -49,7 +49,6 @@
 #include <dcp/subtitle_image.h>
 #include <dcp/decrypted_kdm.h>
 #include <dcp/reel_atmos_asset.h>
-#include <boost/foreach.hpp>
 #include <iostream>
 
 #include "i18n.h"
@@ -76,7 +75,7 @@ DCPDecoder::DCPDecoder (shared_ptr<const Film> film, shared_ptr<const DCPContent
                if (c->audio) {
                        audio.reset (new AudioDecoder (this, c->audio, fast));
                }
-               BOOST_FOREACH (shared_ptr<TextContent> 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<TextDecoder> (new TextDecoder (this, i, ContentTime())));
                }
@@ -106,7 +105,7 @@ DCPDecoder::DCPDecoder (shared_ptr<const Film> film, shared_ptr<const DCPContent
                }
 
                shared_ptr<dcp::CPL> cpl;
-               BOOST_FOREACH (shared_ptr<dcp::CPL> 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<dcp::ReelClosedCaptionAsset> 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<dcp::SubtitleString> strings;
 
-               BOOST_FOREACH (shared_ptr<dcp::Subtitle> i, subs) {
+               for (auto i: subs) {
                        shared_ptr<dcp::SubtitleString> is = dynamic_pointer_cast<dcp::SubtitleString> (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<const DCPContent> 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<FontData>
 DCPDecoder::fonts () const
 {
        vector<FontData> data;
-       BOOST_FOREACH (shared_ptr<dcp::Reel> i, _reels) {
+       for (auto i: _reels) {
                if (i->main_subtitle() && i->main_subtitle()->asset()) {
                        map<string, dcp::ArrayData> fm = i->main_subtitle()->asset()->font_data();
                        for (map<string, dcp::ArrayData>::const_iterator j = fm.begin(); j != fm.end(); ++j) {
index dfd8ed8d741bda0e75e75f777bf2002628c66ad0..0478fcf809ac94e367667204d72b440ac53ca3d4 100644 (file)
@@ -38,7 +38,6 @@
 #include "text_content.h"
 #include "player_video.h"
 #include <boost/signals2.hpp>
-#include <boost/foreach.hpp>
 #include <iostream>
 
 #include "i18n.h"
@@ -70,8 +69,8 @@ DCPEncoder::DCPEncoder (shared_ptr<const Film> film, weak_ptr<Job> 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<const Content> c, film->content ()) {
-               BOOST_FOREACH (shared_ptr<TextContent> 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);
        }
 
index fc1fbc53a7163fe7f7decee339435d41f833506e..191022f1227666985eb3878b21937107153013d8 100644 (file)
@@ -44,7 +44,6 @@
 #include <dcp/reel_closed_caption_asset.h>
 #include <dcp/reel_markers_asset.h>
 #include <dcp/sound_asset.h>
-#include <boost/foreach.hpp>
 #include <iostream>
 
 #include "i18n.h"
@@ -77,7 +76,7 @@ DCPExaminer::DCPExaminer (shared_ptr<const DCPContent> content, bool tolerant)
 
        if (content->cpl ()) {
                /* Use the CPL that the content was using before */
-               BOOST_FOREACH (shared_ptr<dcp::CPL> i, cpls()) {
+               for (auto i: cpls()) {
                        if (i->id() == content->cpl().get()) {
                                cpl = i;
                        }
@@ -87,9 +86,9 @@ DCPExaminer::DCPExaminer (shared_ptr<const DCPContent> content, bool tolerant)
 
                int least_unsatisfied = INT_MAX;
 
-               BOOST_FOREACH (shared_ptr<dcp::CPL> i, cpls()) {
+               for (auto i: cpls()) {
                        int unsatisfied = 0;
-                       BOOST_FOREACH (shared_ptr<dcp::Reel> 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<const DCPContent> content, bool tolerant)
        _name = cpl->content_title_text ();
        _content_kind = cpl->content_kind ();
 
-       BOOST_FOREACH (shared_ptr<dcp::Reel> 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<const DCPContent> content, bool tolerant)
                        _text_count[TEXT_OPEN_SUBTITLE] = 1;
                }
 
-               BOOST_FOREACH (shared_ptr<dcp::ReelClosedCaptionAsset> 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<const DCPContent> content, bool tolerant)
 
        /* Check that we can read the first picture, sound and subtitle frames of each reel */
        try {
-               BOOST_FOREACH (shared_ptr<dcp::Reel> i, cpl->reels()) {
+               for (auto i: cpl->reels()) {
                        shared_ptr<dcp::PictureAsset> pic = i->main_picture()->asset ();
                        shared_ptr<dcp::MonoPictureAsset> mono = dynamic_pointer_cast<dcp::MonoPictureAsset> (pic);
                        shared_ptr<dcp::StereoPictureAsset> stereo = dynamic_pointer_cast<dcp::StereoPictureAsset> (pic);
@@ -260,7 +259,7 @@ DCPExaminer::DCPExaminer (shared_ptr<const DCPContent> content, bool tolerant)
        _three_d = !cpl->reels().empty() && cpl->reels().front()->main_picture() &&
                dynamic_pointer_cast<dcp::StereoPictureAsset> (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);
        }
 
index d58779ee2da0835cbc19c0e65259703ddf02a0ef..2c5d98e498387b285bf4286720395a1e6d17d382 100644 (file)
@@ -27,7 +27,6 @@
 #include <dcp/smpte_subtitle_asset.h>
 #include <dcp/interop_load_font_node.h>
 #include <libxml++/libxml++.h>
-#include <boost/foreach.hpp>
 
 #include "i18n.h"
 
@@ -73,7 +72,7 @@ DCPSubtitleContent::examine (shared_ptr<const Film> film, shared_ptr<Job> job)
 
        sc->fix_empty_font_ids ();
 
-       BOOST_FOREACH (shared_ptr<dcp::LoadFontNode> i, sc->load_font_nodes ()) {
+       for (auto i: sc->load_font_nodes()) {
                only_text()->add_font (shared_ptr<Font> (new Font (i->id)));
        }
 }
index 5c14b78858f1cedb7f28e3529f5b7b20de2d6a2b..5372df0a57ab3cb35a8bebd13278e0720b9a029c 100644 (file)
@@ -54,7 +54,7 @@ DCPSubtitleDecoder::DCPSubtitleDecoder (shared_ptr<const Film> 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<dcp::LoadFontNode> 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())));
                }
index 897b725bd3e63587ba9390f194234847e01aedd1..62d8a28ccf1ddee397e85ed014e77beb929fae92 100644 (file)
@@ -28,7 +28,6 @@
 #include "frame_rate_change.h"
 #include "dcpomatic_assert.h"
 #include <boost/optional.hpp>
-#include <boost/foreach.hpp>
 #include <stdint.h>
 #include <cmath>
 #include <ostream>
@@ -319,9 +318,9 @@ std::list<TimePeriod<T> > subtract (TimePeriod<T> A, std::list<TimePeriod<T> > c
        std::list<TimePeriod<T> > result;
        result.push_back (A);
 
-       BOOST_FOREACH (TimePeriod<T> i, B) {
+       for (auto i: B) {
                std::list<TimePeriod<T> > new_result;
-               BOOST_FOREACH (TimePeriod<T> j, result) {
+               for (auto j: result) {
                        boost::optional<TimePeriod<T> > ov = i.overlap (j);
                        if (ov) {
                                if (*ov == i) {
index a53118061fe82bd53759135977716798fd686dd4..bf0bd1a26945783d3501b9f91e82ac358a5bedc0 100644 (file)
@@ -60,7 +60,7 @@ Decoder::position () const
           which can cause bugs like #1581.
        */
        if (!pos) {
-               BOOST_FOREACH (shared_ptr<TextDecoder> 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<TextDecoder> i, text) {
+       for (auto i: text) {
                i->seek ();
        }
 }
index f68a443b5cf4014f5c47d50619d151fcfdc237a7..1acef6f4fbe9326d8b50d0f59050f0489a55e6bc 100644 (file)
@@ -33,7 +33,6 @@
 #include "video_mxf_content.h"
 #include "video_mxf_decoder.h"
 #include "timer.h"
-#include <boost/foreach.hpp>
 
 using std::list;
 using std::shared_ptr;
index a12d95a4c621566f5043ab8edfc80859f5ec475d..22da53f3babb5b13c0be0d3e211e4b407a048509 100644 (file)
@@ -22,7 +22,6 @@
 #include "kdm_with_metadata.h"
 #include "film.h"
 #include <dcp/raw_convert.h>
-#include <boost/foreach.hpp>
 
 
 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);
        }
 
index 66f67114dd0f4347f855dee4a62fdd2dd4bbbcec..74a71966e87b4667e0ab38b4361556a4ac3b89d9 100644 (file)
@@ -25,7 +25,6 @@
 DCPOMATIC_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
 DCPOMATIC_ENABLE_WARNINGS
-#include <boost/foreach.hpp>
 
 using std::string;
 using std::list;
@@ -39,7 +38,7 @@ DKDMBase::read (cxml::ConstNodePtr node)
                return shared_ptr<DKDM> (new DKDM (dcp::EncryptedKDM (node->content ())));
        } else if (node->name() == "DKDMGroup") {
                shared_ptr<DKDMGroup> group (new DKDMGroup (node->string_attribute ("Name")));
-               BOOST_FOREACH (cxml::ConstNodePtr i, node->node_children()) {
+               for (auto i: node->node_children()) {
                        shared_ptr<DKDMBase> 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<DKDMBase> i, _children) {
+       for (auto i: _children) {
                i->as_xml (f);
        }
 }
index b7cae70798437526a51d05e4d02903f6f7a07345..c4637ff0da387747d39ea49af604e8e85a8355e1 100644 (file)
@@ -25,7 +25,6 @@
 #include <curl/curl.h>
 #include <boost/algorithm/string.hpp>
 #include <boost/date_time/c_local_time_adjustor.hpp>
-#include <boost/foreach.hpp>
 
 #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<string> addresses)
 {
        string o;
-       BOOST_FOREACH (string i, addresses) {
+       for (auto i: addresses) {
                o += i + ", ";
        }
 
index 00baaeb141e86a7d4a12ae7abb5181ed583f055b..0cf2b85dcb849c69550bfa953b613a96e170a684 100644 (file)
@@ -26,7 +26,6 @@
 #include "dcp_content.h"
 #include "dcpomatic_time_coalesce.h"
 #include "piece.h"
-#include <boost/foreach.hpp>
 #include <iostream>
 
 using std::cout;
@@ -39,7 +38,7 @@ using namespace dcpomatic;
 Empty::Empty (shared_ptr<const Film> film, shared_ptr<const Playlist> playlist, function<bool (shared_ptr<const Content>)> part, DCPTime length)
 {
        list<DCPTimePeriod> full;
-       BOOST_FOREACH (shared_ptr<Content> 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);
        }
 
index a14578a6bd7774fbab8e7b365e9b3866e2bf4818..6ec3e701ca18a0bb8f9ac5645cb50f81243600cb 100644 (file)
@@ -44,7 +44,6 @@ DCPOMATIC_DISABLE_WARNINGS
 DCPOMATIC_ENABLE_WARNINGS
 #include <boost/algorithm/string.hpp>
 #include <boost/scoped_array.hpp>
-#include <boost/foreach.hpp>
 #ifdef HAVE_VALGRIND_H
 #include <valgrind/memcheck.h>
 #endif
index 5a5a2bfb74cd38a6bf3329f362c7b9c43dbee215..396d67623d6801d4cad459b7c59931ff5dab3139 100644 (file)
@@ -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<string> (HELLO_PORT));
index 751bab5aa71d637edabfedb776490a06f818de7f..086afd91e60288101a030f218fd08a644b0dfa9a 100644 (file)
@@ -57,7 +57,6 @@ extern "C" {
 #include <lwext4/ext4_mkfs.h>
 }
 #include <boost/filesystem.hpp>
-#include <boost/foreach.hpp>
 #include <string>
 
 
@@ -246,7 +245,7 @@ void
 verify (vector<CopiedFile> 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) {
index 11a332bdb80c300b5e91478899aa00a9fdb15bf5..85c65763f146e12ac31f1b18dea24b1ceac8c74c 100644 (file)
@@ -37,7 +37,6 @@ extern "C" {
 #include <libswscale/swscale.h>
 }
 #include <boost/algorithm/string.hpp>
-#include <boost/foreach.hpp>
 #include <iostream>
 
 #include "i18n.h"
@@ -314,7 +313,7 @@ FFmpeg::pts_offset (vector<shared_ptr<FFmpegAudioStream> > audio_streams, option
                po = - first_video.get ();
        }
 
-       BOOST_FOREACH (shared_ptr<FFmpegAudioStream> i, audio_streams) {
+       for (auto i: audio_streams) {
                if (i->first_audio) {
                        po = max (po, - i->first_audio.get ());
                }
index 6f3aceff8609da3cea061be3858edcd60ac9a3b2..234c792fd3ddfff4c7915fa54bbcaca0dca22cda 100644 (file)
@@ -41,7 +41,6 @@ extern "C" {
 #include <libavutil/pixdesc.h>
 }
 #include <libxml++/libxml++.h>
-#include <boost/foreach.hpp>
 #include <iostream>
 
 #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<FFmpegAudioStream> f = dynamic_pointer_cast<FFmpegAudioStream> (i);
                        DCPOMATIC_ASSERT (f);
                        f->as_xml (node->add_child("AudioStream"));
@@ -296,7 +295,7 @@ FFmpegContent::examine (shared_ptr<const Film> film, shared_ptr<Job> job)
                if (!examiner->audio_streams().empty ()) {
                        audio.reset (new AudioContent (this));
 
-                       BOOST_FOREACH (shared_ptr<FFmpegAudioStream> 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<FFmpegAudioStream> i, ffmpeg_audio_streams ()) {
+       for (auto i: ffmpeg_audio_streams ()) {
                as += i->technical_summary () + " " ;
        }
 
@@ -408,7 +407,7 @@ FFmpegContent::full_length (shared_ptr<const Film> 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<shared_ptr<FFmpegAudioStream> > fa;
 
        if (audio) {
-               BOOST_FOREACH (AudioStreamPtr i, audio->streams()) {
+               for (auto i: audio->streams()) {
                        fa.push_back (dynamic_pointer_cast<FFmpegAudioStream> (i));
                }
        }
index ae4ab237f344ce8c8fd39613d0589b21475dbec6..b050fc594a76f97ab72833c38792f62daf4f100d 100644 (file)
@@ -51,7 +51,6 @@ extern "C" {
 #include <libavcodec/avcodec.h>
 #include <libavformat/avformat.h>
 }
-#include <boost/foreach.hpp>
 #include <boost/algorithm/string.hpp>
 #include <vector>
 #include <iomanip>
@@ -134,7 +133,7 @@ FFmpegDecoder::flush ()
                }
        }
 
-       BOOST_FOREACH (shared_ptr<FFmpegAudioStream> 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<FFmpegAudioStream> 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<ContentTime>& i, _next_time) {
+       for (auto& i: _next_time) {
                i = optional<ContentTime>();
        }
 }
@@ -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<list<sub::Subtitle> > (raw)) {
+       for (auto const& i: sub::collect<list<sub::Subtitle> > (raw)) {
                only_text()->emit_plain_start (from, i);
        }
 }
index 4e1f0bcb59ca5f57115d8de3bdf80ae8996d06b3..cc4f18bb6bb3d381ebf19309b77d58cd91349419 100644 (file)
@@ -212,7 +212,7 @@ FFmpegEncoder::go ()
        }
        delete[] interleaved;
 
-       BOOST_FOREACH (FileEncoderSet i, file_encoders) {
+       for (auto i: file_encoders) {
                i.flush ();
        }
 }
index b75d6c5149ced496e4cb1eb4dd60b17d3aa9df67..23c2f1a72609189a010ba041f9e02f292f96b9c3 100644 (file)
@@ -36,7 +36,6 @@ extern "C" {
 #include <libavutil/display.h>
 }
 DCPOMATIC_ENABLE_WARNINGS
-#include <boost/foreach.hpp>
 #include <iostream>
 
 #include "i18n.h"
index 99637564abd557d523153c9385f04da374ad95bf..0eea003a92dda1f4a282af05988ca24811c03b93 100644 (file)
@@ -385,7 +385,7 @@ DCPOMATIC_ENABLE_WARNINGS
                av_packet_unref (&packet);
 
                flushed_audio = true;
-               BOOST_FOREACH (shared_ptr<ExportAudioStream> 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<ExportAudioStream> i, _audio_streams) {
+               for (auto i: _audio_streams) {
                        i->write (size, offset, 1, _pending_audio->data(), _audio_frames);
                        ++offset;
                }
index 72698fa51cc49b2a947abde2fedf87ed2d461cd8..e500dd35b6294b91c6750ae6532ef3ae0fdddca1 100644 (file)
@@ -24,7 +24,6 @@
 DCPOMATIC_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
 DCPOMATIC_ENABLE_WARNINGS
-#include <boost/foreach.hpp>
 #include <iostream>
 
 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"));
                }
        }
index 68e5c1c1fc76657ea7d2b9d99e90ab6316969c1a..8bcbaebe5e044c500f2617940419b55715295815 100644 (file)
@@ -69,7 +69,6 @@
 #include <libxml++/libxml++.h>
 #include <boost/filesystem.hpp>
 #include <boost/algorithm/string.hpp>
-#include <boost/foreach.hpp>
 #include <boost/regex.hpp>
 #include <unistd.h>
 #include <stdexcept>
@@ -220,11 +219,11 @@ Film::Film (optional<boost::filesystem::path> 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<const Playlist> playlist) const
        boost::filesystem::path p = dir ("analysis");
 
        Digester digester;
-       BOOST_FOREACH (shared_ptr<Content> i, playlist->content ()) {
+       for (auto i: playlist->content ()) {
                if (!i->audio) {
                        continue;
                }
@@ -329,7 +328,7 @@ Film::subtitle_analysis_path (shared_ptr<const Content> content) const
                shared_ptr<TextContent> tc = content->text.front();
                digester.add (tc->x_scale());
                digester.add (tc->y_scale());
-               BOOST_FOREACH (shared_ptr<dcpomatic::Font> 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<const Content> 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<const Content> 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<string>(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<boost::filesystem::path> 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<DCPTime::Type>(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<boost::filesystem::path> 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<boost::filesystem::path> path)
 
        optional<dcp::LanguageTag> 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<Content> i, content ()) {
+               for (auto i: content ()) {
                        if (i->audio) {
                                list<int> 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<Content> 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<Content> i, content()) {
-                       BOOST_FOREACH (shared_ptr<TextContent> 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<Content> i, content ()) {
+       for (auto i: content()) {
                shared_ptr<const DCPContent> dc = dynamic_pointer_cast<const DCPContent> (i);
                if (!dc) {
                        continue;
@@ -1345,7 +1344,7 @@ Film::add_content (shared_ptr<Content> c)
 
        if (_template_film) {
                /* Take settings from the first piece of content of c's type in _template */
-               BOOST_FOREACH (shared_ptr<Content> 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<VideoContent> video;
-       BOOST_FOREACH (shared_ptr<const Content> 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<int> atmos_rate;
-       BOOST_FOREACH (shared_ptr<Content> 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<Content> i, content()) {
+       for (auto i: content()) {
                shared_ptr<DCPContent> d = dynamic_pointer_cast<DCPContent>(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<Content> 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<dcp::DecryptedKDMKey> imported_keys;
-       BOOST_FOREACH (shared_ptr<Content> i, content()) {
+       for (auto i: content()) {
                shared_ptr<DCPContent> d = dynamic_pointer_cast<DCPContent> (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<shared_ptr<const dcp::ReelMXF>, dcp::Key> keys;
 
-       BOOST_FOREACH(shared_ptr<const dcp::ReelMXF> 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<DCPTime> split_points;
                split_points.push_back (DCPTime());
                split_points.push_back (len);
-               BOOST_FOREACH (shared_ptr<Content> 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<DCPTime> 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<const Film> film)
 bool
 Film::references_dcp_video () const
 {
-       BOOST_FOREACH (shared_ptr<Content> i, _playlist->content()) {
+       for (auto i: _playlist->content()) {
                shared_ptr<DCPContent> d = dynamic_pointer_cast<DCPContent>(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<Content> i, _playlist->content()) {
+       for (auto i: _playlist->content()) {
                shared_ptr<DCPContent> d = dynamic_pointer_cast<DCPContent>(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<Content> i, _playlist->content()) {
+       for (auto i: _playlist->content()) {
                if (i->atmos) {
                        return true;
                }
@@ -1911,8 +1910,8 @@ list<DCPTextTrack>
 Film::closed_caption_tracks () const
 {
        list<DCPTextTrack> tt;
-       BOOST_FOREACH (shared_ptr<Content> i, content()) {
-               BOOST_FOREACH (shared_ptr<TextContent> 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()) {
index 663d1454742e63f388af460430f048cf68abd4b0..6869d26c99b582d60250870fc9613992eb28cc0a 100644 (file)
@@ -26,7 +26,6 @@
 extern "C" {
 #include <libavfilter/avfilter.h>
 }
-#include <boost/foreach.hpp>
 #include <iostream>
 
 #include "i18n.h"
@@ -103,7 +102,7 @@ Filter::ffmpeg_string (vector<Filter const *> const & filters)
 {
        string ff;
 
-       BOOST_FOREACH (Filter const * i, filters) {
+       for (auto const i: filters) {
                if (!ff.empty ()) {
                        ff += N_(",");
                }
index a52957376298d9873570b1c33b458bbaaba46711..aa9a8aaef7bc39d556f9377351a83cc0a2fbd401 100644 (file)
@@ -24,7 +24,6 @@
 DCPOMATIC_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
 DCPOMATIC_ENABLE_WARNINGS
-#include <boost/foreach.hpp>
 
 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();
index 27c0224ec80d0e50ace7996a0dafd3b90843348a..dcb9aeaf5e4be5c71fb58e6810065335db34857e 100644 (file)
@@ -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;
                }
index e52e448cf0cd2b2e1011f05b07fdcd013634ce62..ca697ad74a8fc8abbaebe3b17521463b4ab1f68c 100644 (file)
@@ -40,7 +40,6 @@
 #include <dcp/reel.h>
 #include <dcp/reel_closed_caption_asset.h>
 #include <dcp/reel_subtitle_asset.h>
-#include <boost/foreach.hpp>
 #include <boost/algorithm/string.hpp>
 #include <iostream>
 
@@ -126,7 +125,7 @@ Hints::check_incorrect_container ()
 {
        int narrower_than_scope = 0;
        int scope = 0;
-       BOOST_FOREACH (shared_ptr<const Content> 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<double> lowest_speed_up;
        optional<double> highest_speed_up;
-       BOOST_FOREACH (shared_ptr<const Content> 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<Content> i, film()->content()) {
-                       BOOST_FOREACH (shared_ptr<TextContent> j, i->text) {
-                               BOOST_FOREACH (shared_ptr<Font> k, j->fonts()) {
+               for (auto i: film()->content()) {
+                       for (auto j: i->text) {
+                               for (auto k: j->fonts()) {
                                        optional<boost::filesystem::path> 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<const Content> 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<const Content> 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<dcp::Reel> reel, dcp.cpls().front()->reels()) {
-               BOOST_FOREACH (shared_ptr<dcp::ReelClosedCaptionAsset> 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<size_t>(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());
        }
 
index 20f32c05dc0310c6d14b2a5d30758711c8218e1d..517d6792f89715d16f83edcaa60779f40a7e99ee 100644 (file)
@@ -29,7 +29,6 @@
 #include "image_filename_sorter.h"
 #include <libcxml/cxml.h>
 #include <libxml++/libxml++.h>
-#include <boost/foreach.hpp>
 #include <iostream>
 
 #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 ();
index 47f46e81d75ecbe5aa589c4b1fd592241a5f150d..ea5f46da64401e5c92596201e3011a119a319b74 100644 (file)
@@ -21,7 +21,6 @@
 #include "image_filename_sorter.h"
 #include <dcp/locale_convert.h>
 #include <boost/filesystem.hpp>
-#include <boost/foreach.hpp>
 #include <boost/optional.hpp>
 #include <iostream>
 
index 273bce8fb6331acc76101e2b1b1a0f42ce609c44..acd27932e226c87ed8a4572fbfa65b999b1f31ec 100644 (file)
@@ -37,7 +37,6 @@
 #include "encode_server_description.h"
 #include "compose.hpp"
 #include <libcxml/cxml.h>
-#include <boost/foreach.hpp>
 #include <iostream>
 
 #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;
                }
index 525f86b2c92d9a2e5b16f63f27119e55683e9d4b..f0d8fcbbc1d4554dc920924cfdae43bdb0f4c01a 100644 (file)
@@ -34,7 +34,6 @@
 #include <sub/exceptions.h>
 #include <boost/thread.hpp>
 #include <boost/filesystem.hpp>
-#include <boost/foreach.hpp>
 #include <boost/date_time/posix_time/posix_time.hpp>
 #include <iostream>
 
@@ -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";
                }
 
index 358820c6a3c35a0ff88d3a295f2c3566435a58e1..1724879d0656ffe38b0a6962374a1489744af377 100644 (file)
@@ -29,7 +29,6 @@
 #include "analyse_subtitles_job.h"
 #include "film.h"
 #include <boost/thread.hpp>
-#include <boost/foreach.hpp>
 #include <iostream>
 
 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<Job> 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<Job> i, _jobs) {
+                       for (auto i: _jobs) {
                                if (i->running()) {
                                        have_running = true;
                                }
@@ -171,7 +170,7 @@ JobManager::scheduler ()
                        break;
                }
 
-               BOOST_FOREACH (shared_ptr<Job> 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<Job> i, _jobs) {
+               for (auto i: _jobs) {
                        shared_ptr<AnalyseAudioJob> a = dynamic_pointer_cast<AnalyseAudioJob> (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<Job> i, _jobs) {
+               for (auto i: _jobs) {
                        shared_ptr<AnalyseSubtitlesJob> a = dynamic_pointer_cast<AnalyseSubtitlesJob> (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<Job> 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<Job> i, _jobs) {
+       for (auto i: _jobs) {
                if (i->pause_by_user()) {
                        _paused_job = i;
                }
index 2747e414060463804141419526603a7ca4fc1ace..92c95a401eaffbfd00d8df1f2cedae478cf01035 100644 (file)
@@ -26,7 +26,6 @@
 #include "config.h"
 #include "dcpomatic_log.h"
 #include "emailer.h"
-#include <boost/foreach.hpp>
 #include <boost/function.hpp>
 #include <boost/function.hpp>
 
@@ -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<KDMWithMetadataPtr> 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<KDMWithMetadataPtr> kdms)
 {
        list<list<KDMWithMetadataPtr> > grouped;
 
-       BOOST_FOREACH (KDMWithMetadataPtr i, kdms) {
+       for (auto i: kdms) {
 
                list<list<KDMWithMetadataPtr> >::iterator j = grouped.begin ();
 
@@ -144,7 +143,7 @@ write_directories (
 {
        int written = 0;
 
-       BOOST_FOREACH (list<KDMWithMetadataPtr> 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<KDMWithMetadataPtr> 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<KDMWithMetadataPtr> 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<string> 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 ()) {
index f5ccd48d0276db1153e1129f7e2ca1633bd2bbd9..32801de39e5c0449a6b85fbb1de02b7c1a1c831b 100644 (file)
@@ -21,7 +21,6 @@
 #include "overlaps.h"
 #include "types.h"
 #include "content.h"
-#include <boost/foreach.hpp>
 
 using std::shared_ptr;
 using boost::function;
@@ -31,7 +30,7 @@ ContentList overlaps (shared_ptr<const Film> film, ContentList cl, function<bool
 {
        ContentList overlaps;
        DCPTimePeriod period (from, to);
-       BOOST_FOREACH (shared_ptr<Content> i, cl) {
+       for (auto i: cl) {
                if (part(i) && DCPTimePeriod(i->position(), i->end(film)).overlap(period)) {
                        overlaps.push_back (i);
                }
index e6e8aca86ea198bedaa1e5e4992732639ec4ee5e..503452b59cd1e73f8f60de9fd26a3eab8a5cad41 100644 (file)
@@ -56,7 +56,6 @@
 #include <dcp/reel_subtitle_asset.h>
 #include <dcp/reel_picture_asset.h>
 #include <dcp/reel_closed_caption_asset.h>
-#include <boost/foreach.hpp>
 #include <stdint.h>
 #include <algorithm>
 #include <iostream>
@@ -177,7 +176,7 @@ Player::setup_pieces_unlocked ()
        _shuffler = new Shuffler();
        _shuffler->Video.connect(bind(&Player::video, this, _1, _2));
 
-       BOOST_FOREACH (shared_ptr<Content> i, playlist()->content()) {
+       for (auto i: playlist()->content()) {
 
                if (!i->paths_valid ()) {
                        continue;
@@ -189,7 +188,7 @@ Player::setup_pieces_unlocked ()
                }
 
                shared_ptr<Decoder> old_decoder;
-               BOOST_FOREACH (shared_ptr<Piece> 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<TextDecoder> 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<Piece> 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<FontData> fonts;
-       BOOST_FOREACH (shared_ptr<Piece> 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<ReferencedReelAsset> a;
 
-       BOOST_FOREACH (shared_ptr<Content> i, playlist()->content()) {
+       for (auto i: playlist()->content()) {
                shared_ptr<DCPContent> j = dynamic_pointer_cast<DCPContent> (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<dcp::Reel> 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<dcp::Reel> 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<dcp::ReelClosedCaptionAsset> 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<Piece> earliest_content;
        optional<DCPTime> earliest_time;
 
-       BOOST_FOREACH (shared_ptr<Piece> i, _pieces) {
+       for (auto i: _pieces) {
                if (i->done) {
                        continue;
                }
@@ -765,13 +764,13 @@ Player::open_subtitles_for_frame (DCPTime time) const
        list<PositionImage> 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<Piece> wp, weak_ptr<const TextContent> 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<Piece> 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> content, ContentTime t)
 {
        boost::mutex::scoped_lock lm (_mutex);
 
-       BOOST_FOREACH (shared_ptr<Piece> i, _pieces) {
+       for (auto i: _pieces) {
                if (i->content == content) {
                        return content_time_to_dcp (i, t);
                }
index d2448efa67754e27c3c55f02a7d8b187689c3af7..5456b06c4aca6890cba4beced686688811400ce3 100644 (file)
@@ -20,7 +20,6 @@
 
 #include "player_text.h"
 #include "font.h"
-#include <boost/foreach.hpp>
 
 using std::list;
 using std::shared_ptr;
@@ -29,9 +28,9 @@ using namespace dcpomatic;
 void
 PlayerText::add_fonts (list<shared_ptr<Font> > fonts_)
 {
-       BOOST_FOREACH (shared_ptr<Font> i, fonts_) {
+       for (auto i: fonts_) {
                bool got = false;
-               BOOST_FOREACH (shared_ptr<Font> j, fonts) {
+               for (auto j: fonts) {
                        if (*i == *j) {
                                got = true;
                        }
index 287f23fd4f929bb368cf691c225ac22f34f4248c..ab7649be151f5e3dd1834bf6b3c84c61712d9ae1 100644 (file)
@@ -35,7 +35,6 @@
 #include <libcxml/cxml.h>
 #include <libxml++/libxml++.h>
 #include <boost/bind/placeholders.hpp>
-#include <boost/foreach.hpp>
 #include <iostream>
 
 #include "i18n.h"
@@ -138,7 +137,7 @@ Playlist::maybe_sequence (shared_ptr<const Film> film)
 
        DCPTime next_left;
        DCPTime next_right;
-       BOOST_FOREACH (shared_ptr<Content> i, cont) {
+       for (auto i: cont) {
                if (!i->video) {
                        continue;
                }
@@ -157,7 +156,7 @@ Playlist::maybe_sequence (shared_ptr<const Film> film)
        /* Captions */
 
        DCPTime next;
-       BOOST_FOREACH (shared_ptr<Content> 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<const Content> i, content()) {
+       for (auto i: content()) {
                bool burn = false;
-               BOOST_FOREACH (shared_ptr<TextContent> j, i->text) {
+               for (auto j: i->text) {
                        if (j->burn()) {
                                burn = true;
                        }
@@ -204,7 +203,7 @@ Playlist::set_from_xml (shared_ptr<const Film> 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 = 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<const Film> film, cxml::ConstNodePtr node, in
 void
 Playlist::as_xml (xmlpp::Node* node, bool with_content_paths)
 {
-       BOOST_FOREACH (shared_ptr<Content> 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<Content> 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<FrameRateCandidate> 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<Content> j, content()) {
+               for (auto j: content()) {
                        if (!j->video || !j->video_frame_rate()) {
                                continue;
                        }
@@ -418,7 +417,7 @@ DCPTime
 Playlist::length (shared_ptr<const Film> film) const
 {
        DCPTime len;
-       BOOST_FOREACH (shared_ptr<const Content> 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<Content> 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<const Film> film)
 {
        disconnect ();
 
-       BOOST_FOREACH (shared_ptr<Content> 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<const Film> film) const
 {
        DCPTime end;
-       BOOST_FOREACH (shared_ptr<Content> 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<const Film> film) const
 {
        DCPTime end;
-       BOOST_FOREACH (shared_ptr<Content> 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<const Film> film, ContentList c, int n)
 {
        pair<DCPTime, DCPTime> range (DCPTime::max (), DCPTime ());
-       BOOST_FOREACH (shared_ptr<Content> 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<const Film> film, ContentList c, int n)
 
                DCPTime pos = range.second;
                for (int i = 0; i < n; ++i) {
-                       BOOST_FOREACH (shared_ptr<Content> j, c) {
+                       for (auto j: c) {
                                shared_ptr<Content> 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<const Film> 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<Content> i, content()) {
+       for (auto i: content()) {
                shared_ptr<DCPContent> d = dynamic_pointer_cast<DCPContent> (i);
                if (d) {
                        if (d->reference_video()) {
@@ -655,7 +654,7 @@ Playlist::content_summary (shared_ptr<const Film> film, DCPTimePeriod period) co
 {
        string best_summary;
        int best_score = -1;
-       BOOST_FOREACH (shared_ptr<Content> i, content()) {
+       for (auto i: content()) {
                int score = 0;
                optional<DCPTimePeriod> 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<double, double> range (DBL_MAX, -DBL_MAX);
 
-       BOOST_FOREACH (shared_ptr<Content> i, content()) {
+       for (auto i: content()) {
                if (!i->video) {
                        continue;
                }
index 110102b7061f0890e5eb0044ff68e13c307f3dce..b81c225c276517ee0e6e7b17c2cc255684f4d381 100644 (file)
@@ -51,7 +51,6 @@
 #include <dcp/smpte_subtitle_asset.h>
 #include <dcp/raw_convert.h>
 #include <dcp/subtitle_image.h>
-#include <boost/foreach.hpp>
 
 #include "i18n.h"
 
@@ -179,7 +178,7 @@ ReelWriter::ReelWriter (
                DCPOMATIC_ASSERT (film()->directory());
 
                vector<dcp::Channel> active;
-               BOOST_FOREACH (int i, film()->mapped_audio_channels()) {
+               for (auto i: film()->mapped_audio_channels()) {
                        active.push_back (static_cast<dcp::Channel>(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<T> k = dynamic_pointer_cast<T> (j.asset);
                        if (k && j.period == period) {
                                reel_asset = k;
@@ -536,7 +535,7 @@ ReelWriter::create_reel_picture (shared_ptr<dcp::Reel> reel, list<ReferencedReel
        } else {
                LOG_GENERAL ("no picture asset of our own; look through %1", refs.size());
                /* We don't have a picture asset of our own; hopefully we have one to reference */
-               BOOST_FOREACH (ReferencedReelAsset j, refs) {
+               for (auto j: refs) {
                        shared_ptr<dcp::ReelPictureAsset> k = dynamic_pointer_cast<dcp::ReelPictureAsset> (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<dcp::Reel> reel, list<ReferencedReelAs
        } else {
                LOG_GENERAL ("no sound asset of our own; look through %1", refs.size());
                /* We don't have a sound asset of our own; hopefully we have one to reference */
-               BOOST_FOREACH (ReferencedReelAsset j, refs) {
+               for (auto j: refs) {
                        shared_ptr<dcp::ReelSoundAsset> k = dynamic_pointer_cast<dcp::ReelSoundAsset> (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<dcp::ReelClosedCaptionAsset> a = maybe_add_text<dcp::ReelClosedCaptionAsset> (
                        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<DCPTextTrack> 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<dcp::Subtitle>(new dcp::SubtitleString(i)));
        }
 
-       BOOST_FOREACH (BitmapText i, subs.bitmap) {
+       for (auto i: subs.bitmap) {
                asset->add (
                        shared_ptr<dcp::Subtitle>(
                                new dcp::SubtitleImage(
index 3129c220f8f5f56ee5f7618e7df368f064bb439b..3dc1e9ff0e4efcd0839281439c86be8b01364977 100644 (file)
@@ -36,7 +36,6 @@ DCPOMATIC_ENABLE_WARNINGS
 #ifndef DCPOMATIC_HAVE_SHOW_IN_CAIRO_CONTEXT
 #include <pango/pangocairo.h>
 #endif
-#include <boost/foreach.hpp>
 #include <boost/algorithm/string.hpp>
 #include <iostream>
 
@@ -61,7 +60,7 @@ marked_up (list<StringText> subtitles, int target_height, float fade_factor)
 {
        string out;
 
-       BOOST_FOREACH (StringText const & i, subtitles) {
+       for (auto const& i: subtitles) {
                out += "<span ";
                if (i.italic()) {
                        out += "style=\"italic\" ";
@@ -142,7 +141,7 @@ setup_font (StringText const& subtitle, list<shared_ptr<Font> > const& fonts)
 
        optional<boost::filesystem::path> font_file = default_font_file ();
 
-       BOOST_FOREACH (shared_ptr<Font> i, fonts) {
+       for (auto i: fonts) {
                if (i->id() == subtitle.font() && i->file()) {
                        font_file = i->file ();
                }
@@ -404,7 +403,7 @@ render_text (list<StringText> subtitles, list<shared_ptr<Font> > fonts, dcp::Siz
        list<StringText> pending;
        list<PositionImage> 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 ();
index dea513ab07f3452bbc2dad2879fce35fde4528e6..8e1e83e36697f0e802d05fafc8b1fd2605cff529 100644 (file)
@@ -23,7 +23,6 @@
 #include "film.h"
 #include "cinema.h"
 #include <libxml++/libxml++.h>
-#include <boost/foreach.hpp>
 #include <boost/algorithm/string.hpp>
 #include <boost/date_time/posix_time/posix_time.hpp>
 
@@ -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<string>
 Screen::trusted_device_thumbprints () const
 {
        vector<string> t;
-       BOOST_FOREACH (TrustedDevice i, trusted_devices) {
+       for (auto i: trusted_devices) {
                t.push_back (i.thumbprint());
        }
        return t;
index cea35e3c59edb08ca3183935e3247a02a47174e5..8ed08f2a39c6f666ed9c2f30712c5fc5a421b8e2 100644 (file)
@@ -42,7 +42,7 @@ SendKDMEmailJob::SendKDMEmailJob (
        , _filename_format (filename_format)
        , _cpl_name (cpl_name)
 {
-       BOOST_FOREACH (KDMWithMetadataPtr i, kdms) {
+       for (auto i: kdms) {
                list<KDMWithMetadataPtr> s;
                s.push_back (i);
                _kdms.push_back (s);
index 41d215ba2a79e7fe8fb41b5d42f518fd055f2fc3..e5edc49ee746410c27dafe5368e8983c358f6128 100644 (file)
@@ -23,7 +23,6 @@
 #include "config.h"
 #include "emailer.h"
 #include "compose.hpp"
-#include <boost/foreach.hpp>
 #include <list>
 
 #include "i18n.h"
@@ -70,7 +69,7 @@ SendNotificationEmailJob::run ()
        list<string> 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()) {
index 143baaa1bdeb89e576319304956ab0df9952e863..cff1c8e9f873ad179816a31d013c116b1a9b4135 100644 (file)
@@ -28,7 +28,6 @@
 #include "emailer.h"
 #include "environment_info.h"
 #include <libxml++/libxml++.h>
-#include <boost/foreach.hpp>
 
 #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";
        }
 
index 2689fb83778d6e03191399eb5a4166c9b07f50de..0e478a562a658a6e6fe48493772ddb1eced6ee1f 100644 (file)
@@ -22,7 +22,6 @@
 #include "content_video.h"
 #include "dcpomatic_assert.h"
 #include "dcpomatic_log.h"
-#include <boost/foreach.hpp>
 #include <string>
 #include <iostream>
 
@@ -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);
        }
 }
index 512fe253c68dc7fa69e364afa406cdcbc8374ca8..1677e626ff07ddf5cd25fb478aecdcd8da9075ed 100644 (file)
@@ -26,7 +26,6 @@
 DCPOMATIC_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
 DCPOMATIC_ENABLE_WARNINGS
-#include <boost/foreach.hpp>
 #include <iostream>
 
 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<Content> 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());
index 415851aef4737366127a26ba2ee7e09af75a6069..f24147851847e1ee120354984f2dbd40f20630a7 100644 (file)
@@ -23,7 +23,6 @@
 #include "text_content.h"
 #include "text_decoder.h"
 #include <dcp/subtitle_string.h>
-#include <boost/foreach.hpp>
 #include <iostream>
 
 using std::list;
@@ -95,8 +94,8 @@ vector<FontData>
 StringTextFileDecoder::fonts () const
 {
        vector<FontData> data;
-       BOOST_FOREACH (shared_ptr<TextDecoder> i, text) {
-               BOOST_FOREACH (shared_ptr<Font> j, i->content()->fonts()) {
+       for (auto i: text) {
+               for (auto j: i->content()->fonts()) {
                        data.push_back (FontData(j));
                }
        }
index 1a83c5c67fe868eace79fa82e1ccff390bab3a41..cc42f1204e78c860b21e0ba623b494def2ed3124 100644 (file)
@@ -77,7 +77,7 @@ SubtitleEncoder::SubtitleEncoder (shared_ptr<const Film> film, shared_ptr<Job> j
                _assets.push_back (make_pair(shared_ptr<dcp::SubtitleAsset>(), 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<DCPTextTrack> 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());
index 656aec7ebca226744911839f8b724dfd3af779eb..2f01bb2fa6e8a32e9d819ca3e2515bc272676b81 100644 (file)
@@ -26,7 +26,6 @@
 #include <dcp/raw_convert.h>
 #include <libcxml/cxml.h>
 #include <libxml++/libxml++.h>
-#include <boost/foreach.hpp>
 #include <iostream>
 
 #include "i18n.h"
@@ -105,7 +104,7 @@ TextContent::from_xml (Content* parent, cxml::ConstNodePtr node, int version)
        }
 
        list<shared_ptr<TextContent> > c;
-       BOOST_FOREACH (cxml::ConstNodePtr i, node->node_children("Text")) {
+       for (auto i: node->node_children("Text")) {
                c.push_back (shared_ptr<TextContent> (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<Font> f, _fonts) {
+       for (auto f: _fonts) {
                s += "_" + f->file().get_value_or("Default").string();
        }
 
@@ -416,13 +415,13 @@ TextContent::add_font (shared_ptr<Font> 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<Font> i, _fonts) {
+       for (auto i: _fonts) {
                _font_connections.push_back (i->Changed.connect (boost::bind (&TextContent::font_changed, this)));
        }
 }
index 3f6afd710be6d32474a0f3260ddbf9c1b52e1ae5..a2241c50b4f9f0b630ae1ed623b28b34f60a383d 100644 (file)
@@ -24,7 +24,6 @@
 #include "log.h"
 #include "compose.hpp"
 #include <sub/subtitle.h>
-#include <boost/foreach.hpp>
 #include <boost/algorithm/string.hpp>
 #include <iostream>
 
@@ -67,7 +66,7 @@ TextDecoder::emit_bitmap_start (ContentTime from, shared_ptr<Image> image, dcpom
 void
 TextDecoder::emit_plain_start (ContentTime from, list<dcp::SubtitleString> 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<int> 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<float> 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<dcp::SubtitleString> 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 */
index 6729628cd7800298fbbe4c3ecf87cf8be1fe83f5..68d97b8ff614b84617fc1779e9747da5ebf54b47 100644 (file)
@@ -31,7 +31,6 @@ DCPOMATIC_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
 DCPOMATIC_ENABLE_WARNINGS
 #include <libcxml/cxml.h>
-#include <boost/foreach.hpp>
 
 #include "i18n.h"
 
@@ -200,7 +199,7 @@ CPLSummary::CPLSummary (boost::filesystem::path p)
 
        list<dcp::VerificationNote> notes;
        dcp.read (&notes);
-       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<dcp::CPL> j, dcp.cpls()) {
-               BOOST_FOREACH (shared_ptr<const dcp::ReelMXF> k, j->reel_mxfs()) {
+       for (auto j: dcp.cpls()) {
+               for (auto k: j->reel_mxfs()) {
                        if (k->key_id()) {
                                encrypted = true;
                        }
index 45b517c7f4f42d254253b5e7f6b5689787dce870..c7b3281dac4284dc00df042962b2e257b0b36b90 100644 (file)
@@ -810,7 +810,7 @@ audio_channel_types (list<int> 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<Job> 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<const dcp::CertificateChain> 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;
                        }
index 564e376adc12b82dcf427854b97cd1270520c650..ceb30701c3bbb956819bd60f30f3116e67021e87 100644 (file)
@@ -128,7 +128,7 @@ std::list<T>
 vector_to_list (std::vector<T> v)
 {
        std::list<T> l;
-       BOOST_FOREACH (T& i, v) {
+       for (auto& i: v) {
                l.push_back (i);
        }
        return l;
@@ -139,7 +139,7 @@ std::vector<T>
 list_to_vector (std::list<T> v)
 {
        std::vector<T> l;
-       BOOST_FOREACH (T& i, v) {
+       for (auto& i: v) {
                l.push_back (i);
        }
        return l;
index 88e44c4f9be8bfe17761a42f7f4a52a967586717..bbcce720893ccd794909e72f9249819fb9e4e234 100644 (file)
@@ -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;
                }
index 5bf0672832405125ea9577457fb830475a09c55a..cab8197cb75420eb2ba29e88ab51dfaaa7c68cdf 100644 (file)
@@ -25,7 +25,6 @@
 #include "log.h"
 #include "frame_interval_checker.h"
 #include "compose.hpp"
-#include <boost/foreach.hpp>
 #include <iostream>
 
 #include "i18n.h"
index 1c08d44b3fff5fdba9a86bcebcc2b227729c0c91..8c73aba25d636d67b621f582be6440d9c2c5b3e8 100644 (file)
@@ -21,7 +21,6 @@
 #include "video_ring_buffers.h"
 #include "player_video.h"
 #include "compose.hpp"
-#include <boost/foreach.hpp>
 #include <list>
 #include <iostream>
 
index ff2adeb0082df70b8e804c397126cfc9bf0d2473..8c5a8241505daacd5066332f00fcf201b7eec22b 100644 (file)
@@ -39,7 +39,6 @@
 #include <dcp/cpl.h>
 #include <dcp/locale_convert.h>
 #include <dcp/reel_mxf.h>
-#include <boost/foreach.hpp>
 #include <fstream>
 #include <cerrno>
 #include <iostream>
@@ -101,7 +100,7 @@ Writer::Writer (weak_ptr<const Film> weak_film, weak_ptr<Job> j, bool text_only)
 
        int reel_index = 0;
        list<DCPTimePeriod> 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<const Film> weak_film, weak_ptr<Job> 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<dcp::ContentVersion> 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<dcp::Channel>(i));
                }
@@ -796,9 +795,9 @@ Writer::write (vector<FontData> 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<void (float)> set_progress)
 {
-       BOOST_FOREACH (ReferencedReelAsset const& i, _reel_assets) {
+       for (auto const& i: _reel_assets) {
                shared_ptr<dcp::ReelMXF> mxf = dynamic_pointer_cast<dcp::ReelMXF>(i.asset);
                if (mxf && !mxf->hash()) {
                        mxf->asset_ref().asset()->hash (set_progress);
index 386e40cb27389800dc9d6e25182888d3c60c9789..bcef19f59bf608f8442242694d7b09802c543d7e 100644 (file)
@@ -103,7 +103,6 @@ DCPOMATIC_ENABLE_WARNINGS
 #endif
 #include <boost/filesystem.hpp>
 #include <boost/noncopyable.hpp>
-#include <boost/foreach.hpp>
 #include <boost/algorithm/string.hpp>
 #include <iostream>
 #include <fstream>
@@ -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<bool>(_clipboard->video), static_cast<bool>(_clipboard->audio), !_clipboard->text.empty());
                if (d->ShowModal() == wxID_OK) {
-                       BOOST_FOREACH (shared_ptr<Content> 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<string> ());
                                if (!_content_to_add.empty ()) {
-                                       BOOST_FOREACH (shared_ptr<Content> i, content_factory(_content_to_add)) {
+                                       for (auto i: content_factory(_content_to_add)) {
                                                _frame->film()->examine_and_add_content (i);
                                        }
                                }
index 46c66d2c9296ceb4b55337c4c422d3724501fa2c..9cb6ddc5546fc3887a598641e9bfc5c0d3ddd996 100644 (file)
@@ -40,7 +40,6 @@
 #include <wx/splash.h>
 #include <wx/preferences.h>
 #include <wx/wx.h>
-#include <boost/foreach.hpp>
 #include <iostream>
 #include <set>
 
@@ -179,13 +178,13 @@ public:
 
                        set<shared_ptr<const Film> > films;
 
-                       BOOST_FOREACH (shared_ptr<Job> i, JobManager::instance()->get()) {
+                       for (auto i: JobManager::instance()->get()) {
                                films.insert (i->film());
                        }
 
-                       BOOST_FOREACH (shared_ptr<const Film> i, films) {
+                       for (auto i: films) {
                                double progress = 0;
-                               BOOST_FOREACH (shared_ptr<Job> j, JobManager::instance()->get()) {
+                               for (auto j: JobManager::instance()->get()) {
                                        if (i == j->film() && dynamic_pointer_cast<TranscodeJob>(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> 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));
index 2d70fb578cd1b0629e904a1fb65702b3fa5c6b6f..46ae790cc76c389043bf70e13f207e1e4fc7de75 100644 (file)
@@ -35,7 +35,6 @@
 #include "lib/audio_content.h"
 #include "lib/dcpomatic_log.h"
 #include <dcp/version.h>
-#include <boost/foreach.hpp>
 #include <getopt.h>
 #include <iostream>
 #include <iomanip>
@@ -82,7 +81,7 @@ print_dump (shared_ptr<Film> 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<Content> 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 {
index 568dfa56c74c130e1c58c544b6c0ce47863ae764..1d3387f189c5780690fa54e9d461185dbc8af1ba 100644 (file)
@@ -38,7 +38,6 @@
 #include <dcp/exceptions.h>
 #include <libxml++/libxml++.h>
 #include <boost/filesystem.hpp>
-#include <boost/foreach.hpp>
 #include <getopt.h>
 #include <string>
 #include <iostream>
@@ -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<shared_ptr<Content> > content;
 
@@ -122,7 +121,7 @@ main (int argc, char* argv[])
                                content = content_factory (can);
                        }
 
-                       BOOST_FOREACH (shared_ptr<Content> 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<Content> 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<Content> i, film->content()) {
+               for (auto i: film->content()) {
                        shared_ptr<ImageContent> ic = dynamic_pointer_cast<ImageContent> (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<Job> i, jm->get()) {
+                       for (auto i: jm->get()) {
                                if (i->finished_in_error()) {
                                        cerr << i->error_summary() << "\n"
                                             << i->error_details() << "\n";
index ac0bb68df47dce48dc5be26074fcedfafdd5d463..17a24d4c102e651099d0b8ef0f9f33bb27ba3f5f 100644 (file)
@@ -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;
index 695a0b0334ae3d1581f92e70ba105a0a96434d3e..6c4221d8a7b337c199b4eafb31f8c5d50488ce61 100644 (file)
@@ -64,7 +64,6 @@ DCPOMATIC_ENABLE_WARNINGS
 #include <sys/types.h>
 #include <boost/filesystem.hpp>
 #include <boost/algorithm/string.hpp>
-#include <boost/foreach.hpp>
 #include <iostream>
 
 using std::cin;
index 874573ce282582d0cc82fcf118f901d12d9f942e..3547d0f59209ba6cafbe261ca3bc4423eeb761a0 100644 (file)
@@ -59,7 +59,6 @@ DCPOMATIC_ENABLE_WARNINGS
 #include <ApplicationServices/ApplicationServices.h>
 #endif
 #include <boost/bind/bind.hpp>
-#include <boost/foreach.hpp>
 
 #ifdef check
 #undef check
@@ -321,7 +320,7 @@ private:
                                        throw InvalidSignerError ();
                                }
 
-                               BOOST_FOREACH (shared_ptr<Screen> 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<DKDMGroup> g = dynamic_pointer_cast<DKDMGroup> (base);
                if (g) {
-                       BOOST_FOREACH (shared_ptr<DKDMBase> i, g->children()) {
+                       for (auto i: g->children()) {
                                add_dkdm_view (i);
                        }
                }
index fef5dea049ed6a564c723d74259257798558e28f..d0ee0cad925955d69f474e7dfd4debdbbb64ffcb 100644 (file)
@@ -226,7 +226,7 @@ from_film (
 
        try {
                list<KDMWithMetadataPtr> kdms;
-               BOOST_FOREACH (shared_ptr<Screen> 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<dcp::EncryptedKDM>
 sub_find_dkdm (shared_ptr<DKDMGroup> group, string cpl_id)
 {
-       BOOST_FOREACH (shared_ptr<DKDMBase> i, group->children()) {
+       for (auto i: group->children()) {
                shared_ptr<DKDMGroup> g = dynamic_pointer_cast<DKDMGroup>(i);
                if (g) {
                        optional<dcp::EncryptedKDM> 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<KDMWithMetadataPtr> kdms;
-               BOOST_FOREACH (shared_ptr<Screen> i, screens) {
+               for (auto i: screens) {
                        if (!i->recipient) {
                                continue;
                        }
@@ -375,7 +375,7 @@ dump_dkdm_group (shared_ptr<DKDMGroup> group, int indent)
                }
                cout << group->name() << "\n";
        }
-       BOOST_FOREACH (shared_ptr<DKDMBase> i, group->children()) {
+       for (auto i: group->children()) {
                shared_ptr<DKDMGroup> g = dynamic_pointer_cast<DKDMGroup>(i);
                if (g) {
                        dump_dkdm_group (g, indent + 2);
index 5b2c9a56af2b65366cda57673c53d904f6d6e66b..0586db9755dc2d7577f84c105ceab053c694788f 100644 (file)
@@ -278,7 +278,7 @@ public:
                }
 
                bool ok = true;
-               BOOST_FOREACH (shared_ptr<Content> i, _film->content()) {
+               for (auto i: _film->content()) {
                        shared_ptr<DCPContent> d = dynamic_pointer_cast<DCPContent>(i);
                        if (d && !d->kdm_timing_window_valid()) {
                                ok = false;
@@ -303,7 +303,7 @@ public:
                if (dcp) {
                        DCPExaminer ex (dcp, true);
                        shared_ptr<dcp::CPL> playing_cpl;
-                       BOOST_FOREACH (shared_ptr<dcp::CPL> i, ex.cpls()) {
+                       for (auto i: ex.cpls()) {
                                if (!dcp->cpl() || i->id() == *dcp->cpl()) {
                                        playing_cpl = i;
                                }
@@ -415,10 +415,10 @@ public:
                /* Start off as Flat */
                _film->set_container (Ratio::from_id("185"));
 
-               BOOST_FOREACH (shared_ptr<Content> i, _film->content()) {
+               for (auto i: _film->content()) {
                        shared_ptr<DCPContent> dcp = dynamic_pointer_cast<DCPContent>(i);
 
-                       BOOST_FOREACH (shared_ptr<TextContent> 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<dcp::CPL> 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<TextContent> i, dcp->text) {
+                       for (auto i: dcp->text) {
                                i->set_use (true);
                        }
                        if (dcp->video) {
index 261f0897267d9fc834f4daadf9ab6f832cbc6232..1dca8c182f53e19d0320b911c86e971b7c41d105 100644 (file)
@@ -36,7 +36,6 @@
 #include <wx/imaglist.h>
 #include <wx/spinctrl.h>
 #include <wx/preferences.h>
-#include <boost/foreach.hpp>
 
 using std::exception;
 using std::cout;
@@ -171,7 +170,7 @@ private:
                }
 
                int N = 0;
-               BOOST_FOREACH (shared_ptr<SignalSPL> 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<SignalSPL> 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()));
index c59fefe8f3170e7a006f47a1cc4c463187417745..4039a07ed3702e67df0bc3370386b95a64fe6312 100644 (file)
@@ -36,7 +36,6 @@ DCPOMATIC_DISABLE_WARNINGS
 #include <wx/icon.h>
 DCPOMATIC_ENABLE_WARNINGS
 #include <boost/thread.hpp>
-#include <boost/foreach.hpp>
 #include <boost/optional.hpp>
 #include <iostream>
 
@@ -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;
index 1cb167c950f939a34179e9f48c0ad4b6dd17b9d0..41b2a9d396c4faea163c360cd1b9ac5fecebcd4d 100644 (file)
@@ -30,7 +30,6 @@
 #include "lib/job_manager.h"
 #include <libxml++/libxml++.h>
 #include <boost/filesystem.hpp>
-#include <boost/foreach.hpp>
 #include <iostream>
 
 using std::cout;
@@ -204,7 +203,7 @@ AudioDialog::try_to_load_analysis ()
                _plot->set_analysis (shared_ptr<AudioAnalysis> ());
                _analysis.reset ();
 
-               BOOST_FOREACH (shared_ptr<Job> i, JobManager::instance()->get()) {
+               for (auto i: JobManager::instance()->get()) {
                        if (dynamic_pointer_cast<AnalyseAudioJob>(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);
index 04a468416a75cc8ede8977621b14b1cd464e5c90..60606b1660b8d1d626d1784bf6661184fea1a9e5 100644 (file)
@@ -36,7 +36,6 @@ DCPOMATIC_DISABLE_WARNINGS
 #include <wx/grid.h>
 #include <wx/graphics.h>
 DCPOMATIC_ENABLE_WARNINGS
-#include <boost/foreach.hpp>
 #include <iostream>
 
 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<wxString> 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);
                }
index bf73798dac5779f4000346b819133afc97b721de..dc2b91f47c2cd2d0e83c185cc7b0d819c92d6e24 100644 (file)
@@ -35,7 +35,6 @@
 #include "lib/dcp_content.h"
 #include "lib/audio_content.h"
 #include <wx/spinctrl.h>
-#include <boost/foreach.hpp>
 #include <iostream>
 
 using std::vector;
@@ -196,7 +195,7 @@ AudioPanel::film_content_changed (int property)
 
                        vector<AudioMappingView::Group> groups;
                        int c = 0;
-                       BOOST_FOREACH (shared_ptr<const AudioStream> i, ac.front()->audio->streams()) {
+                       for (auto i: ac.front()->audio->streams()) {
                                shared_ptr<const FFmpegAudioStream> f = dynamic_pointer_cast<const FFmpegAudioStream> (i);
                                string name = "";
                                if (f) {
index 682abe4324c47918877f6cfd661c1f9cfb277292..cb10908df821b432dc68692b51c9e1e67fdcc283 100644 (file)
@@ -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<int, PointList> const & search, wxMouseEvent const & ev, double& min_dist, Point& min_point) const
 {
        for (map<int, PointList>::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;
index ecb7d8107752b1cb385975471a68c887e1561164..e67fe77ed18626c2390b322d7f7e7ce175004893 100644 (file)
@@ -22,7 +22,6 @@
 #include "wx_util.h"
 #include "lib/dcpomatic_assert.h"
 #include "lib/util.h"
-#include <boost/foreach.hpp>
 
 using std::string;
 using std::vector;
index 71fc1527257a92f6e6312b45f592b18acde12c9a..4f34f0531343dce91e946f90cda89b17c2c0d5bb 100644 (file)
@@ -237,8 +237,8 @@ ClosedCaptionsDialog::update_tracks (shared_ptr<const Film> film)
 {
        _tracks.clear ();
 
-       BOOST_FOREACH (shared_ptr<Content> i, film->content()) {
-               BOOST_FOREACH (shared_ptr<TextContent> 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<const Film> 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)));
        }
 
index 0d341ba73e90f3dfe79ebc8ad729b7f9bbcbbba5..14abc286b115f616cbf4a786cd9770be4e012d30 100644 (file)
@@ -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);
index b2ebbe605b16eeab20d482d82c17dd85a7fb3618..818ab4def911545f714138859779832495f436f2 100644 (file)
@@ -44,7 +44,6 @@ DCPOMATIC_DISABLE_WARNINGS
 DCPOMATIC_ENABLE_WARNINGS
 #include <RtAudio.h>
 #include <boost/filesystem.hpp>
-#include <boost/foreach.hpp>
 #include <iostream>
 
 class AudioMappingView;
index 5b0c1510f154be7bfb906ffe7df852c6545e1285..7709442c917735f025ab4bd813d0ac5c173d9d01 100644 (file)
@@ -23,7 +23,6 @@
 #include "static_text.h"
 #include "check_box.h"
 #include "lib/config.h"
-#include <boost/foreach.hpp>
 
 using std::list;
 using std::string;
@@ -35,7 +34,7 @@ ConfirmKDMEmailDialog::ConfirmKDMEmailDialog (wxWindow* parent, list<string> 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";
        }
 
index 351d5aa65db086689df835820798eaf78941ee11..da9e1a41b9a6b3b95e70965fd8612b20955e52a2 100644 (file)
@@ -26,7 +26,6 @@
 #include "lib/config.h"
 #include "lib/util.h"
 #include <wx/statline.h>
-#include <boost/foreach.hpp>
 #include <iostream>
 
 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));
        }
 }
index 57c6afeb3eaa3166f13aa8104e846a77860f8916..d93fd31b2ce023c6730c7ba67d46389c711281ae 100644 (file)
@@ -43,7 +43,6 @@
 #include <dcp/decrypted_kdm.h>
 #include <wx/wx.h>
 #include <wx/dirdlg.h>
-#include <boost/foreach.hpp>
 #include <iostream>
 
 using std::cout;
@@ -122,7 +121,7 @@ ContentMenu::popup (weak_ptr<Film> film, ContentList c, TimelineContentViewList
        _repeat->Enable (!_content.empty ());
 
        int n = 0;
-       BOOST_FOREACH (shared_ptr<Content> i, _content) {
+       for (auto i: _content) {
                if (dynamic_pointer_cast<FFmpegContent> (i)) {
                        ++n;
                }
@@ -147,7 +146,7 @@ ContentMenu::popup (weak_ptr<Film> 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<dcp::CPL> i, cpls) {
+                               for (auto i: cpls) {
                                        wxMenuItem* item = _cpl_menu->AppendRadioItem (
                                                id++,
                                                wxString::Format (
@@ -228,7 +227,7 @@ void
 ContentMenu::join ()
 {
        vector<shared_ptr<Content> > fc;
-       BOOST_FOREACH (shared_ptr<Content> i, _content) {
+       for (auto i: _content) {
                shared_ptr<FFmpegContent> f = dynamic_pointer_cast<FFmpegContent> (i);
                if (f) {
                        fc.push_back (f);
@@ -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<Content> i, _content) {
+               for (auto i: _content) {
                        shared_ptr<FFmpegContent> fc = dynamic_pointer_cast<FFmpegContent> (i);
                        if (!fc) {
                                continue;
@@ -278,7 +277,7 @@ ContentMenu::remove ()
                        shared_ptr<TimelineVideoContentView> video;
                        shared_ptr<TimelineAudioContentView> audio;
 
-                       BOOST_FOREACH (shared_ptr<TimelineContentView> j, _views) {
+                       for (auto j: _views) {
                                shared_ptr<TimelineVideoContentView> v = dynamic_pointer_cast<TimelineVideoContentView> (j);
                                shared_ptr<TimelineAudioContentView> a = dynamic_pointer_cast<TimelineAudioContentView> (j);
                                if (v && v->content() == fc) {
@@ -350,7 +349,7 @@ ContentMenu::find_missing ()
                return;
        }
 
-       BOOST_FOREACH (shared_ptr<Content> i, content) {
+       for (auto i: content) {
                shared_ptr<Job> j (new ExamineContentJob (film, i));
 
                j->Finished.connect (
@@ -375,7 +374,7 @@ ContentMenu::re_examine ()
                return;
        }
 
-       BOOST_FOREACH (shared_ptr<Content> i, _content) {
+       for (auto i: _content) {
                JobManager::instance()->add (shared_ptr<Job> (new ExamineContentJob (film, i)));
        }
 }
@@ -434,7 +433,7 @@ ContentMenu::kdm ()
                DCPExaminer ex (dcp, true);
 
                bool kdm_matches_any_cpl = false;
-               BOOST_FOREACH (shared_ptr<dcp::CPL> i, ex.cpls()) {
+               for (auto i: ex.cpls()) {
                        if (i->id() == kdm->cpl_id()) {
                                kdm_matches_any_cpl = true;
                        }
index 7114e8337fb6b6298ef9aada0ffe0b65d9c218e3..83539403d7ed704b5f63403664ecfef4c3cd8da2 100644 (file)
@@ -48,7 +48,6 @@
 #include <wx/listctrl.h>
 #include <wx/display.h>
 #include <boost/filesystem.hpp>
-#include <boost/foreach.hpp>
 #include <iostream>
 
 using std::list;
@@ -183,7 +182,7 @@ ContentPanel::selected_video ()
 {
        ContentList vc;
 
-       BOOST_FOREACH (shared_ptr<Content> 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<Content> 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<Content> 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<Content> i, selected ()) {
+       for (auto i: selected()) {
                shared_ptr<FFmpegContent> t = dynamic_pointer_cast<FFmpegContent> (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<DCPTime> go_to;
-       BOOST_FOREACH (shared_ptr<Content> i, selected()) {
+       for (auto i: selected()) {
                DCPTime p;
                p = i->position();
                if (dynamic_pointer_cast<StringTextFileContent>(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<Content> i, selected()) {
+       for (auto i: selected()) {
                if (i->video) {
                        have_video = true;
                }
                if (i->audio) {
                        have_audio = true;
                }
-               BOOST_FOREACH (shared_ptr<TextContent> 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<Content> i, content) {
+       for (auto i: content) {
                shared_ptr<ImageContent> ic = dynamic_pointer_cast<ImageContent> (i);
                if (ic) {
                        ImageSequenceDialog* e = new ImageSequenceDialog (_splitter);
@@ -517,7 +516,7 @@ ContentPanel::remove_clicked (bool hotkey)
                return true;
        }
 
-       BOOST_FOREACH (shared_ptr<Content> 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<Content> 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<boost::filesystem::path> paths)
        /* XXX: check for lots of files here and do something */
 
        try {
-               BOOST_FOREACH (boost::filesystem::path i, paths) {
-                       BOOST_FOREACH (shared_ptr<Content> j, content_factory(i)) {
+               for (auto i: paths) {
+                       for (auto j: content_factory(i)) {
                                _film->examine_and_add_content (j);
                        }
                }
index bf1f67ace40c5b8fc0649b06a8fe52ea1b74dc3f..2e0e360d98cbbc8016a2487067a1fe3a29d671b2 100644 (file)
@@ -25,7 +25,6 @@
 #include "lib/video_content.h"
 #include "lib/audio_content.h"
 #include <boost/algorithm/string.hpp>
-#include <boost/foreach.hpp>
 
 using std::string;
 using std::list;
@@ -38,7 +37,7 @@ ContentPropertiesDialog::ContentPropertiesDialog (wxWindow* parent, shared_ptr<c
        : TableDialog (parent, _("Content Properties"), 2, 1, false)
 {
        map<UserProperty::Category, list<UserProperty> > 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<UserProperty> ();
                }
@@ -91,7 +90,7 @@ ContentPropertiesDialog::maybe_add_group (map<UserProperty::Category, list<UserP
        add (m, false);
        add_spacer ();
 
-       BOOST_FOREACH (UserProperty j, i->second) {
+       for (auto j: i->second) {
                add (std_to_wx (j.key), true);
                add (new StaticText (this, std_to_wx (j.value + " " + j.unit)));
        }
index b4ba5517562588f2282b2b8d7c244fff63e26d45..e0a1a52bddac98382118852cc029b0c9c005c769 100644 (file)
@@ -25,7 +25,6 @@
 #include "lib/compose.hpp"
 #include "lib/log.h"
 #include <wx/notebook.h>
-#include <boost/foreach.hpp>
 
 using std::list;
 using std::string;
index 67a9a3fa53c90b4faa1395ef5200c1701bdba14f..44e575d9393bcc06a349d88901c1cb5b20021a10 100644 (file)
@@ -106,7 +106,7 @@ ContentView::update ()
        while (jm->work_to_do()) {
                if (!progress.Pulse()) {
                        /* user pressed cancel */
-                       BOOST_FOREACH (shared_ptr<Job> 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<ExamineContentJob> 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> content)
 shared_ptr<Content>
 ContentView::get (string digest) const
 {
-       BOOST_FOREACH (shared_ptr<Content> i, _content) {
+       for (auto i: _content) {
                if (i->digest() == digest) {
                        return i;
                }
index 972b30baca63c5088eb5f526f4913a04a1111952..5d941301bcb75865b8c2b545aa5bd46d20d22d4c 100644 (file)
@@ -47,7 +47,6 @@
 #include <wx/gbsizer.h>
 #include <wx/spinctrl.h>
 #include <boost/lexical_cast.hpp>
-#include <boost/foreach.hpp>
 #include <iostream>
 
 using std::cout;
@@ -137,7 +136,7 @@ DCPPanel::DCPPanel (wxNotebook* n, shared_ptr<Film> film, weak_ptr<FilmViewer> 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<string> (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();
index fe97cf642bafc7949fefa9510c7d3c5d6bc5de66..c46fed7600243a235665530c481758d86f9436be 100644 (file)
@@ -91,7 +91,7 @@ DKDMDialog::DKDMDialog (wxWindow* parent, shared_ptr<const Film> film)
        right->Add (h);
 
        vector<CPLSummary> 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<KDMWithMetadataPtr> kdms;
        try {
-               BOOST_FOREACH (shared_ptr<DKDMRecipient> 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);
index 762ed7b7e71e07aef8d7019bbddd110cefe92cba..964662f0e7647766038cbd02e914ca53975813b1 100644 (file)
@@ -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<string> 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);
                                }
                        }
index e30ef30a4396bac5ae01b9a8f42b49588968a7ca..6eaa1d3aea41e833f652d5c96de671f84d34cd28 100644 (file)
@@ -28,7 +28,6 @@
 #include <dcp/raw_convert.h>
 #include <curl/curl.h>
 #include <zip.h>
-#include <boost/foreach.hpp>
 #include <iostream>
 
 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";
                }
 
index ec9f6dade09bf3c8f6d280dad46d5d6fbe92e364..627223c460d77d10c8b5d086645119db47efd343 100644 (file)
@@ -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);
        }
 
index 7902d0b79b319c4660b4abb10d20b3e448b6a35c..f90d219f81a9a0f7defc398f287efa478edd2ab8 100644 (file)
@@ -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);
                        }
index ce91c3cc49565a06e288c27dfca0f3f13c891983..bb40dad9f3693eccf70a944bdcaba8dfc4d87853 100644 (file)
@@ -32,7 +32,6 @@
 #include "lib/dcp_content.h"
 #include <wx/wx.h>
 #include <wx/notebook.h>
-#include <boost/foreach.hpp>
 #include <iostream>
 
 using std::cout;
index 2c9b165d00db2671a046b26151b044a219c86b5c..2ef6c9955714e474f1e3a40e116a63d4371d811f 100644 (file)
@@ -28,7 +28,6 @@
 #include "lib/compose.hpp"
 #include <wx/stdpaths.h>
 #include <boost/filesystem.hpp>
-#include <boost/foreach.hpp>
 
 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));
                }
 
index cc25ccdd5fbbd152f74d9ff6fecf087bcbb2a08f..6e5b486d59ac59d75d60076835c469f3dee03dbd 100644 (file)
@@ -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;
         }
 
index 6f479e5466c68f58783104a73ee4a529693e41f1..a65f5153a2f95e9733619123997bc2d1180285bc 100644 (file)
@@ -28,7 +28,6 @@
 #include "wx_util.h"
 #include "lib/film.h"
 #include "lib/filter.h"
-#include <boost/foreach.hpp>
 
 
 using namespace std;
@@ -46,7 +45,7 @@ FilterDialog::FilterDialog (wxWindow* parent, vector<Filter const *> const & act
        typedef map<string, list<Filter const *> > 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<Filter const *> c;
@@ -65,7 +64,7 @@ FilterDialog::FilterDialog (wxWindow* parent, vector<Filter const *> 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);
index 8ff6cf13e66765f143a607fd160153b4f7c8c383..29af6a739d4487e24c49efefd5383c17c462e9b1 100644 (file)
@@ -26,7 +26,6 @@
 #include "lib/content.h"
 #include "lib/text_content.h"
 #include <wx/wx.h>
-#include <boost/foreach.hpp>
 #include <iostream>
 
 using std::list;
@@ -92,7 +91,7 @@ FontsDialog::setup ()
 
        _fonts->DeleteAllItems ();
        size_t n = 0;
-       BOOST_FOREACH (shared_ptr<Font> 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> font;
-       BOOST_FOREACH (shared_ptr<Font> i, caption->fonts()) {
+       for (auto i: caption->fonts()) {
                if (i->id() == id) {
                        font = i;
                }
index f376d96820661d5246526821fe0fe2d46bd32ed0..ea84136e1fa00ee6fc21abcc5594b2b84212d3b7 100644 (file)
@@ -57,7 +57,6 @@
 #include <wx/filepicker.h>
 #include <RtAudio.h>
 #include <boost/filesystem.hpp>
-#include <boost/foreach.hpp>
 #include <iostream>
 
 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 ()));
                }
 
index 701856610a88145dd0b89a0ba982347a1ddcef48..9c8b87dac42bd622df15700be21a9551ca8a567c 100644 (file)
@@ -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()));
        }
 
index 78aa237e1f6ff6a4482421412a560091d3dc505f..2c6bac14a0ae0013525eda7c25187176c0c90bd0 100644 (file)
@@ -29,7 +29,6 @@
 DCPOMATIC_DISABLE_WARNINGS
 #include <wx/richtext/richtextctrl.h>
 DCPOMATIC_ENABLE_WARNINGS
-#include <boost/foreach.hpp>
 
 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 ();
                }
index 3c0f44675286a8c556af51099c60f2beb95841ec..6b341307d9e2fee6c8d928c9439569b2ec6f3e55 100644 (file)
@@ -31,7 +31,6 @@
 #include "lib/util.h"
 #include "lib/exceptions.h"
 #include "lib/compose.hpp"
-#include <boost/foreach.hpp>
 #include <iostream>
 
 using std::string;
@@ -109,9 +108,9 @@ JobManagerView::replace ()
 
        list<shared_ptr<JobView> > new_job_records;
 
-       BOOST_FOREACH (shared_ptr<Job> i, JobManager::instance()->get()) {
+       for (auto i: JobManager::instance()->get()) {
                /* Find this job's JobView */
-               BOOST_FOREACH (shared_ptr<JobView> 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<JobView> i, _job_records) {
+       for (auto i: _job_records) {
                i->detach ();
        }
 
        _job_records = new_job_records;
 
-       BOOST_FOREACH (shared_ptr<JobView> 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<JobView> i, _job_records) {
+       for (auto i: _job_records) {
                i->job_list_changed ();
        }
 }
index 88c73ed1174e63ab59a4dadb757ec061cfbdb8d1..be5e42dd8b9458a490b967027928c9982ffd5d6d 100644 (file)
@@ -27,7 +27,6 @@ DCPOMATIC_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
 DCPOMATIC_ENABLE_WARNINGS
 #include <libcxml/cxml.h>
-#include <boost/foreach.hpp>
 
 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;
                                                }
index 666701168ffa55beae283b701d252c9e838f97b8..601562b275f7d072cfd827be1d8a14c064b0cd02 100644 (file)
@@ -92,7 +92,7 @@ KDMDialog::KDMDialog (wxWindow* parent, shared_ptr<const Film> film)
        right->Add (h);
 
        vector<CPLSummary> 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<dcpomatic::Screen> 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);
index c08a767320635ca8360f6be97ecf3d84b0a50f6f..b002a765c18d82b8b675302c785598ac80ded1ed 100644 (file)
@@ -209,7 +209,7 @@ KDMOutputPanel::make (
                }
 
                bool cinemas_with_no_email = false;
-               BOOST_FOREACH (list<KDMWithMetadataPtr> 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<string> emails;
-                       BOOST_FOREACH (list<KDMWithMetadataPtr> 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);
                                }
                        }
index 2d2fc81f665a578d97fa2f275a38186a01e885b7..d9add6dcae38b4ff942a673f26444997a085f625 100644 (file)
@@ -27,7 +27,6 @@
 #include <wx/wx.h>
 #include <boost/algorithm/string.hpp>
 #include <boost/bind/bind.hpp>
-#include <boost/foreach.hpp>
 #include <boost/optional.hpp>
 #include <boost/signals2.hpp>
 #include <iostream>
@@ -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<dcp::LanguageTag::VariantSubtag> variants;
        vector<dcp::LanguageTag::ExtlangSubtag> 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);
index b4b6e3ae3b08d34d98288b1d73f20812b4b76d9c..542655477381eed773be38cd6440a3f08ee8df1b 100644 (file)
@@ -21,7 +21,6 @@
 #include "move_to_dialog.h"
 #include "lib/film.h"
 #include <wx/spinctrl.h>
-#include <boost/foreach.hpp>
 
 using std::list;
 using std::shared_ptr;
@@ -41,7 +40,7 @@ MoveToDialog::MoveToDialog (wxWindow* parent, optional<DCPTime> 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);
                        }
index 5b989bdb55d4aba2b7a995dbdfc4b110db8fcd92..466b80b6bb0baf77b5948dcc26dd10e22cf0a1c8 100644 (file)
@@ -22,7 +22,6 @@
 #include "wx_util.h"
 #include "static_text.h"
 #include "check_box.h"
-#include <boost/foreach.hpp>
 
 using std::shared_ptr;
 #if BOOST_VERSION >= 106100
index 32c78ea252ba8f5a668235ae4db6b6696cb8d1d9..e3728615fcf818e14bce5c92336c99a1addaca63 100644 (file)
@@ -27,7 +27,6 @@
 DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
 DCPOMATIC_ENABLE_WARNINGS
-#include <boost/foreach.hpp>
 #include <boost/signals2.hpp>
 
 class NameFormatEditor
index 3158b279cf4c600d0827dee923e80f4f45966976..06a1ef56b2735da97401fc43f261a6e50a3127b4 100644 (file)
@@ -54,7 +54,6 @@
 #include <wx/filepicker.h>
 #include <RtAudio.h>
 #include <boost/filesystem.hpp>
-#include <boost/foreach.hpp>
 #include <iostream>
 
 using std::vector;
index dfe2d181eb4e3e54803c2ecaf1617bb208e9c28c..6dd2dd67473451f5bdcbb45f1f2fd03c0ea4a076 100644 (file)
@@ -24,7 +24,6 @@
 #include <dcp/util.h>
 #include <wx/wx.h>
 #include <boost/algorithm/string.hpp>
-#include <boost/foreach.hpp>
 #include <boost/bind/bind.hpp>
 #include <string>
 #include <vector>
@@ -99,7 +98,7 @@ PlayerStressTester::load_script (boost::filesystem::path file)
        vector<string> 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();
index 56ff5f40d1ce7235abd83083dea1b8c3f38311f4..d65cb0fccaf2999574405a86c73017823916cba3 100644 (file)
@@ -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<DCPContent> dcp = dynamic_pointer_cast<DCPContent> (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);
index 70fe0ae4777a84ba5ceaed4bbd43c3737d876e7e..c67cc46f28803ed66c14529b68189b38ec0455ba 100644 (file)
@@ -53,7 +53,7 @@ QubeCertificatePanel::do_download ()
 
        string const serial = wx_to_std(_serial->GetValue());
        optional<string> 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;
index 086eac3e4482cb8b7aa048a7aeaf337538192aa6..e59293fe782a92e634a98ad7af92317e9652e717 100644 (file)
@@ -23,7 +23,6 @@
 #include "recipient_dialog.h"
 #include "dcpomatic_button.h"
 #include "lib/config.h"
-#include <boost/foreach.hpp>
 #include <list>
 #include <iostream>
 
@@ -225,7 +224,7 @@ RecipientsPanel::add_recipients ()
 {
        _root = _targets->AddRoot ("Foo");
 
-       BOOST_FOREACH (shared_ptr<DKDMRecipient> i, Config::instance()->dkdm_recipients()) {
+       for (auto i: Config::instance()->dkdm_recipients()) {
                add_recipient (i);
        }
 }
index 322d5964ce729049858c944189d4a145380aa6df..92e71af3497f1c05645e5a00144f7daed466cc7f 100644 (file)
@@ -23,7 +23,6 @@
 #include "static_text.h"
 #include "check_box.h"
 #include "lib/config.h"
-#include <boost/foreach.hpp>
 
 using std::list;
 using std::string;
index d1f60b8d1c216da414188fe2c9fe656b353e379e..6a6644efee2d6e9ade1e4e1deba788edd104f2fd 100644 (file)
@@ -21,7 +21,6 @@
 #include "save_template_dialog.h"
 #include "wx_util.h"
 #include "lib/config.h"
-#include <boost/foreach.hpp>
 
 using std::string;
 #if BOOST_VERSION >= 106100
index ee88d01789d299602d10f9a1177867506cf9ed0d..02b51f860ee290d5563b7269f525fe2a1b62c1ab 100644 (file)
@@ -26,7 +26,6 @@
 #include "lib/config.h"
 #include "lib/cinema.h"
 #include "lib/screen.h"
-#include <boost/foreach.hpp>
 
 using std::list;
 using std::pair;
@@ -134,7 +133,7 @@ ScreensPanel::add_cinema (shared_ptr<Cinema> c)
 
        _cinemas[id] = c;
 
-       BOOST_FOREACH (shared_ptr<Screen> 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<Screen> 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<Cinema> c = s.second->cinema;
-       BOOST_FOREACH (shared_ptr<Screen> 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<Cinema> i, Config::instance()->cinemas ()) {
+       for (auto i: Config::instance()->cinemas()) {
                add_cinema (i);
        }
 }
index 37a14338431f3f44dea91f44314aa2ef55d2edf6..d904a2ef08d394e54c3c8647feec83a740d29aaa 100644 (file)
@@ -23,7 +23,6 @@
 #include "lib/encode_server_finder.h"
 #include "lib/encode_server_description.h"
 #include <boost/lexical_cast.hpp>
-#include <boost/foreach.hpp>
 
 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);
index 9b1b64c8504e260ff84dd5b718a3f4c5da8aa283..6cd78326a3f8ed5c3ab9cf4d38764276262b2b2b 100644 (file)
@@ -19,7 +19,6 @@
 */
 
 #include "suspender.h"
-#include <boost/foreach.hpp>
 
 Suspender::Suspender(boost::function<void (int)> 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 ();
index 167f7f75d58729e91fb48e3e19b03572313c6941..6a98ecec63f12b1d3c627f8e31dcf3582c84d1d7 100644 (file)
@@ -22,7 +22,6 @@
 #include "wx_util.h"
 #include <wx/listctrl.h>
 #include <boost/filesystem.hpp>
-#include <boost/foreach.hpp>
 #include <iostream>
 
 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 ()));
        }
 
index 53eb2e4220ab804d4a51b0e3958d6c3af776de39..e8f9b8a2b22516160f3400222b762fe601f6d62f 100644 (file)
@@ -24,7 +24,6 @@
 #include "dcpomatic_button.h"
 #include "lib/config.h"
 #include <wx/wx.h>
-#include <boost/foreach.hpp>
 
 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);
index 5b54fa35b8e1acd75944b17e486c71e70e179a0a..521e55fc50f4e9c604d851322e4de34a7590f237 100644 (file)
@@ -43,7 +43,6 @@
 #include "lib/analyse_subtitles_job.h"
 #include "lib/subtitle_analysis.h"
 #include <wx/spinctrl.h>
-#include <boost/foreach.hpp>
 
 using std::vector;
 using std::string;
@@ -279,7 +278,7 @@ TextPanel::update_dcp_track_selection ()
 
        optional<DCPTextTrack> selected;
        bool many = false;
-       BOOST_FOREACH (shared_ptr<Content> i, _parent->selected_text()) {
+       for (auto i: _parent->selected_text()) {
                shared_ptr<TextContent> t = i->text_of_original_type(_original_type);
                if (t) {
                        optional<DCPTextTrack> 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<Content> i, _parent->selected_text()) {
+               for (auto i: _parent->selected_text()) {
                        shared_ptr<TextContent> 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<Content> 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<Content> 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<Content> 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<Content> i, sel) {
+       for (auto i: sel) {
                /* These are the content types that could include subtitles */
                shared_ptr<const FFmpegContent> fc = std::dynamic_pointer_cast<const FFmpegContent> (i);
                shared_ptr<const StringTextFileContent> sc = std::dynamic_pointer_cast<const StringTextFileContent> (i);
@@ -616,7 +615,7 @@ TextPanel::stream_changed ()
 void
 TextPanel::x_offset_changed ()
 {
-       BOOST_FOREACH (shared_ptr<Content> 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<Content> 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<Content> 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<Content> 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<Job> i, JobManager::instance()->get()) {
+               for (auto i: JobManager::instance()->get()) {
                        if (dynamic_pointer_cast<AnalyseSubtitlesJob>(i)) {
                                i->cancel ();
                        }
index b4b2baae211503c8792d56b44f3ae799e8eefcda..3b674b5c17eb04562932ca23e54d2668cc144b89 100644 (file)
@@ -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<TextDecoder> 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);
index 054eac734f5afdc00f465b5826f344ea7f6d77a8..e5182a0a4018139076f4e01b3e3e6fcea5209d93 100644 (file)
@@ -39,7 +39,6 @@
 #include "lib/video_content.h"
 #include "lib/atmos_mxf_content.h"
 #include <wx/graphics.h>
-#include <boost/foreach.hpp>
 #include <list>
 #include <iterator>
 #include <iostream>
@@ -174,13 +173,13 @@ Timeline::paint_main ()
 
        gc->SetAntialiasMode (wxANTIALIAS_DEFAULT);
 
-       BOOST_FOREACH (shared_ptr<TimelineView> i, _views) {
+       for (auto i: _views) {
 
                shared_ptr<TimelineContentView> ic = dynamic_pointer_cast<TimelineContentView> (i);
 
                /* Find areas of overlap with other content views, so that we can plot them */
                list<dcpomatic::Rect<int> > overlaps;
-               BOOST_FOREACH (shared_ptr<TimelineView> j, _views) {
+               for (auto j: _views) {
                        shared_ptr<TimelineContentView> jc = dynamic_pointer_cast<TimelineContentView> (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<Content> i, film->content ()) {
+       for (auto i: film->content ()) {
                if (i->video) {
                        _views.push_back (shared_ptr<TimelineView> (new TimelineVideoContentView (*this, i)));
                }
@@ -260,7 +259,7 @@ Timeline::recreate_views ()
                        _views.push_back (shared_ptr<TimelineView> (new TimelineAudioContentView (*this, i)));
                }
 
-               BOOST_FOREACH (shared_ptr<TextContent> j, i->text) {
+               for (auto j: i->text) {
                        _views.push_back (shared_ptr<TimelineView> (new TimelineTextContentView (*this, i, j)));
                }
 
@@ -299,7 +298,7 @@ place (shared_ptr<const Film> film, TimelineViewList& views, int& tracks)
 {
        int const base = tracks;
 
-       BOOST_FOREACH (shared_ptr<TimelineView> i, views) {
+       for (auto i: views) {
                if (!dynamic_pointer_cast<T>(i)) {
                        continue;
                }
@@ -396,7 +395,7 @@ Timeline::assign_tracks ()
        /* Video */
 
        bool have_3d = false;
-       BOOST_FOREACH (shared_ptr<TimelineView> i, _views) {
+       for (auto i: _views) {
                shared_ptr<TimelineVideoContentView> cv = dynamic_pointer_cast<TimelineVideoContentView> (i);
                if (!cv) {
                        continue;
@@ -421,7 +420,7 @@ Timeline::assign_tracks ()
        /* Atmos */
 
        bool have_atmos = false;
-       BOOST_FOREACH (shared_ptr<TimelineView> i, _views) {
+       for (auto i: _views) {
                shared_ptr<TimelineAtmosContentView> cv = dynamic_pointer_cast<TimelineAtmosContentView>(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);
                }
 
index d26c4025256934650ded8ef3dd2028ae27972ee6..03481343c6bfb097ec4b284554d0b7d72261cb4f 100644 (file)
@@ -71,7 +71,7 @@ TimelineAudioContentView::label () const
        list<int> 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);
index 2f2b7e3ed3bf907d9a8433c6709112c52dedd4e4..8258a81f97a5bfd6dd37e8485a3a5b2cef29ba71 100644 (file)
@@ -23,7 +23,6 @@
 #include "wx_util.h"
 #include "lib/content.h"
 #include <wx/graphics.h>
-#include <boost/foreach.hpp>
 
 using std::list;
 using std::shared_ptr;
@@ -131,7 +130,7 @@ TimelineContentView::do_paint (wxGraphicsContext* gc, list<dcpomatic::Rect<int>
 
        /* 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);
index fa89c60a7c82fdf7cda862d87856a83ad8b87b3c..962451ac367b228e2d63ac9062afc430c45d7dce 100644 (file)
@@ -22,7 +22,6 @@
 #include "timeline.h"
 #include <wx/wx.h>
 #include <wx/graphics.h>
-#include <boost/foreach.hpp>
 
 using std::min;
 using std::list;
@@ -67,7 +66,7 @@ TimelineReelsView::do_paint (wxGraphicsContext* gc, list<dcpomatic::Rect<int> >)
        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 ();
index 82aaadedde7047052d64ef62afcae0b384432ee0..ecf55640dc3f7cd5655ea482cfe639c4920293c1 100644 (file)
@@ -43,7 +43,6 @@ DCPOMATIC_DISABLE_WARNINGS
 #include <gtk/gtk.h>
 DCPOMATIC_ENABLE_WARNINGS
 #endif
-#include <boost/foreach.hpp>
 #include <set>
 #include <iostream>
 
@@ -179,7 +178,7 @@ void
 TimingPanel::update_full_length ()
 {
        set<DCPTime> check;
-       BOOST_FOREACH (shared_ptr<const Content> 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<DCPTime> check;
-       BOOST_FOREACH (shared_ptr<const Content> 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<DCPTime> check;
-               BOOST_FOREACH (shared_ptr<const Content> 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<ContentTime> check;
-               BOOST_FOREACH (shared_ptr<const Content> 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<ContentTime> check;
-               BOOST_FOREACH (shared_ptr<const Content> 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<const Content> content;
                int count_ac = 0;
                int count_sc = 0;
-               BOOST_FOREACH (shared_ptr<const Content> 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<const Content> i, _parent->selected ()) {
+       for (auto i: _parent->selected()) {
                shared_ptr<const ImageContent> ic = dynamic_pointer_cast<const ImageContent> (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<Content> 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<Content> i, _parent->selected ()) {
+       for (auto i: _parent->selected()) {
                shared_ptr<ImageContent> ic = dynamic_pointer_cast<ImageContent> (i);
                if (ic && ic->still ()) {
                        ic->video->set_length (len);
@@ -351,7 +350,7 @@ TimingPanel::trim_start_changed ()
        optional<DCPTime> ref_ph;
 
        Suspender::Block bl = _film_content_changed_suspender.block ();
-       BOOST_FOREACH (shared_ptr<Content> 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<Content> 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<Content> 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<Content> 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<const Film> film = _parent->film ();
        DCPTime const ph = fv->position().floor (film->video_frame_rate ());
-       BOOST_FOREACH (shared_ptr<Content> 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<const Content> 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<DCPTime> position;
-       BOOST_FOREACH (shared_ptr<Content> 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<Content> i, _parent->selected()) {
+               for (auto i: _parent->selected()) {
                        i->set_position (_parent->film(), d->position());
                }
        }
index bf78113d9f5519e96263a5f7397d2f39357bde0a..55360dc39353f8cfe61cc3ff62178b6aaf390cdc 100644 (file)
@@ -26,7 +26,6 @@
 DCPOMATIC_DISABLE_WARNINGS
 #include <wx/richtext/richtextctrl.h>
 DCPOMATIC_ENABLE_WARNINGS
-#include <boost/foreach.hpp>
 
 using std::list;
 using std::shared_ptr;
@@ -63,7 +62,7 @@ VerifyDCPDialog::VerifyDCPDialog (wxWindow* parent, shared_ptr<VerifyDCPJob> 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);
index 5fcd527b8ba6daf8efdf70d1b6b4f73c2817030a..81f78b9c005f177122b11122ca22fe1ad58afbf3 100644 (file)
@@ -39,7 +39,6 @@
 #include "lib/video_content.h"
 #include <wx/spinctrl.h>
 #include <wx/tglbtn.h>
-#include <boost/foreach.hpp>
 #include <boost/unordered_set.hpp>
 #include <boost/functional/hash.hpp>
 #include <set>
@@ -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<optional<ColourConversion> > check;
-               BOOST_FOREACH (shared_ptr<const Content> 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<Frame> check;
-               BOOST_FOREACH (shared_ptr<const Content> 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<Frame> check;
-               BOOST_FOREACH (shared_ptr<const Content> 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<Frame> check;
-               BOOST_FOREACH (shared_ptr<const Content> 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<Content> 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<Content> 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<Content> 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<Content> 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<Content> 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<Content> i, _parent->selected_video()) {
+       for (auto i: _parent->selected_video()) {
                i->video->set_custom_ratio (optional<float>());
        }
 }
@@ -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<Content> 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<Content> 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<Content> 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<Content> 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<Content> i, _parent->selected_video()) {
+               for (auto i: _parent->selected_video()) {
                        i->video->set_top_crop (i->video->bottom_crop());
                }
        }
index 5d02d27bf80ffd6a9e64e1ffcfd0cae82de44b0e..3386b2700c522c7047c4bb0e0c738473cf1b6303 100644 (file)
@@ -522,7 +522,7 @@ display_progress (wxString title, wxString task)
                dcpomatic_sleep_seconds (1);
                if (!progress.Pulse()) {
                        /* user pressed cancel */
-                       BOOST_FOREACH (shared_ptr<Job> i, jm->get()) {
+                       for (auto i: jm->get()) {
                                i->cancel();
                        }
                        ok = false;
index f277edd9ad743f023e3ededadb5555c6807ff93d..28545b3f0c30a60fed4ae8ceaa3a231e68a61833 100644 (file)
@@ -28,7 +28,6 @@
 #include <dcp/gamma_transfer_function.h>
 #include <libxml++/libxml++.h>
 #include <boost/test/unit_test.hpp>
-#include <boost/foreach.hpp>
 #include <iostream>
 
 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);
index a3ef673fea82e35d694e9393f5f946cfeeb8bac1..025d33c6aae04d07c8f6159da2996dc28e206fe0 100644 (file)
@@ -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<cxml::NodePtr> 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") != "");
                }
index 684a67cf5983be5bd4314fb2efa84754a057bba0..e43ea76e8c5693a7957d37480cac0960cd78e423 100644 (file)
@@ -303,7 +303,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test6)
        shared_ptr<Content> subs = content_factory("test/data/subrip.srt").front();
        film2->examine_and_add_content (subs);
        BOOST_REQUIRE (!wait_for_jobs());
-       BOOST_FOREACH (shared_ptr<TextContent> i, subs->text) {
+       for (auto i: subs->text) {
                i->set_use (true);
        }
 
index bd329eeee685247402d04efb8731a91d698a5298..85a0b60f62d05ab4f96a8bb7ef32790a589564bc 100644 (file)
@@ -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<KDMWithMetadataPtr> kdms;
-       BOOST_FOREACH (shared_ptr<dcpomatic::Screen> i, screens) {
+       for (auto i: screens) {
                KDMWithMetadataPtr kdm = kdm_for_screen (
                                film,
                                cpls.front().cpl_file,
index b609052b96863b9d239371fb00ca123d01fd7fda..c7b33d39417a81b3c03e85abf701ea54e918d5fb 100644 (file)
@@ -34,7 +34,6 @@
 #include "lib/content_factory.h"
 #include "test.h"
 #include <boost/test/unit_test.hpp>
-#include <boost/foreach.hpp>
 #include <iostream>
 
 using std::list;
@@ -496,7 +495,7 @@ no_op ()
 static void
 dump_notes (list<dcp::VerificationNote> const & notes)
 {
-       BOOST_FOREACH (dcp::VerificationNote i, notes) {
+       for (auto i: notes) {
                std::cout << dcp::note_to_string(i) << "\n";
        }
 }
index e5f1667ef7ea8f6064738b822a39feb437b357e4..d8c596c9468d2fc825be0573ed675e9a11fe2ba6 100644 (file)
@@ -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<dcp::Reel> i, cpl->reels()) {
+       for (auto i: cpl->reels()) {
                if (i->main_subtitle()) {
                        shared_ptr<dcp::InteropSubtitleAsset> ass = dynamic_pointer_cast<dcp::InteropSubtitleAsset>(i->main_subtitle()->asset());
                        BOOST_REQUIRE (ass);
index 6e55ee62f6931b4d6c471465989c09bfb6b1bf93..2eee36ffa3b463fa1899ce519fb3f41e435fc2d8 100644 (file)
@@ -31,7 +31,6 @@
 #include <dcp/interop_subtitle_asset.h>
 #include <dcp/reel_closed_caption_asset.h>
 #include <dcp/reel_subtitle_asset.h>
-#include <boost/foreach.hpp>
 #include <boost/test/unit_test.hpp>
 
 
@@ -125,7 +124,7 @@ BOOST_AUTO_TEST_CASE (subtitle_in_all_reels_test)
        shared_ptr<dcp::CPL> cpl = dcp.cpls().front();
        BOOST_REQUIRE_EQUAL (cpl->reels().size(), 3U);
 
-       BOOST_FOREACH (shared_ptr<dcp::Reel> 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<dcp::CPL> cpl = dcp.cpls().front();
        BOOST_REQUIRE_EQUAL (cpl->reels().size(), 3U);
 
-       BOOST_FOREACH (shared_ptr<dcp::Reel> i, cpl->reels()) {
+       for (auto i: cpl->reels()) {
                BOOST_REQUIRE_EQUAL (i->closed_captions().size(), 2U);
                optional<string> first = i->closed_captions().front()->language();
                optional<string> second = i->closed_captions().back()->language();
index e6a91a91060439d705e14785bb009b1be4a7f401..b12eb328d661230e412cb8afefc94700d20d56af 100644 (file)
@@ -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<Job> 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<Job> failed;
-       BOOST_FOREACH (shared_ptr<Job> i, jm->_jobs) {
+       for (auto i: jm->_jobs) {
                if (i->finished_in_error()) {
                        BOOST_REQUIRE (!failed);
                        failed = i;
index 9fc02412a62d3e5ba97c50ea498797bb532cb501..aff9bdae91072aafb7b0b4ff78feb721b603ff7c 100644 (file)
@@ -37,7 +37,6 @@
 #include <dcp/reel_picture_asset.h>
 #include <dcp/reel_sound_asset.h>
 #include <boost/test/unit_test.hpp>
-#include <boost/foreach.hpp>
 #include <iostream>
 
 using std::list;