From 77cc0f7cc84df5e242898cef0abb7d633de64d8c Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 29 Dec 2009 21:31:14 +0000 Subject: editors for control protocols (generalized); editor for Generic MIDI that allows choosing a MIDI binding map (or none); support banking in binding URLs, and other miscellany related to generic MIDI; save+restore JACK_MidiPort connection state (but cause a crash at shutdown time) git-svn-id: svn://localhost/ardour2/branches/3.0@6411 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/session_state.cc | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) (limited to 'libs/ardour/session_state.cc') diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 8ff076f759..6a72777c7c 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -2679,25 +2679,9 @@ Session::controllable_by_id (const PBD::ID& id) } boost::shared_ptr -Session::controllable_by_uri (const std::string& uri) +Session::controllable_by_rid_and_name (uint32_t rid, const char* const what) { boost::shared_ptr 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 r = route_by_remote_id (rid); if (!r) { @@ -2706,8 +2690,17 @@ Session::controllable_by_uri (const std::string& uri) if (strncmp (what, "gain", 4) == 0) { c = r->gain_control (); + } else if (strncmp (what, "solo", 4) == 0) { + c = r->solo_control(); + } else if (strncmp (what, "mute", 4) == 0) { + c = r->mute_control(); } else if (strncmp (what, "pan", 3) == 0) { } else if (strncmp (what, "plugin", 6) == 0) { + } else if (strncmp (what, "recenable", 9) == 0) { + boost::shared_ptr t = boost::dynamic_pointer_cast(r); + if (t) { + c = t->rec_enable_control (); + } } return c; -- cgit v1.2.3