mouse draw mode can draw AND select (and trim) notes (but trim cursors don't appear yet)

git-svn-id: svn://localhost/ardour2/branches/3.0@11470 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2012-02-08 12:50:32 +00:00
parent e061fa3009
commit 53cb1b6572
2 changed files with 25 additions and 5 deletions

View File

@ -4066,8 +4066,11 @@ void
NoteDrag::finished (GdkEvent* ev, bool moved)
{
if (!moved) {
if (_editor->current_mouse_mode() == Editing::MouseObject) {
/* no motion - select note */
if (_editor->current_mouse_mode() == Editing::MouseObject ||
_editor->current_mouse_mode() == Editing::MouseDraw) {
if (_was_selected) {
bool add = Keyboard::modifier_state_equals (ev->button.state, Keyboard::PrimaryModifier);
if (add) {

View File

@ -825,9 +825,7 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
ArdourCanvas::CanvasNote* cn = dynamic_cast<ArdourCanvas::CanvasNote*> (item);
if (cn && cn->big_enough_to_trim() && cn->mouse_near_ends()) {
_drags->set (new NoteResizeDrag (this, item), event, current_canvas_cursor);
} else {
_drags->set (new NoteDrag (this, item), event);
}
}
}
return true;
@ -868,6 +866,25 @@ Editor::button_press_handler_1 (ArdourCanvas::Item* item, GdkEvent* event, ItemT
return true;
break;
case MouseDraw:
switch (item_type) {
case NoteItem:
if (internal_editing()) {
/* trim notes if we're in internal edit mode and near the ends of the note */
ArdourCanvas::CanvasNote* cn = dynamic_cast<ArdourCanvas::CanvasNote*> (item);
if (cn && cn->big_enough_to_trim() && cn->mouse_near_ends()) {
_drags->set (new NoteResizeDrag (this, item), event, current_canvas_cursor);
} else {
_drags->set (new NoteDrag (this, item), event);
}
return true;
}
break;
default:
break;
}
case MouseObject:
switch (item_type) {
case NoteItem: