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 | |
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')
-rw-r--r-- | libs/ardour/ardour/session.h | 1 | ||||
-rw-r--r-- | libs/ardour/midi_ui.cc | 12 | ||||
-rw-r--r-- | libs/ardour/session_state.cc | 35 |
3 files changed, 48 insertions, 0 deletions
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index b72822bd1c..a21bc04690 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -769,6 +769,7 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi /* Controllables */ boost::shared_ptr<PBD::Controllable> controllable_by_id (const PBD::ID&); + boost::shared_ptr<PBD::Controllable> controllable_by_uri (const std::string&); void add_controllable (boost::shared_ptr<PBD::Controllable>); void remove_controllable (PBD::Controllable*); diff --git a/libs/ardour/midi_ui.cc b/libs/ardour/midi_ui.cc index aa81ff2068..fb85309ee1 100644 --- a/libs/ardour/midi_ui.cc +++ b/libs/ardour/midi_ui.cc @@ -68,6 +68,12 @@ MidiControlUI::do_request (MidiUIRequest* req) } else if (req->type == CallSlot) { +#ifndef NDEBUG + if (getenv ("DEBUG_THREADED_SIGNALS")) { + cerr << "MIDI UI calls a slot\n"; + } +#endif + req->the_slot (); } else if (req->type == Quit) { @@ -149,6 +155,12 @@ MidiControlUI::thread_init () { struct sched_param rtparam; + char* c = new char[7]; + strcpy (c, X_("midiUI")); + pthread_set_name (c); + + cerr << "MIDI UI running\n"; + PBD::notify_gui_about_thread_creation (X_("gui"), pthread_self(), X_("MIDI"), 2048); SessionEvent::create_per_thread_pool (X_("MIDI I/O"), 128); 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) { |