diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2009-12-28 16:49:44 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2009-12-28 16:49:44 +0000 |
commit | 109acd156861b7a792f5c4c8b3a9cc96b6ba3eaf (patch) | |
tree | 6a9c67ba9dd64802e2b5d94748bd9a8dcce18586 /libs/ardour/session_state.cc | |
parent | cba3ca64b359b32909bc29f5fe75e8e2fd9c83d8 (diff) |
MIDI binding maps make their debut
git-svn-id: svn://localhost/ardour2/branches/3.0@6408 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/session_state.cc')
-rw-r--r-- | libs/ardour/session_state.cc | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 9394cd7bec..8ff076f759 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -2678,6 +2678,41 @@ Session::controllable_by_id (const PBD::ID& id) return boost::shared_ptr<Controllable>(); } +boost::shared_ptr<Controllable> +Session::controllable_by_uri (const std::string& uri) +{ + boost::shared_ptr<Controllable> c; + string::size_type last_slash; + string useful_part; + + if ((last_slash = uri.find_last_of ('/')) == string::npos) { + return c; + } + + useful_part = uri.substr (last_slash+1); + + uint32_t rid; + char what[64]; + + if (sscanf (useful_part.c_str(), "rid=%" PRIu32 "?%63s", &rid, what) != 2) { + return c; + } + + boost::shared_ptr<Route> r = route_by_remote_id (rid); + + if (!r) { + return c; + } + + if (strncmp (what, "gain", 4) == 0) { + c = r->gain_control (); + } else if (strncmp (what, "pan", 3) == 0) { + } else if (strncmp (what, "plugin", 6) == 0) { + } + + return c; +} + void Session::add_instant_xml (XMLNode& node, bool write_to_config) { |