add another version of FooListToControlList

This commit is contained in:
Paul Davis 2023-07-31 13:35:37 -06:00
parent d1fe9f2846
commit 8340be4808
1 changed files with 13 additions and 2 deletions

View File

@ -126,8 +126,19 @@ template<typename T> std::shared_ptr<ControlList> route_list_to_control_list (st
template<typename T> std::shared_ptr<ControlList> stripable_list_to_control_list (StripableList& sl, std::shared_ptr<T> (Stripable::*get_control)() const) {
std::shared_ptr<ControlList> cl (new ControlList);
for (StripableList::const_iterator s = sl.begin(); s != sl.end(); ++s) {
std::shared_ptr<AutomationControl> ac = ((*s).get()->*get_control)();
for (auto const & s : sl) {
std::shared_ptr<AutomationControl> ac = (s.get()->*get_control)();
if (ac) {
cl->push_back (ac);
}
}
return cl;
}
template<typename T> std::shared_ptr<ControlList> stripable_list_to_control_list (std::shared_ptr<StripableList const> sl, std::shared_ptr<T> (Stripable::*get_control)() const) {
std::shared_ptr<ControlList> cl (new ControlList);
for (auto const & s : *sl) {
std::shared_ptr<AutomationControl> ac = (s.get()->*get_control)();
if (ac) {
cl->push_back (ac);
}