From 54cbc45a5a40f4eefd64fa41ad9029f5f8f6a84f Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 25 Nov 2010 23:46:24 +0000 Subject: Prevent removal of route inputs when the plugins cannot be configured with the new number. Rework locking so that the process lock is held from the point that a route input is removed until after the processors are reconfigured; fixes #3548. git-svn-id: svn://localhost/ardour2/branches/3.0@8089 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/port_matrix.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'gtk2_ardour/port_matrix.cc') diff --git a/gtk2_ardour/port_matrix.cc b/gtk2_ardour/port_matrix.cc index 113a11c116..052a26c25c 100644 --- a/gtk2_ardour/port_matrix.cc +++ b/gtk2_ardour/port_matrix.cc @@ -25,6 +25,7 @@ #include #include #include +#include #include "ardour/bundle.h" #include "ardour/types.h" #include "ardour/session.h" @@ -33,6 +34,7 @@ #include "port_matrix.h" #include "port_matrix_body.h" #include "port_matrix_component.h" +#include "ardour_dialog.h" #include "i18n.h" #include "gui_thread.h" #include "utils.h" @@ -686,7 +688,16 @@ PortMatrix::remove_channel (ARDOUR::BundleChannel b) if (io) { Port* p = io->nth (b.channel); if (p) { - io->remove_port (p, this); + int const r = io->remove_port (p, this); + if (r == -1) { + ArdourDialog d (_("Port removal not allowed")); + Label l (_("This port cannot be removed, as the first plugin in the track or buss cannot accept the new number of inputs.")); + d.get_vbox()->pack_start (l); + d.add_button (Stock::OK, RESPONSE_ACCEPT); + d.set_modal (true); + d.show_all (); + d.run (); + } } } } -- cgit v1.2.3