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)) {
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);
}
_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));
}
#include <libavfilter/f_ebur128.h>
#endif
}
-#include <boost/foreach.hpp>
#include <iostream>
#include "i18n.h"
AnalyseAudioJob::~AnalyseAudioJob ()
{
stop_thread ();
- BOOST_FOREACH (Filter const * i, _filters) {
+ for (auto i: _filters) {
delete const_cast<Filter*> (i);
}
delete[] _current;
_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;
}
return;
}
- BOOST_FOREACH (BitmapText const& i, text.bitmap) {
+ for (auto const& i: text.bitmap) {
if (!_bounding_box) {
_bounding_box = i.rectangle;
} else {
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
#include <libxml++/libxml++.h>
DCPOMATIC_ENABLE_WARNINGS
#include <boost/filesystem.hpp>
-#include <boost/foreach.hpp>
#include <stdint.h>
#include <cmath>
#include <cstdio>
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"))
);
}
- 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 ()));
}
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"));
}
}
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));
}
{
optional<float> p;
- BOOST_FOREACH (float i, _true_peak) {
+ for (auto i: _true_peak) {
if (!p || i > *p) {
p = i;
}
#include <dcp/raw_convert.h>
#include <libcxml/cxml.h>
#include <libxml++/libxml++.h>
-#include <boost/foreach.hpp>
#include <iostream>
#include "i18n.h"
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());
}
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) {
AudioContent::mapping () const
{
int channels = 0;
- BOOST_FOREACH (AudioStreamPtr i, streams ()) {
+ for (auto i: streams()) {
channels += i->channels ();
}
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) {
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 {
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++));
}
#include "log.h"
#include "resampler.h"
#include "compose.hpp"
-#include <boost/foreach.hpp>
#include <iostream>
#include "i18n.h"
, _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;
}
}
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 ();
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);
}
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);
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));
}
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) {
#include "audio_ring_buffers.h"
#include "dcpomatic_assert.h"
#include "exceptions.h"
-#include <boost/foreach.hpp>
#include <iostream>
using std::min;
#include "case_insensitive_sorter.h"
#include <boost/filesystem.hpp>
-#include <boost/foreach.hpp>
#include <iostream>
using std::string;
#include "examine_content_job.h"
#include "content.h"
#include "film.h"
-#include <boost/foreach.hpp>
#include <iostream>
#include "i18n.h"
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)) {
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.");
#include <libcxml/cxml.h>
#include <dcp/raw_convert.h>
#include <libxml++/libxml++.h>
-#include <boost/foreach.hpp>
#include <iostream>
using std::list;
: 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 ());
}
{
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);
}
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"));
}
}
DCPOMATIC_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
DCPOMATIC_ENABLE_WARNINGS
-#include <boost/foreach.hpp>
#include <iostream>
#include "i18n.h"
PresetColourConversion
PresetColourConversion::from_id (string s)
{
- BOOST_FOREACH (PresetColourConversion const& i, _presets) {
+ for (auto const& i: _presets) {
if (i.id == s) {
return i;
}
#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>
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 {
_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 ());
}
_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 ());
}
_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 ());
}
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"));
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"));
/* 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());
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;
}
} 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));
}
}
_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());
/* [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.
*/
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);
}
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);
}
*/
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 ());
/* [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 ());
/* [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 ());
}
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));
}
{
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);
{
_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.
*/
{
_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)));
}
}
: _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) {
_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));
}
}
bool
Content::paths_valid () const
{
- BOOST_FOREACH (boost::filesystem::path i, _paths) {
+ for (auto i: _paths) {
if (!boost::filesystem::exists (i)) {
return false;
}
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));
}
}
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;
}
#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
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");
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));
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()) {
#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>
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) {
#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>
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;
}
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));
/* 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;
}
/* 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()) {
}
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));
#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>
#include <dcp/dcp.h>
#include <dcp/decrypted_kdm.h>
#include <dcp/exceptions.h>
-#include <boost/foreach.hpp>
#include "i18n.h"
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 (¬es, true);
if (!_tolerant) {
/** We accept and ignore EMPTY_ASSET_PATH and EXTERNAL_ASSET but everything else is bad */
- BOOST_FOREACH (dcp::VerificationNote j, notes) {
+ for (auto j: notes) {
if (j.code() == dcp::VerificationNote::EMPTY_ASSET_PATH || j.code() == dcp::VerificationNote::EXTERNAL_ASSET) {
LOG_WARNING("Empty path in ASSETMAP of %1", i.string());
} else {
}
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));
}
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);
}
}
#include <dcp/reel_subtitle_asset.h>
#include <dcp/reel.h>
#include <libxml++/libxml++.h>
-#include <boost/foreach.hpp>
#include <iterator>
#include <iostream>
_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());
}
}
audio->stream()->mapping().as_xml (node->add_child("AudioMapping"));
}
- BOOST_FOREACH (shared_ptr<TextContent> i, text) {
+ for (auto i: text) {
i->as_xml (node);
}
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));
}
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);
}
}
s += video->identifier() + "_";
}
- BOOST_FOREACH (shared_ptr<TextContent> i, text) {
+ for (auto i: text) {
s += i->identifier () + " ";
}
/* 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()) {
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;
/* 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'.");
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.");
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: "
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.");
#include "dcp_content_type.h"
#include "dcpomatic_assert.h"
-#include <boost/foreach.hpp>
#include "i18n.h"
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;
}
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;
}
#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"
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())));
}
}
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;
}
++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
);
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())) {
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()) {
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) {
#include "text_content.h"
#include "player_video.h"
#include <boost/signals2.hpp>
-#include <boost/foreach.hpp>
#include <iostream>
#include "i18n.h"
_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;
}
while (!_player->pass ()) {}
- BOOST_FOREACH (ReferencedReelAsset i, _player->get_reel_assets ()) {
+ for (auto i: _player->get_reel_assets()) {
_writer->write (i);
}
#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"
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;
}
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;
}
_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()) {
_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;
/* 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);
_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);
}
#include <dcp/smpte_subtitle_asset.h>
#include <dcp/interop_load_font_node.h>
#include <libxml++/libxml++.h>
-#include <boost/foreach.hpp>
#include "i18n.h"
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)));
}
}
}
/* 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())));
}
#include "frame_rate_change.h"
#include "dcpomatic_assert.h"
#include <boost/optional.hpp>
-#include <boost/foreach.hpp>
#include <stdint.h>
#include <cmath>
#include <ostream>
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) {
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);
}
if (audio) {
audio->seek ();
}
- BOOST_FOREACH (shared_ptr<TextDecoder> i, text) {
+ for (auto i: text) {
i->seek ();
}
}
#include "video_mxf_content.h"
#include "video_mxf_decoder.h"
#include "timer.h"
-#include <boost/foreach.hpp>
using std::list;
using std::shared_ptr;
#include "kdm_with_metadata.h"
#include "film.h"
#include <dcp/raw_convert.h>
-#include <boost/foreach.hpp>
using std::string;
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());
}
{
KDMRecipient::as_xml (node);
- BOOST_FOREACH (string i, emails) {
+ for (auto i: emails) {
node->add_child("Email")->add_child_text(i);
}
DCPOMATIC_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
DCPOMATIC_ENABLE_WARNINGS
-#include <boost/foreach.hpp>
using std::string;
using std::list;
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);
{
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);
}
}
#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"
_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"
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());
}
Emailer::address_list (list<string> addresses)
{
string o;
- BOOST_FOREACH (string i, addresses) {
+ for (auto i: addresses) {
o += i + ", ";
}
#include "dcp_content.h"
#include "dcpomatic_time_coalesce.h"
#include "piece.h"
-#include <boost/foreach.hpp>
#include <iostream>
using std::cout;
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)));
}
{
_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;
DCPTimePeriod
Empty::period_at_position () const
{
- BOOST_FOREACH (DCPTimePeriod i, _periods) {
+ for (auto i: _periods) {
if (i.contains(_position)) {
return DCPTimePeriod (_position, i.to);
}
Empty::done () const
{
DCPTime latest;
- BOOST_FOREACH (DCPTimePeriod i, _periods) {
+ for (auto i: _periods) {
latest = max (latest, i.to);
}
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
}
/* 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));
#include <lwext4/ext4_mkfs.h>
}
#include <boost/filesystem.hpp>
-#include <boost/foreach.hpp>
#include <string>
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) {
#include <libswscale/swscale.h>
}
#include <boost/algorithm/string.hpp>
-#include <boost/foreach.hpp>
#include <iostream>
#include "i18n.h"
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 ());
}
#include <libavutil/pixdesc.h>
}
#include <libxml++/libxml++.h>
-#include <boost/foreach.hpp>
#include <iostream>
#include "i18n.h"
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"));
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);
}
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 () + " " ;
}
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;
DCPOMATIC_ASSERT (audio);
Frame longest = 0;
- BOOST_FOREACH (AudioStreamPtr i, audio->streams ()) {
+ for (auto i: audio->streams()) {
longest = max (longest, Frame(llrint(i->length())));
}
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));
}
}
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
}
-#include <boost/foreach.hpp>
#include <boost/algorithm/string.hpp>
#include <vector>
#include <iomanip>
}
}
- 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
}
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
_have_current_subtitle = false;
- BOOST_FOREACH (optional<ContentTime>& i, _next_time) {
+ for (auto& i: _next_time) {
i = optional<ContentTime>();
}
}
_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);
}
}
}
delete[] interleaved;
- BOOST_FOREACH (FileEncoderSet i, file_encoders) {
+ for (auto i: file_encoders) {
i.flush ();
}
}
#include <libavutil/display.h>
}
DCPOMATIC_ENABLE_WARNINGS
-#include <boost/foreach.hpp>
#include <iostream>
#include "i18n.h"
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;
}
{
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;
}
DCPOMATIC_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
DCPOMATIC_ENABLE_WARNINGS
-#include <boost/foreach.hpp>
#include <iostream>
using std::string;
{
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"));
}
}
#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>
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 ();
}
}
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;
}
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()) {
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"));
}
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());
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());
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);
_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());
}
_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()));
}
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 {
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));
/* 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());
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()) {
}
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;
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);
}
}
{
/* 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;
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());
}
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;
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);
/* 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());
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();
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()));
/* 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));
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;
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;
bool
Film::contains_atmos_content () const
{
- BOOST_FOREACH (shared_ptr<Content> i, _playlist->content()) {
+ for (auto i: _playlist->content()) {
if (i->atmos) {
return true;
}
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()) {
extern "C" {
#include <libavfilter/avfilter.h>
}
-#include <boost/foreach.hpp>
#include <iostream>
#include "i18n.h"
{
string ff;
- BOOST_FOREACH (Filter const * i, filters) {
+ for (auto const i: filters) {
if (!ff.empty ()) {
ff += N_(",");
}
DCPOMATIC_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
DCPOMATIC_ENABLE_WARNINGS
-#include <boost/foreach.hpp>
using std::string;
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();
}
int near_1 = 0;
- BOOST_FOREACH (double i, _intervals) {
+ for (auto i: _intervals) {
if (i > 0.5) {
++near_1;
}
#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>
{
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") {
{
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;
{
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;
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;
}
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;
}
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
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) {
}
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());
}
#include "image_filename_sorter.h"
#include <libcxml/cxml.h>
#include <libxml++/libxml++.h>
-#include <boost/foreach.hpp>
#include <iostream>
#include "i18n.h"
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 ();
#include "image_filename_sorter.h"
#include <dcp/locale_convert.h>
#include <boost/filesystem.hpp>
-#include <boost/foreach.hpp>
#include <boost/optional.hpp>
#include <iostream>
#include "encode_server_description.h"
#include "compose.hpp"
#include <libcxml/cxml.h>
-#include <boost/foreach.hpp>
#include <iostream>
#include "i18n.h"
}
}
- BOOST_FOREACH (EncodeServerDescription i, EncodeServerFinder::instance()->servers()) {
+ for (auto i: EncodeServerFinder::instance()->servers()) {
if (!i.current_link_version()) {
continue;
}
#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>
} catch (sub::SubripError& e) {
string extra = "Error is near:\n";
- BOOST_FOREACH (string i, e.context()) {
+ for (auto i: e.context()) {
extra += i + "\n";
}
#include "analyse_subtitles_job.h"
#include "film.h"
#include <boost/thread.hpp>
-#include <boost/foreach.hpp>
#include <iostream>
using std::string;
{
boost::this_thread::disable_interruption dis;
- BOOST_FOREACH (boost::signals2::connection& i, _connections) {
+ for (auto& i: _connections) {
i.disconnect ();
}
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;
}
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;
}
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 ();
{
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);
{
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);
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 ();
return;
}
- BOOST_FOREACH (shared_ptr<Job> i, _jobs) {
+ for (auto i: _jobs) {
if (i->pause_by_user()) {
_paused_job = i;
}
#include "config.h"
#include "dcpomatic_log.h"
#include "emailer.h"
-#include <boost/foreach.hpp>
#include <boost/function.hpp>
#include <boost/function.hpp>
if (directory == "-") {
/* Write KDMs to the stdout */
- BOOST_FOREACH (KDMWithMetadataPtr i, kdms) {
+ for (auto i: kdms) {
cout << i->kdm_as_xml ();
++written;
}
}
/* 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);
{
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());
}
{
list<list<KDMWithMetadataPtr> > grouped;
- BOOST_FOREACH (KDMWithMetadataPtr i, kdms) {
+ for (auto i: kdms) {
list<list<KDMWithMetadataPtr> >::iterator j = grouped.begin ();
{
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)) {
{
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)) {
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;
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 + ", ";
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 ()) {
#include "overlaps.h"
#include "types.h"
#include "content.h"
-#include <boost/foreach.hpp>
using std::shared_ptr;
using boost::function;
{
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);
}
#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>
_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;
}
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;
}
if (_ignore_text) {
- BOOST_FOREACH (shared_ptr<TextDecoder> i, decoder->text) {
+ for (auto i: decoder->text) {
i->set_ignore (true);
}
}
}
_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 ());
}
}
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.
*/
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;
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();
}
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);
}
}
shared_ptr<Piece> earliest_content;
optional<DCPTime> earliest_time;
- BOOST_FOREACH (shared_ptr<Piece> i, _pieces) {
+ for (auto i: _pieces) {
if (i->done) {
continue;
}
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;
}
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();
_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
{
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);
}
#include "player_text.h"
#include "font.h"
-#include <boost/foreach.hpp>
using std::list;
using std::shared_ptr;
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;
}
#include <libcxml/cxml.h>
#include <libxml++/libxml++.h>
#include <boost/bind/placeholders.hpp>
-#include <boost/foreach.hpp>
#include <iostream>
#include "i18n.h"
DCPTime next_left;
DCPTime next_right;
- BOOST_FOREACH (shared_ptr<Content> i, cont) {
+ for (auto i: cont) {
if (!i->video) {
continue;
}
/* 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;
}
{
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;
}
{
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 */
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);
}
}
{
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;
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));
}
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;
}
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));
}
}
DCPTime start = DCPTime::max ();
- BOOST_FOREACH (shared_ptr<Content> i, cont) {
+ for (auto i: cont) {
start = min (start, i->position ());
}
void
Playlist::disconnect ()
{
- BOOST_FOREACH (boost::signals2::connection& i, _content_connections) {
+ for (auto& i: _content_connections) {
i.disconnect ();
}
{
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)));
}
}
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));
}
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));
}
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));
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);
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()) {
{
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) {
{
pair<double, double> range (DBL_MAX, -DBL_MAX);
- BOOST_FOREACH (shared_ptr<Content> i, content()) {
+ for (auto i: content()) {
if (!i->video) {
continue;
}
#include <dcp/smpte_subtitle_asset.h>
#include <dcp/raw_convert.h>
#include <dcp/subtitle_image.h>
-#include <boost/foreach.hpp>
#include "i18n.h"
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));
}
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));
}
);
} 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;
} 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());
} 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());
}
/* 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
);
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(
#ifndef DCPOMATIC_HAVE_SHOW_IN_CAIRO_CONTEXT
#include <pango/pangocairo.h>
#endif
-#include <boost/foreach.hpp>
#include <boost/algorithm/string.hpp>
#include <iostream>
{
string out;
- BOOST_FOREACH (StringText const & i, subtitles) {
+ for (auto const& i: subtitles) {
out += "<span ";
if (i.italic()) {
out += "style=\"italic\" ";
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 ();
}
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 ();
#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>
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 {
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());
}
}
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;
, _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);
#include "config.h"
#include "emailer.h"
#include "compose.hpp"
-#include <boost/foreach.hpp>
#include <list>
#include "i18n.h"
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()) {
#include "emailer.h"
#include "environment_info.h"
#include <libxml++/libxml++.h>
-#include <boost/foreach.hpp>
#include "i18n.h"
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";
}
#include "content_video.h"
#include "dcpomatic_assert.h"
#include "dcpomatic_log.h"
-#include <boost/foreach.hpp>
#include <string>
#include <iostream>
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);
}
}
DCPOMATIC_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
DCPOMATIC_ENABLE_WARNINGS
-#include <boost/foreach.hpp>
#include <iostream>
using std::cout;
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));
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());
#include "text_content.h"
#include "text_decoder.h"
#include <dcp/subtitle_string.h>
-#include <boost/foreach.hpp>
#include <iostream>
using std::list;
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));
}
}
_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);
}
}
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);
}
}
}
}
- 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());
#include <dcp/raw_convert.h>
#include <libcxml/cxml.h>
#include <libxml++/libxml++.h>
-#include <boost/foreach.hpp>
#include <iostream>
#include "i18n.h"
}
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)));
}
/* 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();
}
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)));
}
}
#include "log.h"
#include "compose.hpp"
#include <sub/subtitle.h>
-#include <boost/foreach.hpp>
#include <boost/algorithm/string.hpp>
#include <iostream>
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.)
*/
/* 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()) {
/* 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;
}
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 */
#include <libxml++/libxml++.h>
DCPOMATIC_ENABLE_WARNINGS
#include <libcxml/cxml.h>
-#include <boost/foreach.hpp>
#include "i18n.h"
list<dcp::VerificationNote> notes;
dcp.read (¬es);
- BOOST_FOREACH (dcp::VerificationNote i, notes) {
+ for (auto i: notes) {
if (i.code() != dcp::VerificationNote::EXTERNAL_ASSET) {
/* It's not just a warning about this DCP being a VF */
throw dcp::ReadError(dcp::note_to_string(i));
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;
}
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;
first = false;
- BOOST_FOREACH (shared_ptr<Job> i, jobs) {
+ for (auto i: jobs) {
if (progress) {
cout << i->name();
if (!i->sub_name().empty()) {
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;
}
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;
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;
_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;
}
#include "log.h"
#include "frame_interval_checker.h"
#include "compose.hpp"
-#include <boost/foreach.hpp>
#include <iostream>
#include "i18n.h"
#include "video_ring_buffers.h"
#include "player_video.h"
#include "compose.hpp"
-#include <boost/foreach.hpp>
#include <list>
#include <iostream>
#include <dcp/cpl.h>
#include <dcp/locale_convert.h>
#include <dcp/reel_mxf.h>
-#include <boost/foreach.hpp>
#include <fstream>
#include <cerrno>
#include <iostream>
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));
}
*/
_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 ();
/* (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 {
LOG_GENERAL_NC ("Finishing ReelWriters");
- BOOST_FOREACH (ReelWriter& i, _reels) {
+ for (auto& i: _reels) {
i.finish (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));
/* 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));
}
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);
) ? 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));
}
{
/* 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;
}
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);
#endif
#include <boost/filesystem.hpp>
#include <boost/noncopyable.hpp>
-#include <boost/foreach.hpp>
#include <boost/algorithm/string.hpp>
#include <iostream>
#include <fstream>
);
}
- BOOST_FOREACH (string i, notes) {
+ for (auto i: notes) {
error_dialog (0, std_to_wx(i));
}
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);
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);
}
}
#include <wx/splash.h>
#include <wx/preferences.h>
#include <wx/wx.h>
-#include <boost/foreach.hpp>
#include <iostream>
#include <set>
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);
}
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));
#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>
<< "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 ()
++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
}
/* 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 {
#include <dcp/exceptions.h>
#include <libxml++/libxml++.h>
#include <boost/filesystem.hpp>
-#include <boost/foreach.hpp>
#include <getopt.h>
#include <string>
#include <iostream>
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;
content = content_factory (can);
}
- BOOST_FOREACH (shared_ptr<Content> j, content) {
+ for (auto j: content) {
film->examine_and_add_content (j);
}
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);
}
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);
}
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";
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;
#include <sys/types.h>
#include <boost/filesystem.hpp>
#include <boost/algorithm/string.hpp>
-#include <boost/foreach.hpp>
#include <iostream>
using std::cin;
#include <ApplicationServices/ApplicationServices.h>
#endif
#include <boost/bind/bind.hpp>
-#include <boost/foreach.hpp>
#ifdef check
#undef check
throw InvalidSignerError ();
}
- BOOST_FOREACH (shared_ptr<Screen> i, _screens->screens()) {
+ for (auto i: _screens->screens()) {
if (!i->recipient) {
continue;
);
/* Add keys from the DKDM */
- BOOST_FOREACH (dcp::DecryptedKDMKey const & j, decrypted.keys()) {
+ for (auto const& j: decrypted.keys()) {
kdm.add_key (j);
}
/* 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);
}
}
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);
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);
dcp::LocalTime().as_string()
);
- BOOST_FOREACH (dcp::DecryptedKDMKey const & j, dkdm.keys()) {
+ for (auto const& j: dkdm.keys()) {
kdm.add_key(j);
}
try {
list<KDMWithMetadataPtr> kdms;
- BOOST_FOREACH (shared_ptr<Screen> i, screens) {
+ for (auto i: screens) {
if (!i->recipient) {
continue;
}
}
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);
}
bool ok = true;
- BOOST_FOREACH (shared_ptr<Content> i, _film->content()) {
+ for (auto i: _film->content()) {
shared_ptr<DCPContent> d = dynamic_pointer_cast<DCPContent>(i);
if (d && !d->kdm_timing_window_valid()) {
ok = false;
if (dcp) {
DCPExaminer ex (dcp, true);
shared_ptr<dcp::CPL> playing_cpl;
- BOOST_FOREACH (shared_ptr<dcp::CPL> i, ex.cpls()) {
+ for (auto i: ex.cpls()) {
if (!dcp->cpl() || i->id() == *dcp->cpl()) {
playing_cpl = i;
}
/* 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);
}
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())
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) {
#include <wx/imaglist.h>
#include <wx/spinctrl.h>
#include <wx/preferences.h>
-#include <boost/foreach.hpp>
using std::exception;
using std::cout;
}
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()));
}
} catch (...) {}
}
- BOOST_FOREACH (shared_ptr<SignalSPL> i, _playlists) {
+ for (auto i: _playlists) {
add_playlist_to_view (i);
}
}
_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()));
#include <wx/icon.h>
DCPOMATIC_ENABLE_WARNINGS
#include <boost/thread.hpp>
-#include <boost/foreach.hpp>
#include <boost/optional.hpp>
#include <iostream>
string get () const {
string a;
- BOOST_FOREACH (string const & i, _log) {
+ for (auto const& i: _log) {
a += i + "\n";
}
return a;
#include "lib/job_manager.h"
#include <libxml++/libxml++.h>
#include <boost/filesystem.hpp>
-#include <boost/foreach.hpp>
#include <iostream>
using std::cout;
_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 ();
}
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);
#include <wx/grid.h>
#include <wx/graphics.h>
DCPOMATIC_ENABLE_WARNINGS
-#include <boost/foreach.hpp>
#include <iostream>
using std::cout;
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;
/* 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;
/* 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) {
}
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;
}
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);
}
#include "lib/dcp_content.h"
#include "lib/audio_content.h"
#include <wx/spinctrl.h>
-#include <boost/foreach.hpp>
#include <iostream>
using std::vector;
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) {
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);
}
}
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);
}
}
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;
#include "wx_util.h"
#include "lib/dcpomatic_assert.h"
#include "lib/util.h"
-#include <boost/foreach.hpp>
using std::string;
using std::vector;
{
_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());
}
_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)));
}
_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);
DCPOMATIC_ENABLE_WARNINGS
#include <RtAudio.h>
#include <boost/filesystem.hpp>
-#include <boost/foreach.hpp>
#include <iostream>
class AudioMappingView;
#include "static_text.h"
#include "check_box.h"
#include "lib/config.h"
-#include <boost/foreach.hpp>
using std::list;
using std::string;
: 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";
}
#include "lib/config.h"
#include "lib/util.h"
#include <wx/statline.h>
-#include <boost/foreach.hpp>
#include <iostream>
using std::string;
_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));
}
}
#include <dcp/decrypted_kdm.h>
#include <wx/wx.h>
#include <wx/dirdlg.h>
-#include <boost/foreach.hpp>
#include <iostream>
using std::cout;
_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;
}
_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 (
ContentMenu::join ()
{
vector<shared_ptr<Content> > fc;
- BOOST_FOREACH (shared_ptr<Content> i, _content) {
+ for (auto i: _content) {
shared_ptr<FFmpegContent> f = dynamic_pointer_cast<FFmpegContent> (i);
if (f) {
fc.push_back (f);
/* Special case: we only remove FFmpegContent if its video view is selected;
if not, and its audio view is selected, we unmap the audio.
*/
- BOOST_FOREACH (shared_ptr<Content> i, _content) {
+ for (auto i: _content) {
shared_ptr<FFmpegContent> fc = dynamic_pointer_cast<FFmpegContent> (i);
if (!fc) {
continue;
shared_ptr<TimelineVideoContentView> video;
shared_ptr<TimelineAudioContentView> audio;
- BOOST_FOREACH (shared_ptr<TimelineContentView> j, _views) {
+ for (auto j: _views) {
shared_ptr<TimelineVideoContentView> v = dynamic_pointer_cast<TimelineVideoContentView> (j);
shared_ptr<TimelineAudioContentView> a = dynamic_pointer_cast<TimelineAudioContentView> (j);
if (v && v->content() == fc) {
return;
}
- BOOST_FOREACH (shared_ptr<Content> i, content) {
+ for (auto i: content) {
shared_ptr<Job> j (new ExamineContentJob (film, i));
j->Finished.connect (
return;
}
- BOOST_FOREACH (shared_ptr<Content> i, _content) {
+ for (auto i: _content) {
JobManager::instance()->add (shared_ptr<Job> (new ExamineContentJob (film, i)));
}
}
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;
}
#include <wx/listctrl.h>
#include <wx/display.h>
#include <boost/filesystem.hpp>
-#include <boost/foreach.hpp>
#include <iostream>
using std::list;
{
ContentList vc;
- BOOST_FOREACH (shared_ptr<Content> i, selected ()) {
+ for (auto i: selected()) {
if (i->video) {
vc.push_back (i);
}
{
ContentList ac;
- BOOST_FOREACH (shared_ptr<Content> i, selected ()) {
+ for (auto i: selected()) {
if (i->audio) {
ac.push_back (i);
}
{
ContentList sc;
- BOOST_FOREACH (shared_ptr<Content> i, selected ()) {
+ for (auto i: selected()) {
if (!i->text.empty()) {
sc.push_back (i);
}
{
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);
break;
}
- BOOST_FOREACH (ContentSubPanel* i, panels()) {
+ for (auto i: panels()) {
i->film_changed (p);
}
}
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()) {
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;
}
}
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);
return true;
}
- BOOST_FOREACH (shared_ptr<Content> i, selected ()) {
+ for (auto i: selected ()) {
_film->remove_content (i);
}
setup ();
}
- BOOST_FOREACH (ContentSubPanel* i, panels()) {
+ for (auto i: panels()) {
i->film_content_changed (property);
}
}
_content->DeleteAllItems ();
- BOOST_FOREACH (shared_ptr<Content> i, content) {
+ for (auto i: content) {
int const t = _content->GetItemCount ();
bool const valid = i->paths_valid ();
/* 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);
}
}
#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;
: 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> ();
}
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)));
}
#include "lib/compose.hpp"
#include "lib/log.h"
#include <wx/notebook.h>
-#include <boost/foreach.hpp>
using std::list;
using std::string;
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;
}
/* 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 {
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;
}
#include <wx/gbsizer.h>
#include <wx/spinctrl.h>
#include <boost/lexical_cast.hpp>
-#include <boost/foreach.hpp>
#include <iostream>
using std::cout;
_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 ()));
}
_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)));
}
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();
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);
}
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);
}
bool kdms_with_no_email = false;
- BOOST_FOREACH (KDMWithMetadataPtr i, kdms) {
+ for (auto i: kdms) {
if (i->emails().empty()) {
kdms_with_no_email = true;
}
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);
}
}
#include <dcp/raw_convert.h>
#include <curl/curl.h>
#include <zip.h>
-#include <boost/foreach.hpp>
#include <iostream>
using std::string;
_dialog->message()->SetLabel (wxT (""));
string s;
- BOOST_FOREACH (string e, errors) {
+ for (auto e: errors) {
s += e + "\n";
}
_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);
}
}
int total_width = 0;
- BOOST_FOREACH (EditableListColumn i, _columns) {
+ for (auto i: _columns) {
total_width += i.width.get_value_or (_default_width);
}
#endif
int j = 0;
- BOOST_FOREACH (EditableListColumn i, _columns) {
+ for (auto i: _columns) {
wxListItem ip;
ip.SetId (j);
ip.SetText (i.name);
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));
}
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);
}
#include "lib/dcp_content.h"
#include <wx/wx.h>
#include <wx/notebook.h>
-#include <boost/foreach.hpp>
#include <iostream>
using std::cout;
#include "lib/compose.hpp"
#include <wx/stdpaths.h>
#include <boost/filesystem.hpp>
-#include <boost/foreach.hpp>
using namespace std;
using namespace boost;
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));
}
_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 ();
}
Frame total = 0;
- BOOST_FOREACH (Frame i, _latency_history) {
+ for (auto i: _latency_history) {
total += i;
}
#include "wx_util.h"
#include "lib/film.h"
#include "lib/filter.h"
-#include <boost/foreach.hpp>
using namespace std;
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;
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);
#include "lib/content.h"
#include "lib/text_content.h"
#include <wx/wx.h>
-#include <boost/foreach.hpp>
#include <iostream>
using std::list;
_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);
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;
}
#include <wx/filepicker.h>
#include <RtAudio.h>
#include <boost/filesystem.hpp>
-#include <boost/foreach.hpp>
#include <iostream>
using std::vector;
_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 ()));
}
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()));
}
DCPOMATIC_DISABLE_WARNINGS
#include <wx/richtext/richtextctrl.h>
DCPOMATIC_ENABLE_WARNINGS
-#include <boost/foreach.hpp>
using std::max;
using std::vector;
}
} 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 ();
}
#include "lib/util.h"
#include "lib/exceptions.h"
#include "lib/compose.hpp"
-#include <boost/foreach.hpp>
#include <iostream>
using std::string;
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;
}
}
- 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 ());
}
void
JobManagerView::job_list_changed ()
{
- BOOST_FOREACH (shared_ptr<JobView> i, _job_records) {
+ for (auto i: _job_records) {
i->job_list_changed ();
}
}
#include <libxml++/libxml++.h>
DCPOMATIC_ENABLE_WARNINGS
#include <libcxml/cxml.h>
-#include <boost/foreach.hpp>
using std::vector;
{
_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) {
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;
}
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);
}
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);
}
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;
}
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);
}
}
#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>
_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)) {
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;
}
_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);
#include "move_to_dialog.h"
#include "lib/film.h"
#include <wx/spinctrl.h>
-#include <boost/foreach.hpp>
using std::list;
using std::shared_ptr;
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);
}
#include "wx_util.h"
#include "static_text.h"
#include "check_box.h"
-#include <boost/foreach.hpp>
using std::shared_ptr;
#if BOOST_VERSION >= 106100
DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
DCPOMATIC_ENABLE_WARNINGS
-#include <boost/foreach.hpp>
#include <boost/signals2.hpp>
class NameFormatEditor
#include <wx/filepicker.h>
#include <RtAudio.h>
#include <boost/filesystem.hpp>
-#include <boost/foreach.hpp>
#include <iostream>
using std::vector;
#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>
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();
}
sort (_playlists.begin(), _playlists.end(), SPLComparator());
- BOOST_FOREACH (SPL i, _playlists) {
+ for (auto i: _playlists) {
add_playlist_to_list (i);
}
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()) {
_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);
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;
#include "recipient_dialog.h"
#include "dcpomatic_button.h"
#include "lib/config.h"
-#include <boost/foreach.hpp>
#include <list>
#include <iostream>
{
_root = _targets->AddRoot ("Foo");
- BOOST_FOREACH (shared_ptr<DKDMRecipient> i, Config::instance()->dkdm_recipients()) {
+ for (auto i: Config::instance()->dkdm_recipients()) {
add_recipient (i);
}
}
#include "static_text.h"
#include "check_box.h"
#include "lib/config.h"
-#include <boost/foreach.hpp>
using std::list;
using std::string;
#include "save_template_dialog.h"
#include "wx_util.h"
#include "lib/config.h"
-#include <boost/foreach.hpp>
using std::string;
#if BOOST_VERSION >= 106100
#include "lib/config.h"
#include "lib/cinema.h"
#include "lib/screen.h"
-#include <boost/foreach.hpp>
using std::list;
using std::pair;
_cinemas[id] = c;
- BOOST_FOREACH (shared_ptr<Screen> i, c->screens()) {
+ for (auto i: c->screens()) {
add_screen (c, i);
}
return;
}
- BOOST_FOREACH (shared_ptr<Screen> i, c->screens ()) {
+ for (auto i: c->screens ()) {
if (i->name == d->name()) {
error_dialog (
GetParent(),
}
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(),
{
_root = _targets->AddRoot ("Foo");
- BOOST_FOREACH (shared_ptr<Cinema> i, Config::instance()->cinemas ()) {
+ for (auto i: Config::instance()->cinemas()) {
add_cinema (i);
}
}
#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;
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);
*/
#include "suspender.h"
-#include <boost/foreach.hpp>
Suspender::Suspender(boost::function<void (int)> handler)
: _handler (handler)
{
--_count;
if (_count == 0) {
- BOOST_FOREACH (int i, _pending) {
+ for (auto i: _pending) {
_handler (i);
}
_pending.clear ();
#include "wx_util.h"
#include <wx/listctrl.h>
#include <boost/filesystem.hpp>
-#include <boost/foreach.hpp>
#include <iostream>
using std::cout;
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 ()));
}
#include "dcpomatic_button.h"
#include "lib/config.h"
#include <wx/wx.h>
-#include <boost/foreach.hpp>
using std::string;
using boost::bind;
{
_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);
#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;
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();
}
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);
}
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)
*/
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;
}
}
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);
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());
}
}
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 ());
}
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());
}
}
/* 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);
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);
}
}
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);
}
}
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);
}
}
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);
}
}
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 ();
}
_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));
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);
#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>
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()) {
_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)));
}
_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)));
}
{
int const base = tracks;
- BOOST_FOREACH (shared_ptr<TimelineView> i, views) {
+ for (auto i: views) {
if (!dynamic_pointer_cast<T>(i)) {
continue;
}
/* 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;
/* 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);
_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);
}
}
/* 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);
}
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);
#include "wx_util.h"
#include "lib/content.h"
#include <wx/graphics.h>
-#include <boost/foreach.hpp>
using std::list;
using std::shared_ptr;
/* 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);
#include "timeline.h"
#include <wx/wx.h>
#include <wx/graphics.h>
-#include <boost/foreach.hpp>
using std::min;
using std::list;
gc->SetFont (gc->CreateFont (*wxNORMAL_FONT, wxColour (0, 0, 255)));
int reel = 1;
- BOOST_FOREACH (DCPTimePeriod i, _timeline.film()->reels()) {
+ for (auto i: _timeline.film()->reels()) {
int const size = min (8.0, i.duration().seconds() * pps / 2);
wxGraphicsPath path = gc->CreatePath ();
#include <gtk/gtk.h>
DCPOMATIC_ENABLE_WARNINGS
#endif
-#include <boost/foreach.hpp>
#include <set>
#include <iostream>
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()));
}
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()));
}
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 ());
}
} 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 ());
}
} 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 ());
}
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;
}
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;
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);
}
}
{
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);
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
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);
}
{
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()
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));
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());
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;
}
/* 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 {
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());
}
}
DCPOMATIC_DISABLE_WARNINGS
#include <wx/richtext/richtextctrl.h>
DCPOMATIC_ENABLE_WARNINGS
-#include <boost/foreach.hpp>
using std::list;
using std::shared_ptr;
_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);
#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>
_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));
}
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());
}
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 ());
}
}
} 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 ());
}
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());
}
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)) {
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 {
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;
}
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));
}
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));
}
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>());
}
}
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());
}
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());
}
}
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());
}
}
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());
}
}
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());
}
}
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;
#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;
/** 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);
if (!stored) {
stored = sub;
} else {
- BOOST_FOREACH (dcp::SubtitleString i, sub.subs) {
+ for (auto i: sub.subs) {
stored->subs.push_back (i);
}
}
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") != "");
}
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);
}
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,
#include "lib/content_factory.h"
#include "test.h"
#include <boost/test/unit_test.hpp>
-#include <boost/foreach.hpp>
#include <iostream>
using std::list;
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";
}
}
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);
#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>
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());
}
}
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();
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;
#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;