TriggerBox: trigger_by_id searches the box for a trigger with matching pbd::id

This commit is contained in:
Ben Loftis 2022-01-27 12:45:29 -06:00
parent 63e134097c
commit 3605f51e7e
2 changed files with 14 additions and 0 deletions

View file

@ -616,6 +616,8 @@ class LIBARDOUR_API TriggerBox : public Processor
TriggerPtr currently_playing() const { return _currently_playing; }
TriggerPtr trigger_by_id (PBD::ID);
void clear_all_triggers ();
void set_all_follow_action (ARDOUR::FollowAction const &, uint32_t n=0);
void set_all_launch_style (ARDOUR::Trigger::LaunchStyle);

View file

@ -2290,6 +2290,18 @@ TriggerBox::get_next_trigger ()
return 0;
}
TriggerPtr
TriggerBox::trigger_by_id (PBD::ID check)
{
for (uint64_t n = 0; n < all_triggers.size(); ++n) {
if (trigger (n)->id() == check) {
return trigger (n);
}
}
return TriggerPtr();
}
void
void
TriggerBox::set_from_selection (uint32_t slot, boost::shared_ptr<Region> region)
{