carl's patch to copy send i/o configuration when copying a send
authorPaul Davis <paul@linuxaudiosystems.com>
Mon, 24 Nov 2008 22:47:42 +0000 (22:47 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Mon, 24 Nov 2008 22:47:42 +0000 (22:47 +0000)
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@4243 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/send.cc

index 614195ac2d890659b1b8da6155910f7880f218c2..19883ba91eae8236ac11492eceeac786ae5c5db1 100644 (file)
@@ -59,6 +59,21 @@ Send::Send (const Send& other)
        _metering = false;
        expected_inputs = 0;
 
+       /* set up the same outputs, and connect them to the same places */
+       for (uint32_t i = 0; i < other.n_outputs (); ++i) {
+               add_output_port ("", 0);
+               Port* p = other.output (i);
+               if (p) {
+                       /* this is what the other send's output is connected to */
+                       const char **connections = p->get_connections ();
+                       if (connections) {
+                               for (uint32_t c = 0; connections[c]; ++c) {
+                                       connect_output (output (i), connections [c], 0);
+                               }
+                       }
+               }
+       }
+
        RedirectCreated (this); /* EMIT SIGNAL */
 }