make dragging a region from the list not crash.
authornick_m <mainsbridge@gmail.com>
Mon, 30 Jan 2017 16:03:45 +0000 (03:03 +1100)
committernick_m <mainsbridge@gmail.com>
Sat, 4 Feb 2017 11:57:36 +0000 (22:57 +1100)
- its still a fake event, but we can at least get the snap correct.

- playlist->add_region() parameters were whacky
  (for Playlist::add_region_internal()?)

gtk2_ardour/editor_canvas_events.cc
gtk2_ardour/editor_drag.cc

index 569f58c9527bb00b8e33a7fe46008968895d08d6..9a12ada070ce01e6b342c75542708319cef6ecfc 100644 (file)
@@ -1316,7 +1316,7 @@ Editor::drop_regions (const Glib::RefPtr<Gdk::DragContext>& /*context*/,
                if ((boost::dynamic_pointer_cast<AudioRegion> (region_copy) != 0 && dynamic_cast<AudioTimeAxisView*> (rtav) != 0) ||
                    (boost::dynamic_pointer_cast<MidiRegion> (region_copy) != 0 && dynamic_cast<MidiTimeAxisView*> (rtav) != 0)) {
                        _drags->set (new RegionInsertDrag (this, region_copy, rtav, pos), &event);
-                       _drags->end_grab (0);
+                       _drags->end_grab (&event);
                }
        }
 }
index 6d87599e89f40acf082dabd24e17cdd1415a487d..6a143eecd7501cc4e33b4ada96c559c08e439a0f 100644 (file)
@@ -1982,7 +1982,9 @@ RegionInsertDrag::finished (GdkEvent * event, bool)
 
        _editor->begin_reversible_command (Operations::insert_region);
        playlist->clear_changes ();
-       playlist->add_region (_primary->region (), _last_position.frame, _editor->get_grid_music_divisions (event->button.state));
+       _editor->snap_to_with_modifier (_last_position, event);
+
+       playlist->add_region (_primary->region (), _last_position.frame, 1.0, false, _last_position.division);
 
        // Mixbus doesn't seem to ripple when inserting regions from the list: should we? yes, probably
        if (Config->get_edit_mode() == Ripple) {