From a02689f41eeef22a2032ed0bce735c308b2e480f Mon Sep 17 00:00:00 2001 From: Ben Loftis Date: Fri, 11 Feb 2022 07:37:03 -0600 Subject: [PATCH] Range->Bounce to Trigger Clip: use UISTate api to set tempo of clip * also use the desired name without the extra stuff that bouncing adds to the filenam --- gtk2_ardour/editor_ops.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 3bae41a846..b3fdf388f8 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -4232,6 +4232,9 @@ Editor::bounce_range_selection (BounceTarget target, bool enable_processing) timecnt_t cnt = start.distance (end); bool in_command = false; + TempoMap::SharedPtr tmap (TempoMap::write_copy()); + double tempo = tmap->tempo_at(start).quarter_notes_per_minute(); + for (TrackViewList::iterator i = views.begin(); i != views.end(); ++i) { RouteTimeAxisView* rtv = dynamic_cast (*i); @@ -4287,6 +4290,10 @@ Editor::bounce_range_selection (BounceTarget target, bool enable_processing) boost::shared_ptr copy (RegionFactory::create (r, plist)); playlist->add_region (copy, start); } else if (target == NewTrigger) { + boost::shared_ptr state (new Trigger::UIState()); + state->name = bounce_name; + state->tempo = tempo; + rtv->track ()->triggerbox ()->enqueue_trigger_state_for_region(r, state); rtv->track ()->triggerbox ()->set_from_selection (trigger_slot, r); rtv->track ()->presentation_info ().set_trigger_track (true); }