/*
- Copyright (C) 2014-2016 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2014-2018 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
}
bool
-DCPContent::can_reference (function<shared_ptr<ContentPart> (shared_ptr<const Content>)> part, string overlapping, list<string>& why_not) const
+DCPContent::can_reference (function<shared_ptr<ContentPart> (shared_ptr<const Content>)> part, string overlapping, string& why_not) const
{
/* We must be using the same standard as the film */
if (_standard) {
if (_standard.get() == dcp::INTEROP && !film()->interop()) {
- why_not.push_back (_("The film is set to SMPTE and this DCP is Interop."));
+ why_not = _("The film is set to SMPTE and this DCP is Interop.");
return false;
} else if (_standard.get() == dcp::SMPTE && film()->interop()) {
- why_not.push_back (_("The film is set to Interop and this DCP is SMPTE."));
+ why_not = _("The film is set to Interop and this DCP is SMPTE.");
return false;
}
}
/* And the same frame rate */
if (!video_frame_rate() || (lrint(video_frame_rate().get()) != film()->video_frame_rate())) {
- why_not.push_back (_("The film has a different frame rate to this DCP."));
+ why_not = _("The film has a different frame rate to this DCP.");
return false;
}
*/
BOOST_FOREACH (DCPTimePeriod i, reel_list) {
if (find (fr.begin(), fr.end(), i) == fr.end ()) {
- why_not.push_back (_("The reel lengths in the film differ from those in the DCP; set the reel mode to 'split by video content'."));
+ why_not = _("The reel lengths in the film differ from those in the DCP; set the reel mode to 'split by video content'.");
return false;
}
}
ContentList a = overlaps (film()->content(), part, position(), end());
if (a.size() != 1 || a.front().get() != this) {
- why_not.push_back (overlapping);
+ why_not = overlapping;
return false;
}
}
bool
-DCPContent::can_reference_video (list<string>& why_not) const
+DCPContent::can_reference_video (string& why_not) const
{
if (film()->frame_size() != video->size()) {
- why_not.push_back (_("The video frame size in the film differs from that in the DCP."));
+ why_not = _("The video frame size in the film differs from that in the DCP.");
return false;
}
}
bool
-DCPContent::can_reference_audio (list<string>& why_not) const
+DCPContent::can_reference_audio (string& why_not) const
{
shared_ptr<DCPDecoder> decoder;
try {
BOOST_FOREACH (shared_ptr<dcp::Reel> i, decoder->reels()) {
if (!i->main_sound()) {
- why_not.push_back (_("The DCP does not have sound in all reels."));
+ why_not = _("The DCP does not have sound in all reels.");
return false;
}
}
}
bool
-DCPContent::can_reference_subtitle (list<string>& why_not) const
+DCPContent::can_reference_subtitle (string& why_not) const
{
shared_ptr<DCPDecoder> decoder;
try {
BOOST_FOREACH (shared_ptr<dcp::Reel> i, decoder->reels()) {
if (!i->main_subtitle()) {
- why_not.push_back (_("The DCP does not have subtitles in all reels."));
+ why_not = _("The DCP does not have subtitles in all reels.");
return false;
}
}
/*
- Copyright (C) 2014-2016 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2014-2018 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
return _reference_video;
}
- bool can_reference_video (std::list<std::string> &) const;
+ bool can_reference_video (std::string &) const;
void set_reference_audio (bool r);
return _reference_audio;
}
- bool can_reference_audio (std::list<std::string> &) const;
+ bool can_reference_audio (std::string &) const;
void set_reference_subtitle (bool r);
return _reference_subtitle;
}
- bool can_reference_subtitle (std::list<std::string> &) const;
+ bool can_reference_subtitle (std::string &) const;
void set_cpl (std::string id);
bool can_reference (
boost::function <boost::shared_ptr<ContentPart> (boost::shared_ptr<const Content>)>,
std::string overlapping,
- std::list<std::string>& why_not
+ std::string& why_not
) const;
std::string _name;
}
void
-ContentSubPanel::setup_refer_button (wxCheckBox* button, shared_ptr<DCPContent> dcp, bool can_reference, list<string> why_not) const
+ContentSubPanel::setup_refer_button (wxCheckBox* button, shared_ptr<DCPContent> dcp, bool can_reference, string why_not) const
{
button->Enable (can_reference);
if (!dcp) {
s = _("No DCP selected.");
} else if (!can_reference) {
- s = _("Cannot reference this DCP. ");
- BOOST_FOREACH (string i, why_not) {
- s += std_to_wx(i) + wxT(" ");
- }
+ s = _("Cannot reference this DCP. ") + std_to_wx(why_not);
}
button->SetToolTip (s);