#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;
using std::list;
using std::cout;
-using boost::shared_ptr;
+using std::shared_ptr;
using boost::optional;
-using boost::dynamic_pointer_cast;
+using std::dynamic_pointer_cast;
using boost::bind;
/** @param t Original text type of the content, if known */
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);
setup_sensitivity ();
} else if (property == DCPContentProperty::TEXTS) {
setup_sensitivity ();
+ } else if (property == ContentProperty::TRIM_START) {
+ setup_sensitivity ();
}
}
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 = boost::dynamic_pointer_cast<const FFmpegContent> (i);
- shared_ptr<const StringTextFileContent> sc = boost::dynamic_pointer_cast<const StringTextFileContent> (i);
- shared_ptr<const DCPContent> dc = boost::dynamic_pointer_cast<const DCPContent> (i);
- shared_ptr<const DCPSubtitleContent> dsc = boost::dynamic_pointer_cast<const DCPSubtitleContent> (i);
+ shared_ptr<const FFmpegContent> fc = std::dynamic_pointer_cast<const FFmpegContent> (i);
+ shared_ptr<const StringTextFileContent> sc = std::dynamic_pointer_cast<const StringTextFileContent> (i);
+ shared_ptr<const DCPContent> dc = std::dynamic_pointer_cast<const DCPContent> (i);
+ shared_ptr<const DCPSubtitleContent> dsc = std::dynamic_pointer_cast<const DCPSubtitleContent> (i);
if (fc) {
if (!fc->text.empty()) {
++ffmpeg_subs;
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 ();
}