Add basic timeline window.
[dcpomatic.git] / src / lib / video_content.cc
index 14897c5706a68852873abe090ef617d39a66f6ce..2af6ba908c68eb7366e99307f40dcf5cafb21406 100644 (file)
@@ -73,7 +73,7 @@ VideoContent::take_from_video_decoder (shared_ptr<VideoDecoder> d)
 {
        /* These decoder calls could call other content methods which take a lock on the mutex */
        libdcp::Size const vs = d->native_size ();
-       float const vfr = d->frames_per_second ();
+       float const vfr = d->video_frame_rate ();
        
         {
                 boost::mutex::scoped_lock lm (_mutex);
@@ -81,14 +81,18 @@ VideoContent::take_from_video_decoder (shared_ptr<VideoDecoder> d)
                _video_frame_rate = vfr;
         }
         
-        Changed (VideoContentProperty::VIDEO_SIZE);
-        Changed (VideoContentProperty::VIDEO_FRAME_RATE);
+        signal_changed (VideoContentProperty::VIDEO_SIZE);
+        signal_changed (VideoContentProperty::VIDEO_FRAME_RATE);
 }
 
 
 string
 VideoContent::information () const
 {
+       if (video_size().width == 0 || video_size().height == 0) {
+               return "";
+       }
+       
        stringstream s;
 
        s << String::compose (
@@ -100,3 +104,9 @@ VideoContent::information () const
        
        return s.str ();
 }
+
+Time
+VideoContent::temporal_length () const
+{
+       return video_length() / video_frame_rate();
+}