mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 00:04:56 +01:00
some helper APIs to find things in a Session
This commit is contained in:
parent
dbe7288dc4
commit
3ac59dc837
2 changed files with 30 additions and 1 deletions
|
|
@ -382,11 +382,13 @@ public:
|
|||
bool io_name_is_legal (const std::string&) const;
|
||||
std::shared_ptr<Route> route_by_name (std::string) const;
|
||||
std::shared_ptr<Route> route_by_id (PBD::ID) const;
|
||||
std::shared_ptr<Stripable> stripable_by_name (std::string) const;
|
||||
std::shared_ptr<Stripable> stripable_by_id (PBD::ID) const;
|
||||
std::shared_ptr<Stripable> get_remote_nth_stripable (PresentationInfo::order_t n, PresentationInfo::Flag) const;
|
||||
std::shared_ptr<Route> get_remote_nth_route (PresentationInfo::order_t n) const;
|
||||
std::shared_ptr<Route> 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<std::string>&) const;
|
||||
|
||||
bool route_name_unique (std::string) const;
|
||||
bool route_name_internal (std::string) const;
|
||||
|
|
|
|||
|
|
@ -4466,7 +4466,34 @@ Session::route_by_name (string name) const
|
|||
}
|
||||
}
|
||||
|
||||
return std::shared_ptr<Route> ((Route*) 0);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::shared_ptr<Stripable>
|
||||
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<std::string>& 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<Route>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue