tweak "visible track count", take automation lanes into account.
authorRobin Gareus <robin@gareus.org>
Wed, 19 Jul 2017 18:37:57 +0000 (20:37 +0200)
committerRobin Gareus <robin@gareus.org>
Wed, 19 Jul 2017 20:15:22 +0000 (22:15 +0200)
gtk2_ardour/editor.cc

index 712e1a8f1f624e7b9fe992eb6d5b482515e11624..8fc9257fc52712c1e49649f4d888e63aeb4c5310 100644 (file)
@@ -3812,11 +3812,21 @@ Editor::set_visible_track_count (int32_t n)
                str = s.str();
        } else if (_visible_track_count == 0) {
                uint32_t n = 0;
-               for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
+               for (TrackViewList::const_iterator i = track_views.begin(); i != track_views.end(); ++i) {
                        if ((*i)->marked_for_display()) {
                                ++n;
+                               TimeAxisView::Children cl ((*i)->get_child_list ());
+                               for (TimeAxisView::Children::const_iterator j = cl.begin(); j != cl.end(); ++j) {
+                                       if ((*j)->marked_for_display()) {
+                                               ++n;
+                                       }
+                               }
                        }
                }
+               if (n == 0) {
+                       visible_tracks_selector.set_text (X_("*"));
+                       return;
+               }
                h = trackviews_height() / n;
                str = _("All");
        } else {