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
This commit is contained in:
parent
1f8d176c13
commit
a8fbb47e0a
|
@ -106,6 +106,7 @@ typedef uint64_t microseconds_t;
|
|||
#include "global_port_matrix.h"
|
||||
#include "location_ui.h"
|
||||
#include "missing_file_dialog.h"
|
||||
#include "missing_plugin_dialog.h"
|
||||
|
||||
#include "i18n.h"
|
||||
|
||||
|
@ -2738,6 +2739,14 @@ ARDOUR_UI::load_session (const std::string& path, const std::string& snap_name,
|
|||
goto out;
|
||||
}
|
||||
|
||||
{
|
||||
list<string> const u = new_session->unknown_processors ();
|
||||
if (!u.empty()) {
|
||||
MissingPluginDialog d (_session, u);
|
||||
d.run ();
|
||||
}
|
||||
}
|
||||
|
||||
/* Now the session been created, add the transport controls */
|
||||
new_session->add_controllable(roll_controllable);
|
||||
new_session->add_controllable(stop_controllable);
|
||||
|
|
|
@ -142,6 +142,7 @@ gtk2_ardour_sources = [
|
|||
'midi_time_axis.cc',
|
||||
'midi_tracer.cc',
|
||||
'missing_file_dialog.cc',
|
||||
'missing_plugin_dialog.cc',
|
||||
'mixer_group_tabs.cc',
|
||||
'mixer_strip.cc',
|
||||
'mixer_ui.cc',
|
||||
|
|
|
@ -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; }
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -200,6 +200,7 @@ libardour_sources = [
|
|||
'ticker.cc',
|
||||
'track.cc',
|
||||
'transient_detector.cc',
|
||||
'unknown_processor.cc',
|
||||
'user_bundle.cc',
|
||||
'utils.cc',
|
||||
'vbap.cc',
|
||||
|
|
Loading…
Reference in New Issue