Be a little bit less complainy about setting state that
authorCarl Hetherington <carl@carlh.net>
Wed, 9 Nov 2011 22:26:16 +0000 (22:26 +0000)
committerCarl Hetherington <carl@carlh.net>
Wed, 9 Nov 2011 22:26:16 +0000 (22:26 +0000)
already exists; useful when the port matrix is in
show-only-bundles mode and it is to some extent
guessing what connections to make.

git-svn-id: svn://localhost/ardour2/branches/3.0@10517 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/io_selector.cc

index fea21ced0f369cd5bc7ada867f80793e49c79ab9..f77123a684f40dd9a1b8ceef8a952fd90957c15c 100644 (file)
@@ -145,9 +145,13 @@ IOSelector::set_state (ARDOUR::BundleChannel c[2], bool s)
                        }
 
                         if (s) {
-                                _io->connect (f, *j, 0);
+                               if (!f->connected_to (*j)) {
+                                       _io->connect (f, *j, 0);
+                               }
                         } else {
-                                _io->disconnect (f, *j, 0);
+                               if (f->connected_to (*j)) {
+                                       _io->disconnect (f, *j, 0);
+                               }
                         }
                }
        }