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 --- libs/ardour/ardour/io.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'libs/ardour/ardour/io.h') diff --git a/libs/ardour/ardour/io.h b/libs/ardour/ardour/io.h index a94149e178..9d423f55a5 100644 --- a/libs/ardour/ardour/io.h +++ b/libs/ardour/ardour/io.h @@ -133,6 +133,7 @@ class IO : public SessionObject, public Latent const ChanCount& n_ports () const { return _ports.count(); } + /** Emitted with the process lock held */ PBD::Signal2 changed; virtual XMLNode& state (bool full); @@ -140,6 +141,31 @@ class IO : public SessionObject, public Latent int set_state (const XMLNode&, int version); int set_state_2X (const XMLNode&, int, bool); + class BoolCombiner { + public: + + typedef bool result_type; + + template + bool operator() (Iter first, Iter last) const { + bool r = false; + while (first != last) { + if (*first) { + r = true; + } + ++first; + } + + return r; + } + }; + + /** Emitted when the port count is about to change. Objects + * can attach to this, and return `true' if they want to prevent + * the change from happening. + */ + PBD::Signal1 PortCountChanging; + static int disable_connecting (void); static int enable_connecting (void); static int disable_ports (void); -- cgit v1.2.3