further rationalization of the editor. after a split, ardour was switching the tool to object mode. this is the only place were ardour switched the tool for the user. that has been removed. Delete operation should not depend on the mouse mode, but rather the existence of selections. this solves the problem where you have selected regions in smart mode, but cant delete them because the mouse is in the top half (fange mode) of a track
This commit is contained in:
parent
b091fb8ee7
commit
62c3638a42
@ -2789,7 +2789,6 @@ Editor::separate_regions_between (const TimeSelection& ts)
|
|||||||
|
|
||||||
if (in_command) {
|
if (in_command) {
|
||||||
selection->set (new_selection);
|
selection->set (new_selection);
|
||||||
set_mouse_mode (MouseObject);
|
|
||||||
|
|
||||||
commit_reversible_command ();
|
commit_reversible_command ();
|
||||||
}
|
}
|
||||||
@ -3726,23 +3725,8 @@ Editor::copy ()
|
|||||||
bool
|
bool
|
||||||
Editor::can_cut_copy () const
|
Editor::can_cut_copy () const
|
||||||
{
|
{
|
||||||
switch (effective_mouse_mode()) {
|
if (!selection->time.empty() || !selection->regions.empty() || !selection->points.empty())
|
||||||
|
return true;
|
||||||
case MouseObject:
|
|
||||||
if (!selection->regions.empty() || !selection->points.empty()) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MouseRange:
|
|
||||||
if (!selection->time.empty()) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -3821,77 +3805,60 @@ Editor::cut_copy (CutCopyOp op)
|
|||||||
|
|
||||||
bool did_edit = false;
|
bool did_edit = false;
|
||||||
|
|
||||||
switch (effective_mouse_mode()) {
|
if (!selection->points.empty()) {
|
||||||
case MouseGain:
|
begin_reversible_command (opname + _(" points"));
|
||||||
|
did_edit = true;
|
||||||
|
cut_copy_points (op);
|
||||||
|
if (op == Cut || op == Delete) {
|
||||||
|
selection->clear_points ();
|
||||||
|
}
|
||||||
|
} else if (!selection->regions.empty() || !selection->points.empty()) {
|
||||||
|
|
||||||
|
string thing_name;
|
||||||
|
|
||||||
|
if (selection->regions.empty()) {
|
||||||
|
thing_name = _("points");
|
||||||
|
} else if (selection->points.empty()) {
|
||||||
|
thing_name = _("regions");
|
||||||
|
} else {
|
||||||
|
thing_name = _("objects");
|
||||||
|
}
|
||||||
|
|
||||||
|
begin_reversible_command (opname + ' ' + thing_name);
|
||||||
|
did_edit = true;
|
||||||
|
|
||||||
|
if (!selection->regions.empty()) {
|
||||||
|
cut_copy_regions (op, selection->regions);
|
||||||
|
|
||||||
|
if (op == Cut || op == Delete) {
|
||||||
|
selection->clear_regions ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!selection->points.empty()) {
|
if (!selection->points.empty()) {
|
||||||
begin_reversible_command (opname + _(" points"));
|
|
||||||
did_edit = true;
|
|
||||||
cut_copy_points (op);
|
cut_copy_points (op);
|
||||||
|
|
||||||
if (op == Cut || op == Delete) {
|
if (op == Cut || op == Delete) {
|
||||||
selection->clear_points ();
|
selection->clear_points ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
} else if (selection->time.empty()) {
|
||||||
|
framepos_t start, end;
|
||||||
case MouseObject:
|
/* no time selection, see if we can get an edit range
|
||||||
|
and use that.
|
||||||
if (!selection->regions.empty() || !selection->points.empty()) {
|
*/
|
||||||
|
if (get_edit_op_range (start, end)) {
|
||||||
string thing_name;
|
selection->set (start, end);
|
||||||
|
|
||||||
if (selection->regions.empty()) {
|
|
||||||
thing_name = _("points");
|
|
||||||
} else if (selection->points.empty()) {
|
|
||||||
thing_name = _("regions");
|
|
||||||
} else {
|
|
||||||
thing_name = _("objects");
|
|
||||||
}
|
|
||||||
|
|
||||||
begin_reversible_command (opname + ' ' + thing_name);
|
|
||||||
did_edit = true;
|
|
||||||
|
|
||||||
if (!selection->regions.empty()) {
|
|
||||||
cut_copy_regions (op, selection->regions);
|
|
||||||
|
|
||||||
if (op == Cut || op == Delete) {
|
|
||||||
selection->clear_regions ();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!selection->points.empty()) {
|
|
||||||
cut_copy_points (op);
|
|
||||||
|
|
||||||
if (op == Cut || op == Delete) {
|
|
||||||
selection->clear_points ();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MouseRange:
|
|
||||||
if (selection->time.empty()) {
|
|
||||||
framepos_t start, end;
|
|
||||||
/* no time selection, see if we can get an edit range
|
|
||||||
and use that.
|
|
||||||
*/
|
|
||||||
if (get_edit_op_range (start, end)) {
|
|
||||||
selection->set (start, end);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (!selection->time.empty()) {
|
} else if (!selection->time.empty()) {
|
||||||
begin_reversible_command (opname + _(" range"));
|
begin_reversible_command (opname + _(" range"));
|
||||||
|
|
||||||
did_edit = true;
|
did_edit = true;
|
||||||
cut_copy_ranges (op);
|
cut_copy_ranges (op);
|
||||||
|
|
||||||
if (op == Cut || op == Delete) {
|
|
||||||
selection->clear_time ();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
if (op == Cut || op == Delete) {
|
||||||
break;
|
selection->clear_time ();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (did_edit) {
|
if (did_edit) {
|
||||||
|
Loading…
Reference in New Issue
Block a user