Tempo ramps - ensure displayed grid extends beyond the leftmost frame.
[ardour.git] / gtk2_ardour / audio_clock.cc
index 4afe4a418d7366d42bf693d7eaa58aea3782ccec..e7aff0ef13909094150468d51c0eeec4de107e5b 100644 (file)
@@ -923,6 +923,12 @@ AudioClock::session_property_changed (const PropertyChange&)
        set (last_when, true);
 }
 
+void
+AudioClock::metric_position_changed ()
+{
+       set (last_when, true);
+}
+
 void
 AudioClock::session_configuration_changed (std::string p)
 {
@@ -1281,7 +1287,7 @@ AudioClock::set_bbt (framepos_t when, bool /*force*/)
 
                TempoMetric m (_session->tempo_map().metric_at (pos));
 
-               sprintf (buf, "%-5.1f", _session->tempo_map().tempo_at (pos));
+               sprintf (buf, "%-5.1f", _session->tempo_map().tempo_at (pos).beats_per_minute());
                _left_layout->set_markup (string_compose ("<span size=\"%1\">" TXTSPAN "%3</span> <span foreground=\"green\">%2</span></span>",
                                                          INFO_FONT_SIZE, buf, _("Tempo")));
 
@@ -1300,6 +1306,7 @@ AudioClock::set_session (Session *s)
 
                _session->config.ParameterChanged.connect (_session_connections, invalidator (*this), boost::bind (&AudioClock::session_configuration_changed, this, _1), gui_context());
                _session->tempo_map().PropertyChanged.connect (_session_connections, invalidator (*this), boost::bind (&AudioClock::session_property_changed, this, _1), gui_context());
+               _session->tempo_map().MetricPositionChanged.connect (_session_connections, invalidator (*this), boost::bind (&AudioClock::metric_position_changed, this), gui_context());
 
                XMLProperty const * prop;
                XMLNode* node = _session->extra_xml (X_("ClockModes"));