diff options
author | Carl Hetherington <carl@carlh.net> | 2010-11-26 23:30:48 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2010-11-26 23:30:48 +0000 |
commit | a8fbb47e0ae9a27a78a00e68117139e1cc5993f0 (patch) | |
tree | 24960bb36ef2965c08c0e4954adaa5f7609fb4fa /libs/ardour/route.cc | |
parent | 1f8d176c1380951246e83d14d408c7515ca8b7ca (diff) |
Handle unknown plugins on loading sessions by hiding them from the user and telling them so.
git-svn-id: svn://localhost/ardour2/branches/3.0@8097 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/route.cc')
-rw-r--r-- | libs/ardour/route.cc | 48 |
1 files changed, 40 insertions, 8 deletions
diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 150d53a1fa..97b1402d30 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -59,6 +59,7 @@ #include "ardour/timestamps.h" #include "ardour/utils.h" #include "ardour/graph.h" +#include "ardour/unknown_processor.h" #include "i18n.h" @@ -479,6 +480,10 @@ Route::process_output_buffers (BufferSet& bufs, for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) { + if (boost::dynamic_pointer_cast<UnknownProcessor> (*i)) { + break; + } + if (bufs.count() != (*i)->input_streams()) { cerr << _name << " bufs = " << bufs.count() << " input for " << (*i)->name() << " = " << (*i)->input_streams() @@ -1512,15 +1517,16 @@ Route::try_configure_processors_unlocked (ChanCount in, ProcessorStreams* err) DEBUG_TRACE (DEBUG::Processors, string_compose ("%1: configure processors\n", _name)); DEBUG_TRACE (DEBUG::Processors, "{\n"); - for (list<boost::shared_ptr<Processor> >::const_iterator p = _processors.begin(); p != _processors.end(); ++p) { - DEBUG_TRACE (DEBUG::Processors, string_compose ("\t%1 ID = %2\n", (*p)->name(), (*p)->id())); - } - DEBUG_TRACE (DEBUG::Processors, "}\n"); for (ProcessorList::iterator p = _processors.begin(); p != _processors.end(); ++p, ++index) { + if (boost::dynamic_pointer_cast<UnknownProcessor> (*p)) { + DEBUG_TRACE (DEBUG::Processors, "--- CONFIGURE ABORTED due to unknown processor.\n"); + break; + } + if ((*p)->can_support_io_configuration(in, out)) { - DEBUG_TRACE (DEBUG::Processors, string_compose ("\t%1 in = %2 out = %3\n",(*p)->name(), in, out)); + DEBUG_TRACE (DEBUG::Processors, string_compose ("\t%1 ID=%2 in=%3 out=%4\n",(*p)->name(), (*p)->id(), in, out)); configuration.push_back(make_pair(in, out)); in = out; } else { @@ -1528,10 +1534,15 @@ Route::try_configure_processors_unlocked (ChanCount in, ProcessorStreams* err) err->index = index; err->count = in; } + DEBUG_TRACE (DEBUG::Processors, "---- CONFIGURATION FAILED.\n"); + DEBUG_TRACE (DEBUG::Processors, string_compose ("---- %1 cannot support in=%2 out=%3\n", (*p)->name(), in, out)); + DEBUG_TRACE (DEBUG::Processors, "}\n"); return list<pair<ChanCount, ChanCount> > (); } } + DEBUG_TRACE (DEBUG::Processors, "}\n"); + return configuration; } @@ -1561,6 +1572,11 @@ Route::configure_processors_unlocked (ProcessorStreams* err) list< pair<ChanCount,ChanCount> >::iterator c = configuration.begin(); for (ProcessorList::iterator p = _processors.begin(); p != _processors.end(); ++p, ++c) { + + if (boost::dynamic_pointer_cast<UnknownProcessor> (*p)) { + break; + } + (*p)->configure_io(c->first, c->second); processor_max_streams = ChanCount::max(processor_max_streams, c->first); processor_max_streams = ChanCount::max(processor_max_streams, c->second); @@ -2370,10 +2386,13 @@ Route::set_processor_state (const XMLNode& node) continue; } - if (processor->set_state (**niter, Stateful::current_state_version) == 0) { - new_order.push_back (processor); - must_configure = true; + if (processor->set_state (**niter, Stateful::current_state_version) != 0) { + /* This processor could not be configured. Turn it into a UnknownProcessor */ + processor.reset (new UnknownProcessor (_session, **niter)); } + + new_order.push_back (processor); + must_configure = true; } } } @@ -3526,4 +3545,17 @@ Route::input_port_count_changing (ChanCount to) return false; } +list<string> +Route::unknown_processors () const +{ + list<string> p; + + Glib::RWLock::ReaderLock lm (_processor_lock); + for (ProcessorList::const_iterator i = _processors.begin(); i != _processors.end(); ++i) { + if (boost::dynamic_pointer_cast<UnknownProcessor const> (*i)) { + p.push_back ((*i)->name ()); + } + } + return p; +} |