summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-11-26 23:30:48 +0000
committerCarl Hetherington <carl@carlh.net>2010-11-26 23:30:48 +0000
commita8fbb47e0ae9a27a78a00e68117139e1cc5993f0 (patch)
tree24960bb36ef2965c08c0e4954adaa5f7609fb4fa /libs
parent1f8d176c1380951246e83d14d408c7515ca8b7ca (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')
-rw-r--r--libs/ardour/ardour/route.h6
-rw-r--r--libs/ardour/ardour/session.h2
-rw-r--r--libs/ardour/route.cc48
-rw-r--r--libs/ardour/session.cc17
-rw-r--r--libs/ardour/wscript1
5 files changed, 66 insertions, 8 deletions
diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h
index 38300a7de9..7702901523 100644
--- a/libs/ardour/ardour/route.h
+++ b/libs/ardour/ardour/route.h
@@ -46,6 +46,7 @@
#include "ardour/route_group_member.h"
#include "ardour/graphnode.h"
#include "ardour/automatable.h"
+#include "ardour/unknown_processor.h"
namespace ARDOUR {
@@ -176,6 +177,9 @@ class Route : public SessionObject, public Automatable, public RouteGroupMember,
void foreach_processor (boost::function<void(boost::weak_ptr<Processor>)> method) {
Glib::RWLock::ReaderLock lm (_processor_lock);
for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
+ if (boost::dynamic_pointer_cast<UnknownProcessor> (*i)) {
+ break;
+ }
method (boost::weak_ptr<Processor> (*i));
}
}
@@ -199,6 +203,8 @@ class Route : public SessionObject, public Automatable, public RouteGroupMember,
bool has_io_processor_named (const std::string&);
ChanCount max_processor_streams () const { return processor_max_streams; }
+ std::list<std::string> unknown_processors () const;
+
/* special processors */
boost::shared_ptr<Delivery> monitor_send() const { return _monitor_send; }
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h
index 2f0a546e5a..1f2e2f9c93 100644
--- a/libs/ardour/ardour/session.h
+++ b/libs/ardour/ardour/session.h
@@ -797,6 +797,8 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
std::string source_search_path(DataType) const;
void ensure_search_path_includes (const std::string& path, DataType type);
+ std::list<std::string> unknown_processors () const;
+
/* handlers can return an integer value:
0: config.set_audio_search_path() or config.set_midi_search_path() was used
to modify the search path and we should try to find it again.
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;
+}
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index 5190c453d6..c44db41553 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -4212,3 +4212,20 @@ Session::get_speakers()
return *_speakers;
}
+
+list<string>
+Session::unknown_processors () const
+{
+ list<string> p;
+
+ boost::shared_ptr<RouteList> r = routes.reader ();
+ for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
+ list<string> t = (*i)->unknown_processors ();
+ copy (t.begin(), t.end(), back_inserter (p));
+ }
+
+ p.sort ();
+ p.unique ();
+
+ return p;
+}
diff --git a/libs/ardour/wscript b/libs/ardour/wscript
index 3ece2d0784..17b85d15ce 100644
--- a/libs/ardour/wscript
+++ b/libs/ardour/wscript
@@ -200,6 +200,7 @@ libardour_sources = [
'ticker.cc',
'track.cc',
'transient_detector.cc',
+ 'unknown_processor.cc',
'user_bundle.cc',
'utils.cc',
'vbap.cc',