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
This commit is contained in:
Paul Davis 2011-12-21 14:21:05 +00:00
parent c0f435d36a
commit 5d509146c8
2 changed files with 19 additions and 21 deletions

View 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)

View File

@ -345,6 +345,7 @@ TempoMap::remove_tempo (const TempoSection& tempo)
}
if (removed) {
timestamp_metrics (true);
PropertyChanged (PropertyChange ());
}
}