summaryrefslogtreecommitdiff
path: root/gtk2_ardour/tempo_dialog.cc
diff options
context:
space:
mode:
authorColin Fletcher <colin.m.fletcher@googlemail.com>2015-03-19 20:14:06 +0000
committerColin Fletcher <colin.m.fletcher@googlemail.com>2015-03-27 13:22:38 +0000
commit3127587f9a9acb5bc19efea9a0aab8ad3214640b (patch)
tree33beb1a42ee02b430abff01bd4797683738aaa9c /gtk2_ardour/tempo_dialog.cc
parentee959e73fd02c5eefc56a27d23e9ce847b0fab55 (diff)
Go back to using g_get_monotonic_time() for tap tempo
Using ev->time doesn't work as well as I'd hoped, so revert to the previous method with g_get_monotonic_time().
Diffstat (limited to 'gtk2_ardour/tempo_dialog.cc')
-rw-r--r--gtk2_ardour/tempo_dialog.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/gtk2_ardour/tempo_dialog.cc b/gtk2_ardour/tempo_dialog.cc
index 2a353d4b7d..02686b62ff 100644
--- a/gtk2_ardour/tempo_dialog.cc
+++ b/gtk2_ardour/tempo_dialog.cc
@@ -261,18 +261,17 @@ TempoDialog::pulse_change ()
set_response_sensitive (RESPONSE_ACCEPT, is_user_input_valid());
}
-
bool
TempoDialog::tap_tempo_button_press (GdkEventButton *ev)
{
- guint32 now;
- now = ev->time; // milliseconds
+ gint64 now;
+ now = g_get_monotonic_time (); // microseconds
if (tapped) {
double interval, bpm;
static const double decay = 0.5;
- interval = (now - last_tap) * 1.0e-3;
+ interval = (now - last_tap) * 1.0e-6;
if (interval <= 6.0) {
// <= 6 seconds (say): >= 10 bpm
if (average_interval > 0 && average_interval > interval / 1.2 && average_interval < interval * 1.2) {
@@ -292,7 +291,6 @@ TempoDialog::tap_tempo_button_press (GdkEventButton *ev)
tapped = true;
}
last_tap = now;
- return false;
}
bool