#include "ardour/tempo.h"
#include "ardour/types.h"
+#include "ardour_ui.h"
#include "audio_clock.h"
-#include "utils.h"
-#include "keyboard.h"
#include "gui_thread.h"
+#include "keyboard.h"
#include "ui_config.h"
-#include "i18n.h"
+#include "utils.h"
+
+#include "pbd/i18n.h"
using namespace ARDOUR;
using namespace ARDOUR_UI_UTILS;
Keyboard::magic_widget_drop_focus ();
if (has_focus()) {
-
/* move focus back to the default widget in the top level window */
-
- Widget* top = get_toplevel();
-
- if (top->is_toplevel ()) {
- Window* win = dynamic_cast<Window*> (top);
- win->grab_focus ();
- }
+ ARDOUR_UI::instance()->reset_focus (this);
}
}
set (last_when, true);
}
+void
+AudioClock::metric_position_changed ()
+{
+ set (last_when, true);
+}
+
void
AudioClock::session_configuration_changed (std::string p)
{
BBT.beats = 0;
BBT.ticks = 0;
} else {
- _session->tempo_map().bbt_time (when, BBT);
+ BBT = _session->tempo_map().bbt_at_frame (when);
BBT.bars--;
BBT.beats--;
}
} else {
- _session->tempo_map().bbt_time (when, BBT);
+ BBT = _session->tempo_map().bbt_at_frame (when);
}
if (negative) {
TempoMetric m (_session->tempo_map().metric_at (pos));
- sprintf (buf, "%-5.1f", _session->tempo_map().tempo_at (pos));
+ sprintf (buf, "%-5.3f", _session->tempo_map().tempo_at_frame (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")));
_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"));