diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-03-25 00:14:10 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-03-25 00:14:10 +0000 |
| commit | eba0d9ca54fcfd269e61ab7b47d2e741735f6f3e (patch) | |
| tree | 343c303bb362eb9867b62be9d2e526f3772f2f89 /src | |
| parent | 282c2252e7dd20f9975d6505808ab1aefbaa034c (diff) | |
Hand-apply 3e3d3e46a74af7b3e6431033c7c80bd058c02cf6update; full/play
length in the timing panel when the DCP frame rate is changed.
Diffstat (limited to 'src')
| -rw-r--r-- | src/wx/timing_panel.cc | 65 | ||||
| -rw-r--r-- | src/wx/timing_panel.h | 3 |
2 files changed, 48 insertions, 20 deletions
diff --git a/src/wx/timing_panel.cc b/src/wx/timing_panel.cc index 1b1c4b893..b466da842 100644 --- a/src/wx/timing_panel.cc +++ b/src/wx/timing_panel.cc @@ -135,6 +135,40 @@ TimingPanel::TimingPanel (ContentPanel* p) } 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 ()); + } + + if (check.size() == 1) { + _full_length->set (cl.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 ()); + } + + if (check.size() == 1) { + _play_length->set (cl.front()->length_after_trim (), _parent->film()->video_frame_rate ()); + } else { + _play_length->clear (); + } +} + +void TimingPanel::film_content_changed (int property) { ContentList cl = _parent->selected (); @@ -163,16 +197,7 @@ TimingPanel::film_content_changed (int property) property == VideoContentProperty::VIDEO_FRAME_TYPE ) { - set<DCPTime> check; - for (ContentList::const_iterator i = cl.begin (); i != cl.end(); ++i) { - check.insert ((*i)->full_length ()); - } - - if (check.size() == 1) { - _full_length->set (cl.front()->full_length (), film_video_frame_rate); - } else { - _full_length->clear (); - } + update_full_length (); } else if (property == ContentProperty::TRIM_START) { @@ -209,16 +234,7 @@ TimingPanel::film_content_changed (int property) property == VideoContentProperty::VIDEO_FRAME_TYPE ) { - set<DCPTime> check; - for (ContentList::const_iterator i = cl.begin (); i != cl.end(); ++i) { - check.insert ((*i)->length_after_trim ()); - } - - if (check.size() == 1) { - _play_length->set (cl.front()->length_after_trim (), film_video_frame_rate); - } else { - _play_length->clear (); - } + update_play_length (); } if (property == VideoContentProperty::VIDEO_FRAME_RATE) { @@ -340,3 +356,12 @@ TimingPanel::content_selection_changed () film_content_changed (ContentProperty::TRIM_END); film_content_changed (VideoContentProperty::VIDEO_FRAME_RATE); } + +void +TimingPanel::film_changed (Film::Property p) +{ + if (p == Film::VIDEO_FRAME_RATE) { + update_full_length (); + update_play_length (); + } +} diff --git a/src/wx/timing_panel.h b/src/wx/timing_panel.h index 00b7f84e7..5f7095d8c 100644 --- a/src/wx/timing_panel.h +++ b/src/wx/timing_panel.h @@ -25,6 +25,7 @@ class TimingPanel : public ContentSubPanel public: TimingPanel (ContentPanel *); + void film_changed (Film::Property); void film_content_changed (int); void content_selection_changed (); @@ -36,6 +37,8 @@ private: void play_length_changed (); void video_frame_rate_changed (); void set_video_frame_rate (); + void update_full_length (); + void update_play_length (); Timecode<DCPTime>* _position; Timecode<DCPTime>* _full_length; |
