X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Feditor_selection.cc;h=b5a0be1c7869aa3e19c71a5a83c8ef282ac08bdb;hb=cbe342c3570d1ddb3acab4a3f0a731afa8ffb86d;hp=2eb0279f46ab4fd02ccc99ff23d1cf93c780df43;hpb=4f2dc77f6f6b5b0de07304e8a4981ff1298ef090;p=ardour.git diff --git a/gtk2_ardour/editor_selection.cc b/gtk2_ardour/editor_selection.cc index 2eb0279f46..b5a0be1c78 100644 --- a/gtk2_ardour/editor_selection.cc +++ b/gtk2_ardour/editor_selection.cc @@ -30,6 +30,7 @@ #include "ardour/route_group.h" #include "ardour/selection.h" #include "ardour/session.h" +#include "ardour/vca.h" #include "editor.h" #include "editor_drag.h" @@ -1000,6 +1001,12 @@ struct SelectionOrderSorter { void Editor::presentation_info_changed (PropertyChange const & what_changed) { + uint32_t n_tracks = 0; + uint32_t n_busses = 0; + uint32_t n_vcas = 0; + uint32_t n_routes = 0; + uint32_t n_stripables = 0; + /* We cannot ensure ordering of the handlers for * PresentationInfo::Changed, so we have to do everything in order * here, as a single handler. @@ -1047,6 +1054,18 @@ Editor::presentation_info_changed (PropertyChange const & what_changed) continue; } + n_stripables++; + + if (boost::dynamic_pointer_cast ((*i).stripable)) { + n_tracks++; + n_routes++; + } else if (boost::dynamic_pointer_cast ((*i).stripable)) { + n_busses++; + n_routes++; + } else if (boost::dynamic_pointer_cast ((*i).stripable)) { + n_vcas++; + } + TimeAxisView* tav = dynamic_cast (av); if (!tav) { @@ -1082,7 +1101,11 @@ Editor::presentation_info_changed (PropertyChange const & what_changed) stripables->push_back ((*i).stripable); } - ActionManager::set_sensitive (ActionManager::track_selection_sensitive_actions, !selection->tracks.empty()); + ActionManager::set_sensitive (ActionManager::stripable_selection_sensitive_actions, (n_stripables > 0)); + ActionManager::set_sensitive (ActionManager::track_selection_sensitive_actions, (n_tracks > 0)); + ActionManager::set_sensitive (ActionManager::bus_selection_sensitive_actions, (n_busses > 0)); + ActionManager::set_sensitive (ActionManager::route_selection_sensitive_actions, (n_routes > 0)); + ActionManager::set_sensitive (ActionManager::vca_selection_sensitive_actions, (n_vcas > 0)); sensitize_the_right_region_actions (false);