From 9c6984dbbb5583147788876dba80e203c2d38d1a Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 19 May 2006 20:10:35 +0000 Subject: allow for mandatory control protocols, plus some ongoing work on automation control point selection (unfinished) git-svn-id: svn://localhost/trunk/ardour2@516 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/control_protocol_manager.cc | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'libs/ardour/control_protocol_manager.cc') diff --git a/libs/ardour/control_protocol_manager.cc b/libs/ardour/control_protocol_manager.cc index 6f3cb4e457..123bc5cdb8 100644 --- a/libs/ardour/control_protocol_manager.cc +++ b/libs/ardour/control_protocol_manager.cc @@ -45,7 +45,7 @@ ControlProtocolManager::set_session (Session& s) _session->going_away.connect (mem_fun (*this, &ControlProtocolManager::drop_session)); for (list::iterator i = control_protocol_info.begin(); i != control_protocol_info.end(); ++i) { - if ((*i)->requested) { + if ((*i)->requested || (*i)->mandatory) { instantiate (**i); (*i)->requested = false; } @@ -102,6 +102,10 @@ ControlProtocolManager::teardown (ControlProtocolInfo& cpi) return 0; } + if (cpi.mandatory) { + return 0; + } + cpi.descriptor->destroy (cpi.descriptor, cpi.protocol); { @@ -124,6 +128,21 @@ static bool protocol_filter (const string& str, void *arg) return str[0] != '.' && (str.length() > 3 && str.find (".so") == (str.length() - 3)); } +void +ControlProtocolManager::load_mandatory_protocols () +{ + if (_session == 0) { + return; + } + + for (list::iterator i = control_protocol_info.begin(); i != control_protocol_info.end(); ++i) { + if ((*i)->mandatory && ((*i)->protocol == 0)) { + info << string_compose (_("Instantiating mandatory control protocol %1"), (*i)->name) << endmsg; + instantiate (**i); + } + } +} + void ControlProtocolManager::discover_control_protocols (string path) { @@ -156,13 +175,13 @@ ControlProtocolManager::control_protocol_discover (string path) info->path = path; info->protocol = 0; info->requested = false; + info->mandatory = descriptor->mandatory; control_protocol_info.push_back (info); cerr << "discovered control surface protocol \"" << info->name << '"' << endl; dlclose (descriptor->module); - } return 0; -- cgit v1.2.3