diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2006-05-19 20:10:35 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2006-05-19 20:10:35 +0000 |
commit | 9c6984dbbb5583147788876dba80e203c2d38d1a (patch) | |
tree | 4db0a08b1049f8ddd8f237c85474568e8a62e099 /libs/ardour/control_protocol_manager.cc | |
parent | 50ee09e80ff91bf0146e89728578d5e31aba23b7 (diff) |
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
Diffstat (limited to 'libs/ardour/control_protocol_manager.cc')
-rw-r--r-- | libs/ardour/control_protocol_manager.cc | 23 |
1 files changed, 21 insertions, 2 deletions
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<ControlProtocolInfo*>::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); { @@ -125,6 +129,21 @@ static bool protocol_filter (const string& str, void *arg) } void +ControlProtocolManager::load_mandatory_protocols () +{ + if (_session == 0) { + return; + } + + for (list<ControlProtocolInfo*>::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) { vector<string *> *found; @@ -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; |