diff options
author | Robin Gareus <robin@gareus.org> | 2020-03-17 22:30:11 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2020-03-17 22:30:58 +0100 |
commit | 5f88cbfd39601f2f660d0958a4f6d84231034ca2 (patch) | |
tree | 60f940e90420ee188bb4cbed0241555414da2b88 /gtk2_ardour/ardour_ui.cc | |
parent | 45026100aa0f2a94637aad39e7d39213738ff57a (diff) |
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...
Diffstat (limited to 'gtk2_ardour/ardour_ui.cc')
-rw-r--r-- | gtk2_ardour/ardour_ui.cc | 8 |
1 files 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()) { |