Fix rebase onto master.
[dcpomatic.git] / src / wx / timeline.cc
index 786d70721c5549498ceffbec0314df7039282b0b..8ce811c28c3f668ea913008e16ce4c09fd631a21 100644 (file)
@@ -33,6 +33,7 @@
 #include "lib/timer.h"
 #include "lib/audio_content.h"
 #include "lib/subtitle_content.h"
+#include "lib/video_content.h"
 #include <wx/graphics.h>
 #include <boost/weak_ptr.hpp>
 #include <boost/foreach.hpp>
@@ -145,18 +146,16 @@ Timeline::recreate_views ()
        _views.push_back (_labels_view);
 
        BOOST_FOREACH (shared_ptr<Content> i, film->content ()) {
-               if (dynamic_pointer_cast<VideoContent> (i)) {
+               if (i->video) {
                        _views.push_back (shared_ptr<TimelineView> (new TimelineVideoContentView (*this, i)));
                }
 
-               shared_ptr<AudioContent> ac = dynamic_pointer_cast<AudioContent> (i);
-               if (ac && !ac->audio_mapping().mapped_output_channels().empty ()) {
+               if (i->audio && !i->audio->mapping().mapped_output_channels().empty ()) {
                        _views.push_back (shared_ptr<TimelineView> (new TimelineAudioContentView (*this, i)));
                }
 
-               shared_ptr<SubtitleContent> sc = dynamic_pointer_cast<SubtitleContent> (i);
-               if (sc && sc->has_subtitles ()) {
-                       _views.push_back (shared_ptr<TimelineView> (new TimelineSubtitleContentView (*this, sc)));
+               if (i->subtitle) {
+                       _views.push_back (shared_ptr<TimelineView> (new TimelineSubtitleContentView (*this, i)));
                }
        }
 
@@ -170,7 +169,7 @@ Timeline::film_content_changed (int property, bool frequent)
 {
        ensure_ui_thread ();
 
-       if (property == AudioContentProperty::AUDIO_STREAMS) {
+       if (property == AudioContentProperty::STREAMS) {
                recreate_views ();
        } else if (!frequent) {
                setup_pixels_per_second ();
@@ -196,8 +195,7 @@ Timeline::assign_tracks ()
 
                if (dynamic_pointer_cast<TimelineVideoContentView> (*i)) {
                        /* Video on tracks 0 and 1 (left and right eye) */
-                       shared_ptr<VideoContent> vc = dynamic_pointer_cast<VideoContent> (cv->content ());
-                       cv->set_track (vc->video_frame_type() == VIDEO_FRAME_TYPE_3D_RIGHT ? 1 : 0);
+                       cv->set_track (cv->content()->video->frame_type() == VIDEO_FRAME_TYPE_3D_RIGHT ? 1 : 0);
                        _tracks = max (_tracks, 2);
                        continue;
                } else if (dynamic_pointer_cast<TimelineSubtitleContentView> (*i)) {