d << "_" << container()->isdcf_name();
}
- ContentList cl = content ();
-
/* XXX: this uses the first bit of content only */
/* 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;
- for (ContentList::iterator i = cl.begin(); i != cl.end(); ++i) {
- shared_ptr<VideoContent> vc = dynamic_pointer_cast<VideoContent> (*i);
+ BOOST_FOREACH (shared_ptr<Content> i, content ()) {
+ shared_ptr<VideoContent> vc = dynamic_pointer_cast<VideoContent> (i);
if (vc) {
/* Here's the first piece of video content */
if (vc->scale().ratio ()) {
}
} else {
list<int> mapped;
- for (ContentList::const_iterator i = cl.begin(); i != cl.end(); ++i) {
- shared_ptr<const AudioContent> ac = dynamic_pointer_cast<const AudioContent> (*i);
+ BOOST_FOREACH (shared_ptr<Content> i, content ()) {
+ shared_ptr<const AudioContent> ac = dynamic_pointer_cast<const AudioContent> (i);
if (ac) {
list<int> c = ac->audio_mapping().mapped_output_channels ();
copy (c.begin(), c.end(), back_inserter (mapped));
#include <libcxml/cxml.h>
#include <libxml++/libxml++.h>
#include <boost/shared_ptr.hpp>
+#include <boost/foreach.hpp>
#include "i18n.h"
DCPTime next_left;
DCPTime next_right;
- for (ContentList::iterator i = _content.begin(); i != _content.end(); ++i) {
- shared_ptr<VideoContent> vc = dynamic_pointer_cast<VideoContent> (*i);
+ BOOST_FOREACH (shared_ptr<Content> i, _content) {
+ shared_ptr<VideoContent> vc = dynamic_pointer_cast<VideoContent> (i);
if (!vc) {
continue;
}
{
string t;
- for (ContentList::const_iterator i = _content.begin(); i != _content.end(); ++i) {
- shared_ptr<const VideoContent> vc = dynamic_pointer_cast<const VideoContent> (*i);
- shared_ptr<const SubtitleContent> sc = dynamic_pointer_cast<const SubtitleContent> (*i);
+ BOOST_FOREACH (shared_ptr<const Content> i, _content) {
+ shared_ptr<const VideoContent> vc = dynamic_pointer_cast<const VideoContent> (i);
+ shared_ptr<const SubtitleContent> sc = dynamic_pointer_cast<const SubtitleContent> (i);
if (vc) {
t += vc->identifier ();
} else if (sc && sc->burn_subtitles ()) {
void
Playlist::set_from_xml (shared_ptr<const Film> film, cxml::ConstNodePtr node, int version, list<string>& notes)
{
- list<cxml::NodePtr> c = node->node_children ("Content");
- for (list<cxml::NodePtr>::iterator i = c.begin(); i != c.end(); ++i) {
- _content.push_back (content_factory (film, *i, version, notes));
+ BOOST_FOREACH (cxml::NodePtr i, node->node_children ("Content")) {
+ _content.push_back (content_factory (film, i, version, notes));
}
sort (_content.begin(), _content.end(), ContentSorter ());
void
Playlist::as_xml (xmlpp::Node* node)
{
- for (ContentList::iterator i = _content.begin(); i != _content.end(); ++i) {
- (*i)->as_xml (node->add_child ("Content"));
+ BOOST_FOREACH (shared_ptr<Content> i, _content) {
+ i->as_xml (node->add_child ("Content"));
}
}
void
Playlist::remove (ContentList c)
{
- for (ContentList::iterator i = c.begin(); i != c.end(); ++i) {
+ BOOST_FOREACH (shared_ptr<Content> i, c) {
ContentList::iterator j = _content.begin ();
- while (j != _content.end() && *j != *i) {
+ while (j != _content.end() && *j != i) {
++j;
}
while (i != candidates.end()) {
float this_error = 0;
- for (ContentList::const_iterator j = _content.begin(); j != _content.end(); ++j) {
- shared_ptr<VideoContent> vc = dynamic_pointer_cast<VideoContent> (*j);
+ BOOST_FOREACH (shared_ptr<Content> j, _content) {
+ shared_ptr<VideoContent> vc = dynamic_pointer_cast<VideoContent> (j);
if (!vc) {
continue;
}
Playlist::length () const
{
DCPTime len;
- for (ContentList::const_iterator i = _content.begin(); i != _content.end(); ++i) {
- len = max (len, (*i)->end());
+ BOOST_FOREACH (shared_ptr<const Content> i, _content) {
+ len = max (len, i->end());
}
return len;
_content_connections.clear ();
- for (ContentList::iterator i = _content.begin(); i != _content.end(); ++i) {
- _content_connections.push_back ((*i)->Changed.connect (bind (&Playlist::content_changed, this, _1, _2, _3)));
+ BOOST_FOREACH (shared_ptr<Content> i, _content) {
+ _content_connections.push_back (i->Changed.connect (bind (&Playlist::content_changed, this, _1, _2, _3)));
}
}
Playlist::video_end () const
{
DCPTime end;
- for (ContentList::const_iterator i = _content.begin(); i != _content.end(); ++i) {
- if (dynamic_pointer_cast<const VideoContent> (*i)) {
- end = max (end, (*i)->end ());
+ BOOST_FOREACH (shared_ptr<Content> i, _content) {
+ if (dynamic_pointer_cast<const VideoContent> (i)) {
+ end = max (end, i->end ());
}
}
Playlist::repeat (ContentList c, int n)
{
pair<DCPTime, DCPTime> range (DCPTime::max (), DCPTime ());
- for (ContentList::iterator i = c.begin(); i != c.end(); ++i) {
- range.first = min (range.first, (*i)->position ());
- range.second = max (range.second, (*i)->position ());
- range.first = min (range.first, (*i)->end ());
- range.second = max (range.second, (*i)->end ());
+ BOOST_FOREACH (shared_ptr<Content> i, c) {
+ range.first = min (range.first, i->position ());
+ range.second = max (range.second, i->position ());
+ range.first = min (range.first, i->end ());
+ range.second = max (range.second, i->end ());
}
DCPTime pos = range.second;
for (int i = 0; i < n; ++i) {
- for (ContentList::iterator i = c.begin(); i != c.end(); ++i) {
- shared_ptr<Content> copy = (*i)->clone ();
+ BOOST_FOREACH (shared_ptr<Content> j, c) {
+ shared_ptr<Content> copy = j->clone ();
copy->set_position (pos + copy->position() - range.first);
_content.push_back (copy);
}
#include "lib/ffmpeg_content.h"
#include <wx/wx.h>
#include <wx/dirdlg.h>
+#include <boost/foreach.hpp>
using std::cout;
using std::vector;
_repeat->Enable (!_content.empty ());
int n = 0;
- for (ContentList::const_iterator i = _content.begin(); i != _content.end(); ++i) {
- if (dynamic_pointer_cast<FFmpegContent> (*i)) {
+ BOOST_FOREACH (shared_ptr<Content> i, _content) {
+ if (dynamic_pointer_cast<FFmpegContent> (i)) {
++n;
}
}
ContentMenu::join ()
{
vector<shared_ptr<Content> > fc;
- for (ContentList::const_iterator i = _content.begin(); i != _content.end(); ++i) {
- shared_ptr<FFmpegContent> f = dynamic_pointer_cast<FFmpegContent> (*i);
+ BOOST_FOREACH (shared_ptr<Content> i, _content) {
+ shared_ptr<FFmpegContent> f = dynamic_pointer_cast<FFmpegContent> (i);
if (f) {
fc.push_back (f);
}
try {
shared_ptr<FFmpegContent> joined (new FFmpegContent (film, fc));
- for (ContentList::const_iterator i = _content.begin(); i != _content.end(); ++i) {
- film->remove_content (*i);
+ BOOST_FOREACH (shared_ptr<Content> i, _content) {
+ film->remove_content (i);
}
film->add_content (joined);
} catch (JoinError& e) {
/* Special case: we only remove FFmpegContent if its video view is selected;
if not, and its audio view is selected, we unmap the audio.
*/
- for (ContentList::iterator i = _content.begin(); i != _content.end(); ++i) {
- shared_ptr<FFmpegContent> fc = dynamic_pointer_cast<FFmpegContent> (*i);
+ BOOST_FOREACH (shared_ptr<Content> i, _content) {
+ shared_ptr<FFmpegContent> fc = dynamic_pointer_cast<FFmpegContent> (i);
if (!fc) {
continue;
}
shared_ptr<TimelineVideoContentView> video;
shared_ptr<TimelineAudioContentView> audio;
- for (TimelineContentViewList::iterator i = _views.begin(); i != _views.end(); ++i) {
- shared_ptr<TimelineVideoContentView> v = dynamic_pointer_cast<TimelineVideoContentView> (*i);
- shared_ptr<TimelineAudioContentView> a = dynamic_pointer_cast<TimelineAudioContentView> (*i);
+ BOOST_FOREACH (shared_ptr<TimelineContentView> 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) {
video = v;
} else if (a && a->content() == fc) {
return;
}
- for (ContentList::iterator i = _content.begin(); i != _content.end(); ++i) {
- film->examine_content (*i);
+ BOOST_FOREACH (shared_ptr<Content> i, _content) {
+ film->examine_content (i);
}
}
*/
-#include "lib/audio_content.h"
-#include "lib/subtitle_content.h"
-#include "lib/video_content.h"
-#include "lib/ffmpeg_content.h"
-#include "lib/content_factory.h"
-#include "lib/image_content.h"
-#include "lib/dcp_content.h"
-#include "lib/playlist.h"
#include "content_panel.h"
#include "wx_util.h"
#include "video_panel.h"
#include "timing_panel.h"
#include "timeline_dialog.h"
#include "image_sequence_dialog.h"
+#include "lib/audio_content.h"
+#include "lib/subtitle_content.h"
+#include "lib/video_content.h"
+#include "lib/ffmpeg_content.h"
+#include "lib/content_factory.h"
+#include "lib/image_content.h"
+#include "lib/dcp_content.h"
+#include "lib/playlist.h"
#include <wx/wx.h>
#include <wx/notebook.h>
#include <wx/listctrl.h>
#include <boost/filesystem.hpp>
+#include <boost/foreach.hpp>
#include "lib/image_filename_sorter.cc"
VideoContentList
ContentPanel::selected_video ()
{
- ContentList c = selected ();
VideoContentList vc;
- for (ContentList::iterator i = c.begin(); i != c.end(); ++i) {
- shared_ptr<VideoContent> t = dynamic_pointer_cast<VideoContent> (*i);
+ BOOST_FOREACH (shared_ptr<Content> i, selected ()) {
+ shared_ptr<VideoContent> t = dynamic_pointer_cast<VideoContent> (i);
if (t) {
vc.push_back (t);
}
AudioContentList
ContentPanel::selected_audio ()
{
- ContentList c = selected ();
AudioContentList ac;
- for (ContentList::iterator i = c.begin(); i != c.end(); ++i) {
- shared_ptr<AudioContent> t = dynamic_pointer_cast<AudioContent> (*i);
+ BOOST_FOREACH (shared_ptr<Content> i, selected ()) {
+ shared_ptr<AudioContent> t = dynamic_pointer_cast<AudioContent> (i);
if (t) {
ac.push_back (t);
}
SubtitleContentList
ContentPanel::selected_subtitle ()
{
- ContentList c = selected ();
SubtitleContentList sc;
- for (ContentList::iterator i = c.begin(); i != c.end(); ++i) {
- shared_ptr<SubtitleContent> t = dynamic_pointer_cast<SubtitleContent> (*i);
+ BOOST_FOREACH (shared_ptr<Content> i, selected ()) {
+ shared_ptr<SubtitleContent> t = dynamic_pointer_cast<SubtitleContent> (i);
if (t) {
sc.push_back (t);
}
FFmpegContentList
ContentPanel::selected_ffmpeg ()
{
- ContentList c = selected ();
FFmpegContentList sc;
- for (ContentList::iterator i = c.begin(); i != c.end(); ++i) {
- shared_ptr<FFmpegContent> t = dynamic_pointer_cast<FFmpegContent> (*i);
+ BOOST_FOREACH (shared_ptr<Content> i, selected ()) {
+ shared_ptr<FFmpegContent> t = dynamic_pointer_cast<FFmpegContent> (i);
if (t) {
sc.push_back (t);
}
break;
}
- for (list<ContentSubPanel*>::iterator i = _panels.begin(); i != _panels.end(); ++i) {
- (*i)->film_changed (p);
+ BOOST_FOREACH (ContentSubPanel* i, _panels) {
+ i->film_changed (p);
}
}
{
setup_sensitivity ();
- for (list<ContentSubPanel*>::iterator i = _panels.begin(); i != _panels.end(); ++i) {
- (*i)->content_selection_changed ();
+ BOOST_FOREACH (ContentSubPanel* i, _panels) {
+ i->content_selection_changed ();
}
}
_timeline->Enable (s);
/* Set the panels in the content notebook */
- for (list<ContentSubPanel*>::iterator i = _panels.begin(); i != _panels.end(); ++i) {
- (*i)->Enable (s);
+ BOOST_FOREACH (ContentSubPanel* i, _panels) {
+ i->Enable (s);
}
}
setup ();
}
- for (list<ContentSubPanel*>::iterator i = _panels.begin(); i != _panels.end(); ++i) {
- (*i)->film_content_changed (property);
+ BOOST_FOREACH (ContentSubPanel* i, _panels) {
+ i->film_content_changed (property);
}
}
}
vector<string> proposed;
- for (ContentList::iterator i = content.begin(); i != content.end(); ++i) {
- bool const valid = (*i)->paths_valid ();
+ BOOST_FOREACH (shared_ptr<Content> i, content) {
+ bool const valid = i->paths_valid ();
- string s = (*i)->summary ();
+ string s = i->summary ();
if (!valid) {
s = _("MISSING: ") + s;
}
_content->DeleteAllItems ();
- for (ContentList::iterator i = content.begin(); i != content.end(); ++i) {
+ BOOST_FOREACH (shared_ptr<Content> i, content) {
int const t = _content->GetItemCount ();
- bool const valid = (*i)->paths_valid ();
- shared_ptr<DCPContent> dcp = dynamic_pointer_cast<DCPContent> (*i);
+ bool const valid = i->paths_valid ();
+ shared_ptr<DCPContent> dcp = dynamic_pointer_cast<DCPContent> (i);
bool const needs_kdm = dcp && !dcp->can_be_played ();
- string s = (*i)->summary ();
+ string s = i->summary ();
if (!valid) {
s = _("MISSING: ") + s;
_content->InsertItem (t, std_to_wx (s));
- if ((*i)->summary() == selected_summary) {
+ if (i->summary() == selected_summary) {
_content->SetItemState (t, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
}
*/
-#include <boost/algorithm/string.hpp>
-#include <curl/curl.h>
+#include "dolby_certificate_dialog.h"
+#include "wx_util.h"
#include "lib/compose.hpp"
#include "lib/internet.h"
#include "lib/signal_manager.h"
-#include "dolby_certificate_dialog.h"
-#include "wx_util.h"
+#include <curl/curl.h>
+#include <boost/algorithm/string.hpp>
+#include <boost/foreach.hpp>
using std::list;
using std::string;
void
DolbyCertificateDialog::finish_setup_countries ()
{
- list<string> const countries = get_dir ("");
_country->Clear ();
- for (list<string>::const_iterator i = countries.begin(); i != countries.end(); ++i) {
- _country->Append (std_to_wx (*i));
+ BOOST_FOREACH (string i, get_dir ("")) {
+ _country->Append (std_to_wx (i));
}
}
void
DolbyCertificateDialog::finish_country_selected ()
{
- list<string> const cinemas = get_dir (wx_to_std (_country->GetStringSelection()));
_cinema->Clear ();
- for (list<string>::const_iterator i = cinemas.begin(); i != cinemas.end(); ++i) {
- _cinema->Append (std_to_wx (*i));
+ BOOST_FOREACH (string i, get_dir (wx_to_std (_country->GetStringSelection()))) {
+ _cinema->Append (std_to_wx (i));
}
}
DolbyCertificateDialog::finish_cinema_selected ()
{
string const dir = String::compose ("%1/%2", wx_to_std (_country->GetStringSelection()), wx_to_std (_cinema->GetStringSelection()));
- list<string> const zips = get_dir (dir);
_serial->Clear ();
- for (list<string>::const_iterator i = zips.begin(); i != zips.end(); ++i) {
+ BOOST_FOREACH (string i, get_dir (dir)) {
vector<string> a;
- split (a, *i, is_any_of ("-_"));
+ split (a, i, is_any_of ("-_"));
if (a.size() >= 4) {
- _serial->Append (std_to_wx (a[3]), new wxStringClientData (std_to_wx (*i)));
+ _serial->Append (std_to_wx (a[3]), new wxStringClientData (std_to_wx (i)));
}
}
}
int flat_or_narrower = 0;
int scope = 0;
- for (ContentList::const_iterator i = content.begin(); i != content.end(); ++i) {
- shared_ptr<VideoContent> vc = dynamic_pointer_cast<VideoContent> (*i);
+ BOOST_FOREACH (shared_ptr<const Content> i, content) {
+ shared_ptr<const VideoContent> vc = dynamic_pointer_cast<const VideoContent> (i);
if (vc) {
Ratio const * r = vc->scale().ratio ();
if (r && r->id() == "239") {
}
int vob = 0;
- for (ContentList::const_iterator i = content.begin(); i != content.end(); ++i) {
- if (boost::algorithm::starts_with ((*i)->path(0).filename().string(), "VTS_")) {
+ BOOST_FOREACH (shared_ptr<const Content> i, content) {
+ if (boost::algorithm::starts_with (i->path(0).filename().string(), "VTS_")) {
++vob;
}
}
}
int three_d = 0;
- for (ContentList::const_iterator i = content.begin(); i != content.end(); ++i) {
- shared_ptr<const VideoContent> vc = dynamic_pointer_cast<const VideoContent> (*i);
+ BOOST_FOREACH (shared_ptr<const Content> i, content) {
+ shared_ptr<const VideoContent> vc = dynamic_pointer_cast<const VideoContent> (i);
if (vc && vc->video_frame_type() != VIDEO_FRAME_TYPE_2D) {
++three_d;
}
void
SubtitlePanel::use_toggled ()
{
- SubtitleContentList c = _parent->selected_subtitle ();
- for (SubtitleContentList::iterator i = c.begin(); i != c.end(); ++i) {
- (*i)->set_use_subtitles (_use->GetValue());
+ BOOST_FOREACH (shared_ptr<SubtitleContent> i, _parent->selected_subtitle ()) {
+ i->set_use_subtitles (_use->GetValue());
}
}
void
SubtitlePanel::burn_toggled ()
{
- SubtitleContentList c = _parent->selected_subtitle ();
- for (SubtitleContentList::iterator i = c.begin(); i != c.end(); ++i) {
- (*i)->set_burn_subtitles (_burn->GetValue());
+ BOOST_FOREACH (shared_ptr<SubtitleContent> i, _parent->selected_subtitle ()) {
+ i->set_burn_subtitles (_burn->GetValue());
}
}
void
SubtitlePanel::x_offset_changed ()
{
- SubtitleContentList c = _parent->selected_subtitle ();
- for (SubtitleContentList::iterator i = c.begin(); i != c.end(); ++i) {
- (*i)->set_subtitle_x_offset (_x_offset->GetValue() / 100.0);
+ BOOST_FOREACH (shared_ptr<SubtitleContent> i, _parent->selected_subtitle ()) {
+ i->set_subtitle_x_offset (_x_offset->GetValue() / 100.0);
}
}
void
SubtitlePanel::y_offset_changed ()
{
- SubtitleContentList c = _parent->selected_subtitle ();
- for (SubtitleContentList::iterator i = c.begin(); i != c.end(); ++i) {
- (*i)->set_subtitle_y_offset (_y_offset->GetValue() / 100.0);
+ BOOST_FOREACH (shared_ptr<SubtitleContent> i, _parent->selected_subtitle ()) {
+ i->set_subtitle_y_offset (_y_offset->GetValue() / 100.0);
}
}
void
SubtitlePanel::y_scale_changed ()
{
- SubtitleContentList c = _parent->selected_subtitle ();
- for (SubtitleContentList::iterator i = c.begin(); i != c.end(); ++i) {
- (*i)->set_subtitle_y_scale (_y_scale->GetValue() / 100.0);
+ BOOST_FOREACH (shared_ptr<SubtitleContent> i, _parent->selected_subtitle ()) {
+ i->set_subtitle_y_scale (_y_scale->GetValue() / 100.0);
}
}
void
SubtitlePanel::language_changed ()
{
- SubtitleContentList c = _parent->selected_subtitle ();
- for (SubtitleContentList::iterator i = c.begin(); i != c.end(); ++i) {
- (*i)->set_subtitle_language (wx_to_std (_language->GetValue()));
+ BOOST_FOREACH (shared_ptr<SubtitleContent> i, _parent->selected_subtitle ()) {
+ i->set_subtitle_language (wx_to_std (_language->GetValue()));
}
}
#include "lib/subtitle_content.h"
#include <wx/graphics.h>
#include <boost/weak_ptr.hpp>
+#include <boost/foreach.hpp>
#include <list>
using std::list;
_views.clear ();
_views.push_back (_time_axis_view);
- ContentList content = film->content ();
-
- for (ContentList::iterator i = content.begin(); i != content.end(); ++i) {
- if (dynamic_pointer_cast<VideoContent> (*i)) {
- _views.push_back (shared_ptr<TimelineView> (new TimelineVideoContentView (*this, *i)));
+ BOOST_FOREACH (shared_ptr<Content> i, film->content ()) {
+ if (dynamic_pointer_cast<VideoContent> (i)) {
+ _views.push_back (shared_ptr<TimelineView> (new TimelineVideoContentView (*this, i)));
}
- shared_ptr<AudioContent> ac = dynamic_pointer_cast<AudioContent> (*i);
+ shared_ptr<AudioContent> ac = dynamic_pointer_cast<AudioContent> (i);
if (ac && !ac->audio_mapping().mapped_output_channels().empty ()) {
- _views.push_back (shared_ptr<TimelineView> (new TimelineAudioContentView (*this, *i)));
+ _views.push_back (shared_ptr<TimelineView> (new TimelineAudioContentView (*this, i)));
}
- shared_ptr<SubtitleContent> sc = dynamic_pointer_cast<SubtitleContent> (*i);
+ shared_ptr<SubtitleContent> sc = dynamic_pointer_cast<SubtitleContent> (i);
if (sc && sc->has_subtitles ()) {
_views.push_back (shared_ptr<TimelineView> (new TimelineSubtitleContentView (*this, sc)));
}
void
TimingPanel::update_full_length ()
{
- ContentList cl = _parent->selected ();
-
set<DCPTime> check;
- for (ContentList::const_iterator i = cl.begin (); i != cl.end(); ++i) {
- check.insert ((*i)->full_length ());
+ BOOST_FOREACH (shared_ptr<const Content> i, _parent->selected ()) {
+ check.insert (i->full_length ());
}
if (check.size() == 1) {
- _full_length->set (cl.front()->full_length (), _parent->film()->video_frame_rate ());
+ _full_length->set (_parent->selected().front()->full_length (), _parent->film()->video_frame_rate ());
} else {
_full_length->clear ();
}
void
TimingPanel::update_play_length ()
{
- ContentList cl = _parent->selected ();
-
set<DCPTime> check;
- for (ContentList::const_iterator i = cl.begin (); i != cl.end(); ++i) {
- check.insert ((*i)->length_after_trim ());
+ BOOST_FOREACH (shared_ptr<const Content> i, _parent->selected ()) {
+ check.insert (i->length_after_trim ());
}
if (check.size() == 1) {
- _play_length->set (cl.front()->length_after_trim (), _parent->film()->video_frame_rate ());
+ _play_length->set (_parent->selected().front()->length_after_trim (), _parent->film()->video_frame_rate ());
} else {
_play_length->clear ();
}
void
TimingPanel::film_content_changed (int property)
{
- ContentList cl = _parent->selected ();
int const film_video_frame_rate = _parent->film()->video_frame_rate ();
/* Here we check to see if we have exactly one different value of various
if (property == ContentProperty::POSITION) {
set<DCPTime> check;
- for (ContentList::const_iterator i = cl.begin (); i != cl.end(); ++i) {
- check.insert ((*i)->position ());
+ BOOST_FOREACH (shared_ptr<const Content> i, _parent->selected ()) {
+ check.insert (i->position ());
}
if (check.size() == 1) {
- _position->set (cl.front()->position(), film_video_frame_rate);
+ _position->set (_parent->selected().front()->position(), film_video_frame_rate);
} else {
_position->clear ();
}
} else if (property == ContentProperty::TRIM_START) {
set<ContentTime> check;
- for (ContentList::const_iterator i = cl.begin (); i != cl.end(); ++i) {
- check.insert ((*i)->trim_start ());
+ BOOST_FOREACH (shared_ptr<const Content> i, _parent->selected ()) {
+ check.insert (i->trim_start ());
}
if (check.size() == 1) {
- _trim_start->set (cl.front()->trim_start (), film_video_frame_rate);
+ _trim_start->set (_parent->selected().front()->trim_start (), film_video_frame_rate);
} else {
_trim_start->clear ();
}
} else if (property == ContentProperty::TRIM_END) {
set<ContentTime> check;
- for (ContentList::const_iterator i = cl.begin (); i != cl.end(); ++i) {
- check.insert ((*i)->trim_end ());
+ BOOST_FOREACH (shared_ptr<const Content> i, _parent->selected ()) {
+ check.insert (i->trim_end ());
}
if (check.size() == 1) {
- _trim_end->set (cl.front()->trim_end (), film_video_frame_rate);
+ _trim_end->set (_parent->selected().front()->trim_end (), film_video_frame_rate);
} else {
_trim_end->clear ();
}
if (property == VideoContentProperty::VIDEO_FRAME_RATE) {
set<double> check;
- shared_ptr<VideoContent> vc;
- for (ContentList::const_iterator i = cl.begin (); i != cl.end(); ++i) {
- shared_ptr<VideoContent> t = dynamic_pointer_cast<VideoContent> (*i);
+ shared_ptr<const VideoContent> vc;
+ BOOST_FOREACH (shared_ptr<const Content> i, _parent->selected ()) {
+ shared_ptr<const VideoContent> t = dynamic_pointer_cast<const VideoContent> (i);
if (t) {
check.insert (t->video_frame_rate ());
vc = t;
}
bool have_still = false;
- for (ContentList::const_iterator i = cl.begin (); i != cl.end(); ++i) {
- shared_ptr<ImageContent> ic = dynamic_pointer_cast<ImageContent> (*i);
+ BOOST_FOREACH (shared_ptr<const Content> i, _parent->selected ()) {
+ shared_ptr<const ImageContent> ic = dynamic_pointer_cast<const ImageContent> (i);
if (ic && ic->still ()) {
have_still = true;
}
void
TimingPanel::position_changed ()
{
- ContentList c = _parent->selected ();
- for (ContentList::iterator i = c.begin(); i != c.end(); ++i) {
- (*i)->set_position (_position->get (_parent->film()->video_frame_rate ()));
+ BOOST_FOREACH (shared_ptr<Content> i, _parent->selected ()) {
+ i->set_position (_position->get (_parent->film()->video_frame_rate ()));
}
}
void
TimingPanel::full_length_changed ()
{
- ContentList c = _parent->selected ();
- for (ContentList::iterator i = c.begin(); i != c.end(); ++i) {
- shared_ptr<ImageContent> ic = dynamic_pointer_cast<ImageContent> (*i);
+ BOOST_FOREACH (shared_ptr<Content> i, _parent->selected ()) {
+ shared_ptr<ImageContent> ic = dynamic_pointer_cast<ImageContent> (i);
if (ic && ic->still ()) {
int const vfr = _parent->film()->video_frame_rate ();
ic->set_video_length (_full_length->get (vfr).frames_round (vfr));
void
TimingPanel::trim_start_changed ()
{
- ContentList c = _parent->selected ();
- for (ContentList::iterator i = c.begin(); i != c.end(); ++i) {
- (*i)->set_trim_start (_trim_start->get (_parent->film()->video_frame_rate ()));
+ BOOST_FOREACH (shared_ptr<Content> i, _parent->selected ()) {
+ i->set_trim_start (_trim_start->get (_parent->film()->video_frame_rate ()));
}
}
void
TimingPanel::trim_end_changed ()
{
- ContentList c = _parent->selected ();
- for (ContentList::iterator i = c.begin(); i != c.end(); ++i) {
- (*i)->set_trim_end (_trim_end->get (_parent->film()->video_frame_rate ()));
+ BOOST_FOREACH (shared_ptr<Content> i, _parent->selected ()) {
+ i->set_trim_end (_trim_end->get (_parent->film()->video_frame_rate ()));
}
}
void
TimingPanel::play_length_changed ()
{
- ContentList c = _parent->selected ();
- for (ContentList::iterator i = c.begin(); i != c.end(); ++i) {
- FrameRateChange const frc = _parent->film()->active_frame_rate_change ((*i)->position ());
- (*i)->set_trim_end (
- ContentTime ((*i)->full_length() - _play_length->get (_parent->film()->video_frame_rate()), frc)
- - (*i)->trim_start ()
+ BOOST_FOREACH (shared_ptr<Content> i, _parent->selected ()) {
+ FrameRateChange const frc = _parent->film()->active_frame_rate_change (i->position ());
+ i->set_trim_end (
+ ContentTime (i->full_length() - _play_length->get (_parent->film()->video_frame_rate()), frc)
+ - i->trim_start ()
);
}
}
void
TimingPanel::set_video_frame_rate ()
{
- ContentList c = _parent->selected ();
- for (ContentList::iterator i = c.begin(); i != c.end(); ++i) {
- shared_ptr<VideoContent> vc = dynamic_pointer_cast<VideoContent> (*i);
+ BOOST_FOREACH (shared_ptr<Content> i, _parent->selected ()) {
+ shared_ptr<VideoContent> vc = dynamic_pointer_cast<VideoContent> (i);
if (vc) {
vc->set_video_frame_rate (raw_convert<double> (wx_to_std (_video_frame_rate->GetValue ())));
}
_right_crop->wrapped()->SetRange (0, 1024);
_bottom_crop->wrapped()->SetRange (0, 1024);
- vector<VideoContentScale> scales = VideoContentScale::all ();
_scale->wrapped()->Clear ();
- for (vector<VideoContentScale>::iterator i = scales.begin(); i != scales.end(); ++i) {
- _scale->wrapped()->Append (std_to_wx (i->name ()));
+ BOOST_FOREACH (VideoContentScale const & i, VideoContentScale::all ()) {
+ _scale->wrapped()->Append (std_to_wx (i.name ()));
}
_frame_type->wrapped()->Append (_("2D"));
}
} else if (property == VideoContentProperty::VIDEO_FADE_IN) {
set<Frame> check;
- for (VideoContentList::const_iterator i = vc.begin (); i != vc.end(); ++i) {
- check.insert ((*i)->fade_in ());
+ BOOST_FOREACH (shared_ptr<const VideoContent> i, vc) {
+ check.insert (i->fade_in ());
}
if (check.size() == 1) {
}
} else if (property == VideoContentProperty::VIDEO_FADE_OUT) {
set<Frame> check;
- for (VideoContentList::const_iterator i = vc.begin (); i != vc.end(); ++i) {
- check.insert ((*i)->fade_out ());
+ BOOST_FOREACH (shared_ptr<const VideoContent> i, vc) {
+ check.insert (i->fade_out ());
}
if (check.size() == 1) {
void
VideoPanel::fade_in_changed ()
{
- VideoContentList vc = _parent->selected_video ();
- for (VideoContentList::const_iterator i = vc.begin(); i != vc.end(); ++i) {
+ BOOST_FOREACH (shared_ptr<VideoContent> i, _parent->selected_video ()) {
int const vfr = _parent->film()->video_frame_rate ();
- (*i)->set_fade_in (_fade_in->get (vfr).frames_round (vfr));
+ i->set_fade_in (_fade_in->get (vfr).frames_round (vfr));
}
}
void
VideoPanel::fade_out_changed ()
{
- VideoContentList vc = _parent->selected_video ();
- for (VideoContentList::const_iterator i = vc.begin(); i != vc.end(); ++i) {
+ BOOST_FOREACH (shared_ptr<VideoContent> i, _parent->selected_video ()) {
int const vfr = _parent->film()->video_frame_rate ();
- (*i)->set_fade_out (_fade_out->get (vfr).frames_round (vfr));
+ i->set_fade_out (_fade_out->get (vfr).frames_round (vfr));
}
}
#include "content_sub_panel.h"
#include "content_widget.h"
#include "timecode.h"
+#include "lib/video_content_scale.h"
#include "lib/film.h"
class wxChoice;