Fix timeline for DCPs containing Atmos.
[dcpomatic.git] / src / wx / timeline.cc
index 9f71847f5c626dfb7e39690c91010e19d4f54252..c9a6dc9f172e056d5e29310a98ac87fe9857ec40 100644 (file)
@@ -262,8 +262,8 @@ Timeline::recreate_views ()
                        _views.push_back (shared_ptr<TimelineView> (new TimelineTextContentView (*this, i, j)));
                }
 
-               if (dynamic_pointer_cast<AtmosMXFContent> (i)) {
-                       _views.push_back (shared_ptr<TimelineView> (new TimelineAtmosContentView (*this, i)));
+               if (i->atmos) {
+                       _views.push_back (shared_ptr<TimelineView>(new TimelineAtmosContentView(*this, i)));
                }
        }
 
@@ -420,12 +420,9 @@ Timeline::assign_tracks ()
 
        bool have_atmos = false;
        BOOST_FOREACH (shared_ptr<TimelineView> i, _views) {
-               shared_ptr<TimelineVideoContentView> cv = dynamic_pointer_cast<TimelineVideoContentView> (i);
-               if (!cv) {
-                       continue;
-               }
-               if (dynamic_pointer_cast<TimelineAtmosContentView> (i)) {
-                       cv->set_track (_tracks - 1);
+               shared_ptr<TimelineAtmosContentView> cv = dynamic_pointer_cast<TimelineAtmosContentView>(i);
+               if (cv) {
+                       cv->set_track (_tracks);
                        have_atmos = true;
                }
        }