Make DnD copy processors using their XML representations. Remove unused
[ardour.git] / libs / ardour / route.cc
index 452d611d87628c9bd064ffb5cfd94b2055f67f47..21b7876aca4e0da309a58c2fe052aa40651d3b69 100644 (file)
@@ -35,7 +35,6 @@
 #include <ardour/plugin_insert.h>
 #include <ardour/port_insert.h>
 #include <ardour/send.h>
-#include <ardour/internal_send.h>
 #include <ardour/session.h>
 #include <ardour/utils.h>
 #include <ardour/configuration.h>
@@ -1608,8 +1607,6 @@ Route::_reset_processor_counts (ProcessorStreams* err)
 
                } else if (boost::dynamic_pointer_cast<Send> (*r) != 0) {
                        ++send_cnt;
-               } else if (boost::dynamic_pointer_cast<InternalSend> (*r) != 0) {
-                       ++send_cnt;
                }
        }
 
@@ -1673,7 +1670,6 @@ Route::_reset_processor_counts (ProcessorStreams* err)
 
        for (r = _processors.begin(); r != _processors.end(); prev = r, ++r) {
                boost::shared_ptr<Send> s;
-               boost::shared_ptr<InternalSend> is;
 
                if ((s = boost::dynamic_pointer_cast<Send> (*r)) != 0) {
 
@@ -1687,16 +1683,6 @@ Route::_reset_processor_counts (ProcessorStreams* err)
                                s->expect_inputs ((*prev)->output_streams());
                        }
 
-               } else if ((is = boost::dynamic_pointer_cast<InternalSend> (*r)) != 0) {
-
-                       /* XXX ditto, but clean this inheritance pattern up someday soon */
-
-                       if (r == _processors.begin()) {
-                               is->expect_inputs (n_inputs());
-                       } else {
-                               is->expect_inputs ((*prev)->output_streams());
-                       }
-
                } else {
                        
                        max_audio = max ((*r)->output_streams ().n_audio(), max_audio);
@@ -1776,87 +1762,6 @@ Route::check_some_processor_counts (list<ProcessorCount>& iclist, ChanCount requ
        return false;
 }
 
-int
-Route::copy_processors (const Route& other, Placement placement, ProcessorStreams* err)
-{
-       ChanCount old_pmo = processor_max_outs;
-
-       ProcessorList to_be_deleted;
-
-       {
-               Glib::RWLock::WriterLock lm (_processor_lock);
-               ProcessorList::iterator tmp;
-               ProcessorList the_copy;
-
-               the_copy = _processors;
-               
-               /* remove all relevant processors */
-
-               for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ) {
-                       tmp = i;
-                       ++tmp;
-
-                       if ((*i)->placement() == placement) {
-                               to_be_deleted.push_back (*i);
-                               _processors.erase (i);
-                       }
-
-                       i = tmp;
-               }
-
-               /* now copy the relevant ones from "other" */
-               
-               for (ProcessorList::const_iterator i = other._processors.begin(); i != other._processors.end(); ++i) {
-                       if ((*i)->placement() == placement) {
-                               _processors.push_back (IOProcessor::clone (*i));
-                       }
-               }
-
-               /* reset plugin stream handling */
-
-               if (_reset_processor_counts (err)) {
-
-                       /* FAILED COPY ATTEMPT: we have to restore order */
-
-                       /* delete all cloned processors */
-
-                       for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ) {
-
-                               tmp = i;
-                               ++tmp;
-
-                               if ((*i)->placement() == placement) {
-                                       _processors.erase (i);
-                               }
-                               
-                               i = tmp;
-                       }
-
-                       /* restore the natural order */
-
-                       _processors = the_copy;
-                       processor_max_outs = old_pmo;
-
-                       /* we failed, even though things are OK again */
-
-                       return -1;
-
-               } else {
-                       
-                       /* SUCCESSFUL COPY ATTEMPT: delete the processors we removed pre-copy */
-                       to_be_deleted.clear ();
-                       _user_latency = 0;
-               }
-       }
-
-       if (processor_max_outs != old_pmo || old_pmo == ChanCount::ZERO) {
-               reset_panner ();
-       }
-
-       processors_changed (); /* EMIT SIGNAL */
-       return 0;
-}
-
 void
 Route::all_processors_flip ()
 {