Update GUI: add new section operations
This commit is contained in:
parent
4529a17617
commit
3468ffddbb
@ -1441,7 +1441,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);
|
void cut_copy_section (ARDOUR::SectionOperation const op);
|
||||||
|
|
||||||
/* import & embed */
|
/* import & embed */
|
||||||
|
|
||||||
|
@ -368,8 +368,10 @@ 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, "copy-paste-section", _("Copy/Paste Range Section to Edit Point"), sigc::bind (sigc::mem_fun(*this, &Editor::cut_copy_section), CopyPasteSection));
|
||||||
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));
|
reg_sens (editor_actions, "cut-paste-section", _("Cut/Paste Range Section to Edit Point"), sigc::bind (sigc::mem_fun(*this, &Editor::cut_copy_section), CutPasteSection));
|
||||||
|
reg_sens (editor_actions, "insert-section", _("Insert Time Section at Edit Point"), sigc::bind (sigc::mem_fun(*this, &Editor::cut_copy_section), InsertSection));
|
||||||
|
reg_sens (editor_actions, "delete-section", _("Delete Range Section"), sigc::bind (sigc::mem_fun(*this, &Editor::cut_copy_section), DeleteSection));
|
||||||
|
|
||||||
/* 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));
|
||||||
|
@ -2701,7 +2701,7 @@ Editor::insert_source_list_selection (float times)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Editor::cut_copy_section (bool copy)
|
Editor::cut_copy_section (ARDOUR::SectionOperation const op)
|
||||||
{
|
{
|
||||||
timepos_t start, end;
|
timepos_t start, end;
|
||||||
if (!get_selection_extents (start, end) || !_session) {
|
if (!get_selection_extents (start, end) || !_session) {
|
||||||
@ -2724,7 +2724,12 @@ Editor::cut_copy_section (bool copy)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
timepos_t to (get_preferred_edit_position ());
|
timepos_t to (get_preferred_edit_position ());
|
||||||
//_session->cut_copy_section (start, end, to, copy ? CopyPasteSection : CutCopySection);
|
_session->cut_copy_section (start, end, to, op);
|
||||||
|
|
||||||
|
if (op == DeleteSection) {
|
||||||
|
selection->clear ();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
timepos_t to_end (to + start.distance (end));
|
timepos_t to_end (to + start.distance (end));
|
||||||
|
|
||||||
@ -2735,10 +2740,10 @@ Editor::cut_copy_section (bool copy)
|
|||||||
selection->clear ();
|
selection->clear ();
|
||||||
break;
|
break;
|
||||||
case SectionSelectRetainAndMovePlayhead:
|
case SectionSelectRetainAndMovePlayhead:
|
||||||
_session->request_locate (copy ? to_end.samples (): to.samples ());
|
_session->request_locate (op != CutPasteSection ? to_end.samples (): to.samples ());
|
||||||
/* fallthough */
|
/* fallthough */
|
||||||
case SectionSelectRetain:
|
case SectionSelectRetain:
|
||||||
if (!copy || to < end) {
|
if (op == CutPasteSection || to < end) {
|
||||||
selection->set (to, to_end);
|
selection->set (to, to_end);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user