summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_tempodisplay.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gtk2_ardour/editor_tempodisplay.cc')
-rw-r--r--gtk2_ardour/editor_tempodisplay.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/gtk2_ardour/editor_tempodisplay.cc b/gtk2_ardour/editor_tempodisplay.cc
index 177f82bd44..3285d44e01 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;