#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>
} else if (boost::dynamic_pointer_cast<Send> (*r) != 0) {
++send_cnt;
- } else if (boost::dynamic_pointer_cast<InternalSend> (*r) != 0) {
- ++send_cnt;
}
}
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) {
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);
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 ()
{