From: Carl Hetherington Date: Fri, 8 Aug 2014 19:00:15 +0000 (+0100) Subject: Allow support for changing timing details on multiple content simultaneously. X-Git-Tag: v2.0.48~561^2~92 X-Git-Url: https://git.carlh.net/gitweb/?a=commitdiff_plain;h=864467b923a8df73af37e3f662d2889735a7f95d;p=dcpomatic.git Allow support for changing timing details on multiple content simultaneously. --- diff --git a/ChangeLog b/ChangeLog index 7113e0fda..af4d9046e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2014-08-08 Carl Hetherington + * Approximate support for changing timing details of multiple + bits of content at the same time. + * Allow removal of multiple bits of content at the same time. * Version 1.72.7 released. diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc index bbf1fc8d5..98d30a2a3 100644 --- a/src/wx/film_editor.cc +++ b/src/wx/film_editor.cc @@ -872,7 +872,7 @@ FilmEditor::setup_content_sensitivity () _video_panel->Enable (!video_selection.empty() && _generally_sensitive); _audio_panel->Enable (!audio_selection.empty() && _generally_sensitive); _subtitle_panel->Enable (selection.size() == 1 && dynamic_pointer_cast (selection.front()) && _generally_sensitive); - _timing_panel->Enable (selection.size() == 1 && _generally_sensitive); + _timing_panel->Enable (!selection.empty() && _generally_sensitive); } ContentList @@ -880,6 +880,13 @@ FilmEditor::selected_content () { ContentList sel; long int s = -1; + + /* The list was populated using a sorted content list, so we must sort it here too + so that we can look up by index and get the right thing. + */ + ContentList content = _film->content (); + sort (content.begin(), content.end(), ContentSorter ()); + while (true) { s = _content->GetNextItem (s, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); if (s == -1) { @@ -887,7 +894,7 @@ FilmEditor::selected_content () } if (s < int (_film->content().size ())) { - sel.push_back (_film->content()[s]); + sel.push_back (content[s]); } } diff --git a/src/wx/timecode.cc b/src/wx/timecode.cc index ee5b5604b..166446d8c 100644 --- a/src/wx/timecode.cc +++ b/src/wx/timecode.cc @@ -121,6 +121,16 @@ Timecode::get (int fps) const return t; } +void +Timecode::clear () +{ + checked_set (_hours, ""); + checked_set (_minutes, ""); + checked_set (_seconds, ""); + checked_set (_frames, ""); + _fixed->SetLabel (""); +} + void Timecode::changed () { diff --git a/src/wx/timecode.h b/src/wx/timecode.h index 880b44a31..d0e8176f2 100644 --- a/src/wx/timecode.h +++ b/src/wx/timecode.h @@ -28,6 +28,7 @@ public: void set (Time, int); Time get (int) const; + void clear (); void set_editable (bool); diff --git a/src/wx/timing_panel.cc b/src/wx/timing_panel.cc index ef963bbfc..38891fb0e 100644 --- a/src/wx/timing_panel.cc +++ b/src/wx/timing_panel.cc @@ -27,6 +27,7 @@ using std::cout; using std::string; +using std::set; using boost::shared_ptr; using boost::dynamic_pointer_cast; using libdcp::raw_convert; @@ -78,67 +79,117 @@ void TimingPanel::film_content_changed (int property) { ContentList cl = _editor->selected_content (); - shared_ptr content; - if (cl.size() == 1) { - content = cl.front (); - } - int const film_video_frame_rate = _editor->film()->video_frame_rate (); + + /* Here we check to see if we have exactly one different value of various + properties, and fill the controls with that value if so. + */ if (property == ContentProperty::POSITION) { - if (content) { - _position->set (content->position (), film_video_frame_rate); + + set