diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index dc884d9b40..0eff725a56 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -382,11 +382,13 @@ public: bool io_name_is_legal (const std::string&) const; std::shared_ptr route_by_name (std::string) const; std::shared_ptr route_by_id (PBD::ID) const; + std::shared_ptr stripable_by_name (std::string) const; std::shared_ptr stripable_by_id (PBD::ID) const; std::shared_ptr get_remote_nth_stripable (PresentationInfo::order_t n, PresentationInfo::Flag) const; std::shared_ptr get_remote_nth_route (PresentationInfo::order_t n) const; std::shared_ptr route_by_selected_count (uint32_t cnt) const; void routes_using_input_from (const std::string& str, RouteList& rl); + void find_matching_stripables_by_partial_name (std::string const & partial, std::vector&) const; bool route_name_unique (std::string) const; bool route_name_internal (std::string) const; diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 411ef4f26f..1eeb64e353 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -4466,7 +4466,34 @@ Session::route_by_name (string name) const } } - return std::shared_ptr ((Route*) 0); + return nullptr; +} + +std::shared_ptr +Session::stripable_by_name (string name) const +{ + StripableList sl; + get_stripables (sl); + + for (auto & s : sl) { + if (s->name() == name) { + return s; + } + } + return nullptr; +} + +void +Session::find_matching_stripables_by_partial_name (std::string const & partial, std::vector& matches) const +{ + StripableList sl; + get_stripables (sl); + + for (auto & s : sl) { + if (s->name().find (partial) == 0) { + matches.push_back (s->name()); + } + } } std::shared_ptr