Untested use of Frame for video/audio content lengths.
[dcpomatic.git] / src / wx / timing_panel.cc
index b466da8427aeefe539eb604f8eb4cd4aa225911c..74c1756a5205221edc15dbec4fd585a07d833961 100644 (file)
 
 #include "lib/content.h"
 #include "lib/image_content.h"
+#include "lib/raw_convert.h"
 #include "timing_panel.h"
 #include "wx_util.h"
 #include "timecode.h"
 #include "content_panel.h"
-#include <dcp/raw_convert.h>
 #include <set>
 
 using std::cout;
@@ -31,7 +31,6 @@ using std::string;
 using std::set;
 using boost::shared_ptr;
 using boost::dynamic_pointer_cast;
-using dcp::raw_convert;
 
 TimingPanel::TimingPanel (ContentPanel* p)
        /* horrid hack for apparent lack of context support with wxWidgets i18n code */
@@ -248,10 +247,10 @@ TimingPanel::film_content_changed (int property)
                        }
                }
                if (check.size() == 1) {
-                       _video_frame_rate->SetValue (std_to_wx (raw_convert<string> (vc->video_frame_rate (), 5)));
+                       checked_set (_video_frame_rate, raw_convert<string> (vc->video_frame_rate (), 5));
                        _video_frame_rate->Enable (true);
                } else {
-                       _video_frame_rate->SetValue ("");
+                       checked_set (_video_frame_rate, wxT (""));
                        _video_frame_rate->Enable (false);
                }
        }
@@ -285,8 +284,8 @@ TimingPanel::full_length_changed ()
        for (ContentList::iterator i = c.begin(); i != c.end(); ++i) {
                shared_ptr<ImageContent> ic = dynamic_pointer_cast<ImageContent> (*i);
                if (ic && ic->still ()) {
-                       /* XXX: No effective FRC here... is this right? */
-                       ic->set_video_length (ContentTime (_full_length->get (_parent->film()->video_frame_rate()), FrameRateChange (1, 1)));
+                       int const vfr = _parent->film()->video_frame_rate ();
+                       ic->set_video_length (_full_length->get (vfr).frames (vfr));
                }
        }
 }