diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index 0020542b71..58089a090b 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -1615,7 +1615,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop mutable bool have_looped; ///< Used in ::audible_frame(*) - void update_have_rec_enabled_track (); + void update_route_active_state (); gint _have_rec_enabled_track; gint _have_rec_disabled_track; diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index b41f7733aa..f2ae01bcb5 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -2774,6 +2774,8 @@ Session::add_routes (RouteList& new_routes, bool input_auto_connect, bool output reassign_track_numbers(); + update_route_active_state (); + RouteAdded (new_routes); /* EMIT SIGNAL */ } @@ -2840,7 +2842,7 @@ Session::add_routes_inner (RouteList& new_routes, bool input_auto_connect, bool tr->PlaylistChanged.connect_same_thread (*this, boost::bind (&Session::track_playlist_changed, this, boost::weak_ptr (tr))); track_playlist_changed (boost::weak_ptr (tr)); - tr->RecordEnableChanged.connect_same_thread (*this, boost::bind (&Session::update_have_rec_enabled_track, this)); + tr->RecordEnableChanged.connect_same_thread (*this, boost::bind (&Session::update_route_active_state, this)); boost::shared_ptr mt = boost::dynamic_pointer_cast (tr); if (mt) { @@ -3210,6 +3212,8 @@ Session::remove_route (boost::shared_ptr route) save_history (_current_snapshot_name); } reassign_track_numbers(); + + update_route_active_state (); } void @@ -5169,7 +5173,7 @@ Session::have_rec_disabled_track () const /** Update the state of our rec-enabled tracks flag */ void -Session::update_have_rec_enabled_track () +Session::update_route_active_state () { boost::shared_ptr rl = routes.reader (); RouteList::iterator i = rl->begin(); @@ -5246,7 +5250,8 @@ Session::route_added_to_route_group (RouteGroup* rg, boost::weak_ptr r) void Session::route_removed_from_route_group (RouteGroup* rg, boost::weak_ptr r) { - RouteRemovedFromRouteGroup (rg, r); + update_route_active_state (); + RouteRemovedFromRouteGroup (rg, r); /* EMIT SIGNAL */ } boost::shared_ptr diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index f105cc4507..eefc488193 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -1361,7 +1361,7 @@ Session::set_state (const XMLNode& node, int version) ControlProtocolManager::instance().set_state (*child, version); } - update_have_rec_enabled_track (); + update_route_active_state (); /* here beginneth the second phase ... */