13
0

editor: improved handling of tempo map changes

This splits apart the actual signal handler from the work that needs to be done
to update the GUI in response to a tempo map change. This allows us to do the
visual update when we are manipulating the thread-local write copy of the map
during e.g. a drag operation.
This commit is contained in:
Paul Davis 2022-05-02 12:02:04 -06:00
parent 33622474af
commit 69ee24c22b
2 changed files with 13 additions and 3 deletions

View File

@ -1875,6 +1875,7 @@ private:
void update_tempo_curves (double min_tempo, double max_tempo, samplecnt_t sr);
void tempo_map_changed ();
void tempo_map_visual_update ();
void redisplay_grid (bool immediate_redraw);

View File

@ -449,12 +449,19 @@ Editor::update_tempo_curves (double min_tempo, double max_tempo, samplecnt_t sr)
void
Editor::tempo_map_changed ()
{
TempoMap::fetch ();
tempo_map_visual_update ();
}
void
Editor::tempo_map_visual_update ()
{
TempoMap::Metrics metrics;
TempoMap::fetch()->get_metrics (metrics);
TempoMap::use()->get_metrics (metrics);
draw_metric_marks (metrics);
compute_bbt_ruler_scale (_leftmost_sample, _leftmost_sample + current_page_samples());
draw_tempo_marks ();
update_tempo_based_rulers ();
maybe_draw_grid_lines ();
}
@ -839,5 +846,7 @@ void
Editor::mid_tempo_change ()
{
std::cerr << "============== MID TEMPO\n";
draw_tempo_marks ();
TempoMap::SharedPtr map (TempoMap::use());
map->dump (std::cerr);
tempo_map_visual_update ();
}