Hand-apply 3e3d3e46a74af7b3e6431033c7c80bd058c02cf6update; full/play
authorCarl Hetherington <cth@carlh.net>
Wed, 25 Mar 2015 00:14:10 +0000 (00:14 +0000)
committerCarl Hetherington <cth@carlh.net>
Wed, 25 Mar 2015 00:14:10 +0000 (00:14 +0000)
length in the timing panel when the DCP frame rate is changed.

ChangeLog
TO_PORT
src/wx/timing_panel.cc
src/wx/timing_panel.h

index 1633b6a03ba4acf9563028b87210d31faf6e4b67..86d8c071cc939a5e1d6f0e9331135c77c6396991 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2015-03-25  Carl Hetherington  <cth@carlh.net>
+
+       * Hand-apply 3e3d3e46a74af7b3e6431033c7c80bd058c02cf6update;
+       full/play length in the timing panel when the DCP frame rate is
+       changed.
+
 2015-03-24  Carl Hetherington  <cth@carlh.net>
 
        * Hand-apply 31eafa8a121b8d341d198e4fe426ee843cc70167; add a note
 2015-03-24  Carl Hetherington  <cth@carlh.net>
 
        * Hand-apply 31eafa8a121b8d341d198e4fe426ee843cc70167; add a note
diff --git a/TO_PORT b/TO_PORT
index 91010a896bc409b41db58c70dbb1113dfe829a2e..83ea9c7b5b856f567485d639c471fb969fa670f2 100644 (file)
--- a/TO_PORT
+++ b/TO_PORT
@@ -1,4 +1,3 @@
-3e3d3e46a74af7b3e6431033c7c80bd058c02cf6
 ec3e6abf817b84d589f0782b01f5059dd3bf0953
 f4673814cfa26884d113f93f347d97868e9e585a
 24ae3a8f0a68529b50c34079e643caf6b9327523
 ec3e6abf817b84d589f0782b01f5059dd3bf0953
 f4673814cfa26884d113f93f347d97868e9e585a
 24ae3a8f0a68529b50c34079e643caf6b9327523
index 1b1c4b8934f936ea3a45bd9cc80104413a44dcd7..b466da8427aeefe539eb604f8eb4cd4aa225911c 100644 (file)
@@ -134,6 +134,40 @@ TimingPanel::TimingPanel (ContentPanel* p)
        _set_video_frame_rate->Bind   (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&TimingPanel::set_video_frame_rate, this));
 }
 
        _set_video_frame_rate->Bind   (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&TimingPanel::set_video_frame_rate, this));
 }
 
+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)
 {
 void
 TimingPanel::film_content_changed (int property)
 {
@@ -163,16 +197,7 @@ TimingPanel::film_content_changed (int property)
                property == VideoContentProperty::VIDEO_FRAME_TYPE
                ) {
 
                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) {
 
 
        } else if (property == ContentProperty::TRIM_START) {
 
@@ -209,16 +234,7 @@ TimingPanel::film_content_changed (int property)
                property == VideoContentProperty::VIDEO_FRAME_TYPE
                ) {
 
                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) {
        }
 
        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);
 }
        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 ();
+       }
+}
index 00b7f84e75f63e09b13a38a8afa1cfc8bc2f1971..5f7095d8c369ff2eee2d887e436be178e1886c86 100644 (file)
@@ -25,6 +25,7 @@ class TimingPanel : public ContentSubPanel
 public:
        TimingPanel (ContentPanel *);
 
 public:
        TimingPanel (ContentPanel *);
 
+       void film_changed (Film::Property);
        void film_content_changed (int);
        void content_selection_changed ();
        
        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 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;
        
        Timecode<DCPTime>* _position;
        Timecode<DCPTime>* _full_length;