Remove always-true should_show_selection code.
[ardour.git] / gtk2_ardour / editor.cc
index f7c48daf3b00509bc3dfb57d74072a8f45d978cf..9cb680463e9cb3be426403490cddb5c1f0b91246 100644 (file)
@@ -1523,16 +1523,18 @@ Editor::build_track_region_context_menu ()
        region_edit_menu_split_item = 0;
        region_edit_menu_split_multichannel_item = 0;
 
+       /* we might try to use items that are currently attached to a crossfade menu,
+          so clear that, too.
+       */
+       track_crossfade_context_menu.items().clear ();
+
        RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (clicked_axisview);
 
        if (rtv) {
                boost::shared_ptr<Track> tr;
                boost::shared_ptr<Playlist> pl;
 
-               /* Don't offer a region submenu if we are in internal edit mode, as we don't select regions in this
-                  mode and so offering region context is somewhat confusing.
-               */
-               if ((tr = rtv->track()) && ((pl = tr->playlist())) && !internal_editing()) {
+               if ((tr = rtv->track()) && ((pl = tr->playlist()))) {
                        framepos_t const framepos = (framepos_t) floor ((double) get_preferred_edit_position() * tr->speed());
                        uint32_t regions_at = pl->count_regions_at (framepos);
                        add_region_context_items (edit_items, regions_at > 1);
@@ -1551,6 +1553,11 @@ Editor::build_track_crossfade_context_menu ()
        MenuList& edit_items  = track_crossfade_context_menu.items();
        edit_items.clear ();
 
+       /* we might try to use items that are currently attached to a crossfade menu,
+          so clear that, too.
+       */
+       track_region_context_menu.items().clear ();
+
        AudioTimeAxisView* atv = dynamic_cast<AudioTimeAxisView*> (clicked_axisview);
 
        if (atv) {
@@ -4808,6 +4815,12 @@ Editor::region_view_added (RegionView *)
        _summary->set_dirty ();
 }
 
+void
+Editor::region_view_removed ()
+{
+       _summary->set_dirty ();
+}
+
 TimeAxisView*
 Editor::axis_view_from_route (boost::shared_ptr<Route> r) const
 {
@@ -4873,6 +4886,7 @@ Editor::handle_new_route (RouteList& routes)
                rtv->effective_gain_display ();
 
                rtv->view()->RegionViewAdded.connect (sigc::mem_fun (*this, &Editor::region_view_added));
+               rtv->view()->RegionViewRemoved.connect (sigc::mem_fun (*this, &Editor::region_view_removed));
        }
 
        _routes->routes_added (new_views);