From c431575f22bf6ed4f3d44a833341aeff4aa5ad09 Mon Sep 17 00:00:00 2001 From: Ben Loftis Date: Mon, 6 Jun 2022 10:13:47 -0500 Subject: [PATCH] add menu-accessible actions for Consolidate Range --- gtk2_ardour/editor_actions.cc | 6 ++++++ gtk2_ardour/editor_ops.cc | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gtk2_ardour/editor_actions.cc b/gtk2_ardour/editor_actions.cc index 3050f7ccfc..9b7062e3da 100644 --- a/gtk2_ardour/editor_actions.cc +++ b/gtk2_ardour/editor_actions.cc @@ -169,6 +169,7 @@ Editor::register_actions () ActionManager::register_action (editor_menu_actions, X_("Select"), _("Select")); ActionManager::register_action (editor_menu_actions, X_("SelectMenu"), _("Select")); ActionManager::register_action (editor_menu_actions, X_("SeparateMenu"), _("Separate")); + ActionManager::register_action (editor_menu_actions, X_("ConsolidateMenu"), _("Consolidate")); ActionManager::register_action (editor_menu_actions, X_("SetLoopMenu"), _("Loop")); ActionManager::register_action (editor_menu_actions, X_("SetPunchMenu"), _("Punch")); ActionManager::register_action (editor_menu_actions, X_("Solo"), _("Solo")); @@ -396,6 +397,11 @@ Editor::register_actions () act = reg_sens (editor_actions, "editor-crop", _("Crop"), sigc::mem_fun(*this, &Editor::crop_region_to_selection)); ActionManager::time_selection_sensitive_actions.push_back (act); + act = reg_sens (editor_actions, "editor-consolidate-with-processing", _("Consolidate Range (with processing)"), sigc::bind (sigc::mem_fun(*this, &Editor::bounce_range_selection), ReplaceRange, true)); + ActionManager::time_selection_sensitive_actions.push_back (act); + act = reg_sens (editor_actions, "editor-consolidate", _("Consolidate Range"), sigc::bind (sigc::mem_fun(*this, &Editor::bounce_range_selection), ReplaceRange, false)); + ActionManager::time_selection_sensitive_actions.push_back (act); + reg_sens (editor_actions, "editor-cut", _("Cut"), sigc::mem_fun(*this, &Editor::cut)); reg_sens (editor_actions, "editor-delete", _("Delete"), sigc::mem_fun(*this, &Editor::delete_)); reg_sens (editor_actions, "alternate-editor-delete", _("Delete"), sigc::mem_fun(*this, &Editor::delete_)); diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 49da18f469..a391e7e504 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -4258,8 +4258,8 @@ Editor::bounce_range_selection (BounceTarget target, bool with_processing) } } - timepos_t start = selection->time[clicked_selection].start(); - timepos_t end = selection->time[clicked_selection].end(); + timepos_t start = selection->time.start_time(); + timepos_t end = selection->time.end_time(); timecnt_t cnt = start.distance (end); bool in_command = false;