From 5f88cbfd39601f2f660d0958a4f6d84231034ca2 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 17 Mar 2020 22:30:11 +0100 Subject: Prevent adding routes in read-only sessions "AddTrackBus" is a rec_sensitive and write_sensitive action. However the mixer bypasses this and unconditionally calls ARDOUR_UI::instance()->add_route () in various cases (right-click on blank space or scroller, left-click on "Add" buttons in the VCA pane, route pane, etc). Since those are direct events, not related actions, they need to be explicitly ignored. Ideally the "+" buttons would be made insensitive... --- gtk2_ardour/ardour_ui.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 5ed6778e65..b9bca8c988 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -2614,12 +2614,12 @@ ARDOUR_UI::start_duplicate_routes () void ARDOUR_UI::add_route () { - if (!add_route_dialog.get (false)) { - add_route_dialog->signal_response().connect (sigc::mem_fun (*this, &ARDOUR_UI::add_route_dialog_response)); + if (!_session || !_session->writable() || _session->actively_recording()) { + return; } - if (!_session) { - return; + if (!add_route_dialog.get (false)) { + add_route_dialog->signal_response().connect (sigc::mem_fun (*this, &ARDOUR_UI::add_route_dialog_response)); } if (add_route_dialog->is_visible()) { -- cgit v1.2.3