+ /* See if we have any subtitle / atmos / right-eye views */
+ bool have_3d = false;
+ bool have_subtitle = false;
+ bool have_atmos = false;
+ BOOST_FOREACH (shared_ptr<TimelineView> i, _views) {
+ shared_ptr<TimelineContentView> cv = dynamic_pointer_cast<TimelineContentView> (i);
+ if (!cv) {
+ continue;
+ }
+
+ if (dynamic_pointer_cast<TimelineVideoContentView> (i)) {
+ if (cv->content()->video->frame_type() == VIDEO_FRAME_TYPE_3D_RIGHT) {
+ have_3d = true;
+ }
+ } else if (dynamic_pointer_cast<TimelineSubtitleContentView> (i)) {
+ have_subtitle = true;
+ } else if (dynamic_pointer_cast<TimelineAtmosContentView> (i)) {
+ have_atmos = true;
+ }
+ }
+
+ _labels_view->set_3d (have_3d);
+ _labels_view->set_subtitle (have_subtitle);
+ _labels_view->set_atmos (have_atmos);
+
+ /* Hence decide where to start subtitle, atmos and audio tracks */
+ int const subtitle = have_3d ? 2 : 1;
+ int const atmos = have_subtitle ? subtitle + 1 : subtitle;
+ int const audio = have_atmos ? atmos + 1: atmos;
+