summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_drag.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-08-09 16:40:31 +0000
committerCarl Hetherington <carl@carlh.net>2010-08-09 16:40:31 +0000
commit5b520324ceab2559723b4ef5127301fa61ff4846 (patch)
tree13850a356fabdcbd55ca527fc5faf2fda63cb209 /gtk2_ardour/editor_drag.cc
parentaa9fd3334976ceae7e164c3fabc87e55fc921dff (diff)
Allow markers to be glued to bar/beat time. Fixes #1815.
git-svn-id: svn://localhost/ardour2/branches/3.0@7573 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_drag.cc')
-rw-r--r--gtk2_ardour/editor_drag.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc
index 58bccf68d4..09a1573829 100644
--- a/gtk2_ardour/editor_drag.cc
+++ b/gtk2_ardour/editor_drag.cc
@@ -3504,7 +3504,7 @@ RangeMarkerBarDrag::start_grab (GdkEvent* event, Gdk::Cursor *)
Gdk::Cursor* cursor = 0;
if (!_editor->temp_location) {
- _editor->temp_location = new Location;
+ _editor->temp_location = new Location (*_editor->session());
}
switch (_operation) {
@@ -3625,7 +3625,10 @@ RangeMarkerBarDrag::finished (GdkEvent* event, bool movement_occurred)
flags = Location::IsRangeMarker;
_editor->range_bar_drag_rect->hide();
}
- newloc = new Location(_editor->temp_location->start(), _editor->temp_location->end(), rangename, (Location::Flags) flags);
+ newloc = new Location (
+ *_editor->session(), _editor->temp_location->start(), _editor->temp_location->end(), rangename, (Location::Flags) flags
+ );
+
_editor->session()->locations()->add (newloc, true);
XMLNode &after = _editor->session()->locations()->get_state();
_editor->session()->add_command(new MementoCommand<Locations>(*(_editor->session()->locations()), &before, &after));