summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2011-12-21 14:21:05 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2011-12-21 14:21:05 +0000
commit5d509146c815bee46e8d1ede78c7e4445f346db8 (patch)
tree9f3e47fad1787035e2989a14bd434ecebca6d00a /gtk2_ardour
parentc0f435d36ac51a59448e4226aa618969a8037fde (diff)
followup to the previous tempo-dragging commit: use argument to Drag::aborted() to know if we moved; update the frame position of tempo map metrics when we remove a tempo mark (should fix visual glitches when dragging tempo)
git-svn-id: svn://localhost/ardour2/branches/3.0@11049 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/editor_drag.cc39
1 files changed, 18 insertions, 21 deletions
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc
index b90cb88c6f..020428a76b 100644
--- a/gtk2_ardour/editor_drag.cc
+++ b/gtk2_ardour/editor_drag.cc
@@ -1944,20 +1944,18 @@ MeterMarkerDrag::finished (GdkEvent* event, bool movement_occurred)
}
void
-MeterMarkerDrag::aborted (bool)
+MeterMarkerDrag::aborted (bool moved)
{
_marker->set_position (_marker->meter().frame ());
- /* XXX problem: we don't know if we've moved yet, so we don't
- know if the marker is a copy yet or not
- */
-
- TempoMap& map (_editor->session()->tempo_map());
- /* we removed it before, so add it back now */
- map.add_meter (_marker->meter(), _marker->meter().frame());
- // delete the dummy marker we used for visual representation while moving.
- // a new visual marker will show up automatically.
- delete _marker;
+ if (moved) {
+ TempoMap& map (_editor->session()->tempo_map());
+ /* we removed it before, so add it back now */
+ map.add_meter (_marker->meter(), _marker->meter().frame());
+ // delete the dummy marker we used for visual representation while moving.
+ // a new visual marker will show up automatically.
+ delete _marker;
+ }
}
TempoMarkerDrag::TempoMarkerDrag (Editor* e, ArdourCanvas::Item* i, bool c)
@@ -2062,18 +2060,17 @@ TempoMarkerDrag::finished (GdkEvent* event, bool movement_occurred)
}
void
-TempoMarkerDrag::aborted (bool)
+TempoMarkerDrag::aborted (bool moved)
{
_marker->set_position (_marker->tempo().frame());
- /* XXX problem: we don't know if we've moved yet, so we don't
- know if the marker is a copy yet or not
- */
- TempoMap& map (_editor->session()->tempo_map());
- /* we removed it before, so add it back now */
- map.add_tempo (_marker->tempo(), _marker->tempo().frame());
- // delete the dummy marker we used for visual representation while moving.
- // a new visual marker will show up automatically.
- delete _marker;
+ if (moved) {
+ TempoMap& map (_editor->session()->tempo_map());
+ /* we removed it before, so add it back now */
+ map.add_tempo (_marker->tempo(), _marker->tempo().frame());
+ // delete the dummy marker we used for visual representation while moving.
+ // a new visual marker will show up automatically.
+ delete _marker;
+ }
}
CursorDrag::CursorDrag (Editor* e, ArdourCanvas::Item* i, bool s)