13
0

Implement shift-right-click to delete MIDI note (#3170)

git-svn-id: svn://localhost/ardour2/branches/3.0@7155 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2010-05-25 01:39:45 +00:00
parent 97721226a4
commit ee61c5c9ea
4 changed files with 25 additions and 0 deletions

View File

@ -197,6 +197,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
void step_mouse_mode (bool next); void step_mouse_mode (bool next);
Editing::MouseMode current_mouse_mode () const { return mouse_mode; } Editing::MouseMode current_mouse_mode () const { return mouse_mode; }
Editing::MidiEditMode current_midi_edit_mode () const; Editing::MidiEditMode current_midi_edit_mode () const;
void remove_midi_note (ArdourCanvas::Item *, GdkEvent *);
bool internal_editing() const { return _internal_editing ; } bool internal_editing() const { return _internal_editing ; }
void set_internal_edit (bool yn); void set_internal_edit (bool yn);

View File

@ -1222,6 +1222,10 @@ Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemT
} }
break; break;
case NoteItem:
remove_midi_note (item, event);
break;
default: default:
break; break;
} }
@ -2654,3 +2658,12 @@ Editor::effective_mouse_mode () const
return mouse_mode; return mouse_mode;
} }
void
Editor::remove_midi_note (ArdourCanvas::Item* item, GdkEvent *)
{
ArdourCanvas::CanvasNoteEvent* e = dynamic_cast<ArdourCanvas::CanvasNoteEvent*> (item);
assert (e);
e->region_view().delete_note (e->note ());
}

View File

@ -1531,6 +1531,16 @@ MidiRegionView::delete_selection()
apply_delta (); apply_delta ();
} }
void
MidiRegionView::delete_note (boost::shared_ptr<NoteType> n)
{
start_delta_command (_("delete note"));
_delta_command->remove (n);
apply_delta ();
trackview.editor().hide_verbose_canvas_cursor ();
}
void void
MidiRegionView::clear_selection_except(ArdourCanvas::CanvasNoteEvent* ev) MidiRegionView::clear_selection_except(ArdourCanvas::CanvasNoteEvent* ev)
{ {

View File

@ -193,6 +193,7 @@ class MidiRegionView : public RegionView
void note_selected(ArdourCanvas::CanvasNoteEvent* ev, bool add, bool extend=false); void note_selected(ArdourCanvas::CanvasNoteEvent* ev, bool add, bool extend=false);
void note_deselected(ArdourCanvas::CanvasNoteEvent* ev); void note_deselected(ArdourCanvas::CanvasNoteEvent* ev);
void delete_selection(); void delete_selection();
void delete_note (boost::shared_ptr<NoteType>);
size_t selection_size() { return _selection.size(); } size_t selection_size() { return _selection.size(); }
void move_selection(double dx, double dy); void move_selection(double dx, double dy);