diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc index ddfc7a0973..e698110de4 100644 --- a/gtk2_ardour/editor_canvas.cc +++ b/gtk2_ardour/editor_canvas.cc @@ -623,19 +623,19 @@ Editor::session_gui_extents (bool use_extra) const boost::shared_ptr rl = _session->get_routes(); for (RouteList::iterator r = rl->begin(); r != rl->end(); ++r) { boost::shared_ptr tr = boost::dynamic_pointer_cast (*r); - if (tr) { - boost::shared_ptr pl = tr->playlist(); - if (pl && !pl->all_regions_empty()) { - pair e; - e = pl->get_extent(); - if (e.first < session_extent_start) { - session_extent_start = e.first; - } - if (e.second > session_extent_end) { - session_extent_end = e.second; - } - } + if (!tr) { + continue; } + if (tr->presentation_info ().hidden ()) { + continue; + } + pair e = tr->playlist()->get_extent (); + if (e.first == e.second) { + /* no regions present */ + continue; + } + session_extent_start = std::min (session_extent_start, e.first); + session_extent_end = std::max (session_extent_end, e.second); } } diff --git a/gtk2_ardour/public_editor.h b/gtk2_ardour/public_editor.h index af26f69d83..0a0c036d6b 100644 --- a/gtk2_ardour/public_editor.h +++ b/gtk2_ardour/public_editor.h @@ -480,6 +480,8 @@ public: virtual void get_pointer_position (double &, double &) const = 0; + virtual std::pair session_gui_extents (bool use_extra = true) const = 0; + virtual ARDOUR::Location* find_location_from_marker (ArdourMarker*, bool&) const = 0; virtual ArdourMarker* find_marker_from_location_id (PBD::ID const&, bool) const = 0;