mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 15:54:57 +01:00
Expose cut-copy-section in the editor
This is still a bit of an experiment, there may need to be a dedicated ruler for sections, or a side-bar that allows arranging.
This commit is contained in:
parent
91c0f143ec
commit
a0286f2e6f
4 changed files with 29 additions and 0 deletions
|
|
@ -1979,6 +1979,10 @@ Editor::add_selection_context_items (Menu_Helpers::MenuList& edit_items)
|
||||||
edit_items.push_back (MenuElem (_("Crop Region to Range"), sigc::mem_fun(*this, &Editor::crop_region_to_selection)));
|
edit_items.push_back (MenuElem (_("Crop Region to Range"), sigc::mem_fun(*this, &Editor::crop_region_to_selection)));
|
||||||
edit_items.push_back (MenuElem (_("Duplicate Range"), sigc::bind (sigc::mem_fun(*this, &Editor::duplicate_range), false)));
|
edit_items.push_back (MenuElem (_("Duplicate Range"), sigc::bind (sigc::mem_fun(*this, &Editor::duplicate_range), false)));
|
||||||
|
|
||||||
|
edit_items.push_back (SeparatorElem());
|
||||||
|
edit_items.push_back (MenuElem (_("Copy/Paste Range Section to Edit Point"), sigc::bind (sigc::mem_fun(*this, &Editor::cut_copy_section), true)));
|
||||||
|
edit_items.push_back (MenuElem (_("Cut/Paste Range Section to Edit Point"), sigc::bind (sigc::mem_fun(*this, &Editor::cut_copy_section), false)));
|
||||||
|
|
||||||
edit_items.push_back (SeparatorElem());
|
edit_items.push_back (SeparatorElem());
|
||||||
edit_items.push_back (MenuElem (_("Consolidate"), sigc::bind (sigc::mem_fun(*this, &Editor::bounce_range_selection), ReplaceRange, false)));
|
edit_items.push_back (MenuElem (_("Consolidate"), sigc::bind (sigc::mem_fun(*this, &Editor::bounce_range_selection), ReplaceRange, false)));
|
||||||
edit_items.push_back (MenuElem (_("Consolidate (with processing)"), sigc::bind (sigc::mem_fun(*this, &Editor::bounce_range_selection), ReplaceRange, true)));
|
edit_items.push_back (MenuElem (_("Consolidate (with processing)"), sigc::bind (sigc::mem_fun(*this, &Editor::bounce_range_selection), ReplaceRange, true)));
|
||||||
|
|
@ -2061,6 +2065,17 @@ Editor::add_dstream_context_items (Menu_Helpers::MenuList& edit_items)
|
||||||
}
|
}
|
||||||
edit_items.push_back (MenuElem (_("Insert Existing Media"), sigc::bind (sigc::mem_fun(*this, &Editor::add_external_audio_action), ImportToTrack)));
|
edit_items.push_back (MenuElem (_("Insert Existing Media"), sigc::bind (sigc::mem_fun(*this, &Editor::add_external_audio_action), ImportToTrack)));
|
||||||
|
|
||||||
|
/* Cut/Copy Section */
|
||||||
|
|
||||||
|
timepos_t unused;
|
||||||
|
bool have_time_selection = get_selection_extents (unused, unused);
|
||||||
|
edit_items.push_back (SeparatorElem());
|
||||||
|
edit_items.push_back (MenuElem (_("Copy/Paste Range Section to Edit Point"), sigc::bind (sigc::mem_fun(*this, &Editor::cut_copy_section), true)));
|
||||||
|
edit_items.back ().set_sensitive (have_time_selection);
|
||||||
|
edit_items.push_back (MenuElem (_("Cut/Paste Range Section to Edit Point"), sigc::bind (sigc::mem_fun(*this, &Editor::cut_copy_section), false)));
|
||||||
|
edit_items.back ().set_sensitive (have_time_selection);
|
||||||
|
|
||||||
|
|
||||||
/* Nudge track */
|
/* Nudge track */
|
||||||
|
|
||||||
Menu *nudge_menu = manage (new Menu());
|
Menu *nudge_menu = manage (new Menu());
|
||||||
|
|
|
||||||
|
|
@ -1440,6 +1440,7 @@ private:
|
||||||
|
|
||||||
std::shared_ptr<ARDOUR::Playlist> current_playlist () const;
|
std::shared_ptr<ARDOUR::Playlist> current_playlist () const;
|
||||||
void insert_source_list_selection (float times);
|
void insert_source_list_selection (float times);
|
||||||
|
void cut_copy_section (bool copy);
|
||||||
|
|
||||||
/* import & embed */
|
/* import & embed */
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -363,6 +363,9 @@ Editor::register_actions ()
|
||||||
reg_sens (editor_actions, "set-punch-from-edit-range", _("Set Punch from Selection"), sigc::mem_fun(*this, &Editor::set_punch_from_selection));
|
reg_sens (editor_actions, "set-punch-from-edit-range", _("Set Punch from Selection"), sigc::mem_fun(*this, &Editor::set_punch_from_selection));
|
||||||
reg_sens (editor_actions, "set-session-from-edit-range", _("Set Session Start/End from Selection"), sigc::mem_fun(*this, &Editor::set_session_extents_from_selection));
|
reg_sens (editor_actions, "set-session-from-edit-range", _("Set Session Start/End from Selection"), sigc::mem_fun(*this, &Editor::set_session_extents_from_selection));
|
||||||
|
|
||||||
|
reg_sens (editor_actions, "copy-paste-section", _("Copy/Paste Range Section to Edit Point"), sigc::bind (sigc::mem_fun(*this, &Editor::cut_copy_section), true));
|
||||||
|
reg_sens (editor_actions, "cut-paste-section", _("Cut/Paste Range Section to Edit Point"), sigc::bind (sigc::mem_fun(*this, &Editor::cut_copy_section), false));
|
||||||
|
|
||||||
/* this is a duplicated action so that the main menu can use a different label */
|
/* this is a duplicated action so that the main menu can use a different label */
|
||||||
reg_sens (editor_actions, "main-menu-play-selected-regions", _("Play Selected Regions"), sigc::mem_fun (*this, &Editor::play_selected_region));
|
reg_sens (editor_actions, "main-menu-play-selected-regions", _("Play Selected Regions"), sigc::mem_fun (*this, &Editor::play_selected_region));
|
||||||
reg_sens (editor_actions, "main-menu-tag-selected-regions", _("Tag Selected Regions"), sigc::mem_fun (*this, &Editor::tag_selected_region));
|
reg_sens (editor_actions, "main-menu-tag-selected-regions", _("Tag Selected Regions"), sigc::mem_fun (*this, &Editor::tag_selected_region));
|
||||||
|
|
|
||||||
|
|
@ -2708,6 +2708,16 @@ Editor::insert_source_list_selection (float times)
|
||||||
commit_reversible_command ();
|
commit_reversible_command ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Editor::cut_copy_section (bool copy)
|
||||||
|
{
|
||||||
|
timepos_t start, end;
|
||||||
|
if (!get_selection_extents (start, end) || !_session) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_session->cut_copy_section (start, end, get_preferred_edit_position(), copy);
|
||||||
|
}
|
||||||
|
|
||||||
/* BUILT-IN EFFECTS */
|
/* BUILT-IN EFFECTS */
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue