- case Pressed: // Maybe start a drag, if we've moved a bit
-
- if (fabs (event_x - _last_x) < 1 && fabs (event_y - _last_y) < 1) {
- /* no appreciable movement since the button was pressed */
- return false;
- }
-
- // Select drag start
- if (_pressed_button == 1 && trackview.editor().current_mouse_mode() == MouseObject
- && !Keyboard::modifier_state_contains (ev->state, Keyboard::insert_note_modifier())) {
-
- group->grab(GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK,
- Gdk::Cursor(Gdk::FLEUR), ev->time);
-
- _last_x = event_x;
- _last_y = event_y;
- _drag_start_x = event_x;
- _drag_start_y = event_y;
-
- _drag_rect = new ArdourCanvas::SimpleRect(*group);
- _drag_rect->property_x1() = event_x;
- _drag_rect->property_y1() = event_y;
- _drag_rect->property_x2() = event_x;
- _drag_rect->property_y2() = event_y;
- _drag_rect->property_outline_what() = 0xFF;
- _drag_rect->property_outline_color_rgba()
- = ARDOUR_UI::config()->canvasvar_MidiSelectRectOutline.get();
- _drag_rect->property_fill_color_rgba()
- = ARDOUR_UI::config()->canvasvar_MidiSelectRectFill.get();
-
- _mouse_state = SelectRectDragging;
- return true;
-
- // Add note drag start
- } else if (trackview.editor().internal_editing()) {
-
- delete _ghost_note;
- _ghost_note = 0;
-
- group->grab(GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK,
- Gdk::Cursor(Gdk::FLEUR), ev->time);
-
- _last_x = event_x;
- _last_y = event_y;
- _drag_start_x = event_x;
- _drag_start_y = event_y;
-
- _drag_rect = new ArdourCanvas::SimpleRect(*group);
- _drag_rect->property_x1() = trackview.editor().frame_to_pixel(event_frame);
-
- _drag_rect->property_y1() = midi_stream_view()->note_to_y(
- midi_stream_view()->y_to_note(event_y));
- _drag_rect->property_x2() = trackview.editor().frame_to_pixel(event_frame);
- _drag_rect->property_y2() = _drag_rect->property_y1()
- + floor(midi_stream_view()->note_height());
- _drag_rect->property_outline_what() = 0xFF;
- _drag_rect->property_outline_color_rgba() = 0xFFFFFF99;
- _drag_rect->property_fill_color_rgba() = 0xFFFFFF66;
-
- _mouse_state = AddDragging;
-
- if (_ghost_note){
-
- delete _ghost_note;
- _ghost_note = 0;
-
- trackview.editor().verbose_cursor()->hide ();
- }