tempo display: when the tempo map changes, avoid unnecessary work
If the initial tempo marker is referencing a point in the new map, assume that all markers have already been associated with the map.
This commit is contained in:
parent
3482d6db4e
commit
cdf98a1bd7
|
@ -450,6 +450,24 @@ Editor::tempo_map_changed ()
|
|||
{
|
||||
TempoMap::SharedPtr current_map = TempoMap::fetch ();
|
||||
reassociate_metric_markers (current_map);
|
||||
/* If the tempo map was changed by something other than the Editor, we
|
||||
* will need to reassociate all visual elements used for tempo display
|
||||
* with the new map.
|
||||
*/
|
||||
|
||||
if (!tempo_marks.empty()) {
|
||||
/* a little awkward using shared_ptr<T>::get() but better than every
|
||||
* point in the map holding a shared_ptr ref to the map that owns it.
|
||||
*/
|
||||
|
||||
if (&tempo_marks.front()->point().map() != current_map.get()) {
|
||||
std::cerr << "Map changed, need marker reassoc; point using " << &tempo_marks.front()->point().map() << " vs. " << current_map.get() << std::endl;
|
||||
reassociate_metric_markers (current_map);
|
||||
} else {
|
||||
std::cerr << "Map changed, no reassoc reqd\n";
|
||||
}
|
||||
}
|
||||
|
||||
tempo_map_visual_update ();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user