diff options
author | David Robillard <d@drobilla.net> | 2006-11-19 16:45:16 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2006-11-19 16:45:16 +0000 |
commit | ef6b25432d9c46d71b08c0f7d5f2686df428c4e8 (patch) | |
tree | 9b30d87b6670aadce365c9b112321dd674a0bab4 /gtk2_ardour/editor_tempodisplay.cc | |
parent | af105afe6cde5b0088647cea7d5e4e3314f8478b (diff) |
Merged with trunk R1141
git-svn-id: svn://localhost/ardour2/branches/midi@1142 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_tempodisplay.cc')
-rw-r--r-- | gtk2_ardour/editor_tempodisplay.cc | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/gtk2_ardour/editor_tempodisplay.cc b/gtk2_ardour/editor_tempodisplay.cc index c905e696cc..8aa978a79c 100644 --- a/gtk2_ardour/editor_tempodisplay.cc +++ b/gtk2_ardour/editor_tempodisplay.cc @@ -96,6 +96,10 @@ Editor::draw_metric_marks (const Metrics& metrics) void Editor::tempo_map_changed (Change ignored) { + if (!session) { + return; + } + ENSURE_GUI_THREAD(bind (mem_fun(*this, &Editor::tempo_map_changed), ignored)); BBT_Time previous_beat, next_beat; // the beats previous to the leftmost frame and after the rightmost frame @@ -112,13 +116,13 @@ Editor::tempo_map_changed (Change ignored) previous_beat.ticks = 0; if (session->tempo_map().meter_at(leftmost_frame + current_page_frames()).beats_per_bar () > next_beat.beats + 1) { - next_beat.beats += 1; + next_beat.beats += 1; } else { - next_beat.bars += 1; - next_beat.beats = 1; + next_beat.bars += 1; + next_beat.beats = 1; } next_beat.ticks = 0; - + if (current_bbt_points) { delete current_bbt_points; current_bbt_points = 0; @@ -227,9 +231,9 @@ Editor::draw_measures () case TempoMap::Beat: if ((*i).beat == 1) { - color = color_map[cMeasureLineBeat]; - } else { color = color_map[cMeasureLineBar]; + } else { + color = color_map[cMeasureLineBeat]; if (beat_density > 2.0) { /* only draw beat lines if the gaps between beats are large. |