followup to the previous tempo-dragging commit: use argument to Drag::aborted() to...
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 21 Dec 2011 14:21:05 +0000 (14:21 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Wed, 21 Dec 2011 14:21:05 +0000 (14:21 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@11049 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/editor_drag.cc
libs/ardour/tempo.cc

index b90cb88c6f9de35db78cf70ab15d55237d9f7c60..020428a76bc85c43864070e1e9a970c488c58509 100644 (file)
@@ -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)
index a8f5bdf7ae292431b8bfb374c904883f98bdffa6..05a96c8dd8aa2668edb2c5eae4f0842f6229d995 100644 (file)
@@ -345,6 +345,7 @@ TempoMap::remove_tempo (const TempoSection& tempo)
        }
 
        if (removed) {
+               timestamp_metrics (true);
                PropertyChanged (PropertyChange ());
        }
 }