Make menu item for Add Track/Bus/VCA dialog consistent with window title
[ardour.git] / gtk2_ardour / midi_region_view.cc
index 853294eb83de831949023040a4155fd764ad2ceb..c0d8a3c59968892b545cbc6b98a8fda0198cc5ec 100644 (file)
@@ -497,13 +497,20 @@ MidiRegionView::button_press (GdkEventButton* ev)
        if (_mouse_state != SelectTouchDragging) {
 
                _pressed_button = ev->button;
-               _mouse_state = Pressed;
 
                if (m == MouseDraw || (m == MouseContent && Keyboard::modifier_state_contains (ev->state, Keyboard::insert_note_modifier()))) {
-                       editor->drags()->set (new NoteCreateDrag (dynamic_cast<Editor *> (editor), group, this), (GdkEvent *) ev);
+
+                       if (midi_view()->note_mode() == Percussive) {
+                               editor->drags()->set (new HitCreateDrag (dynamic_cast<Editor *> (editor), group, this), (GdkEvent *) ev);
+                       } else {
+                               editor->drags()->set (new NoteCreateDrag (dynamic_cast<Editor *> (editor), group, this), (GdkEvent *) ev);
+                       }
+
                        _mouse_state = AddDragging;
                        remove_ghost_note ();
                        hide_verbose_cursor ();
+               } else {
+                       _mouse_state = Pressed;
                }
 
                return true;
@@ -715,8 +722,12 @@ MidiRegionView::key_press (GdkEventKey* ev)
        */
        bool unmodified = Keyboard::no_modifier_keys_pressed (ev);
 
-       if (unmodified && (ev->keyval == GDK_Alt_L || ev->keyval == GDK_Alt_R) && _mouse_state != AddDragging) {
-               _mouse_state = SelectTouchDragging;
+       if (unmodified && (ev->keyval == GDK_Alt_L || ev->keyval == GDK_Alt_R)) {
+
+               if (_mouse_state != AddDragging) {
+                       _mouse_state = SelectTouchDragging;
+               }
+
                return true;
 
        } else if (ev->keyval == GDK_Escape && unmodified) {
@@ -3741,7 +3752,8 @@ MidiRegionView::update_ghost_note (double x, double y, uint32_t state)
        framepos_t const unsnapped_frame = editor.pixel_to_sample (x);
 
        const int32_t divisions = editor.get_grid_music_divisions (state);
-       const Evoral::Beats snapped_beats = snap_frame_to_grid_underneath (unsnapped_frame, divisions, true);
+       const bool shift_snap = midi_view()->note_mode() != Percussive;
+       const Evoral::Beats snapped_beats = snap_frame_to_grid_underneath (unsnapped_frame, divisions, shift_snap);
 
        /* ghost note may have been snapped before region */
        if (_ghost_note && snapped_beats.to_double() < 0.0) {