Fixed overflow issue. Code originally meant to truncate the 64 bit integer did not...
[ardour.git] / gtk2_ardour / ardour_ui2.cc
index 426571bcec8bfee610c1a6a10d6ccfb03997baba..44d0b1a4232bcc1854f4efda531e274de89686bd 100644 (file)
@@ -755,17 +755,13 @@ ARDOUR_UI::set_shuttle_fract (double f)
 void
 ARDOUR_UI::use_shuttle_fract (bool force)
 {
-       struct timeval now;
-       struct timeval diff;
+       microseconds_t now = get_microseconds();
        
        /* do not attempt to submit a motion-driven transport speed request
           more than once per process cycle.
         */
 
-       gettimeofday (&now, 0);
-       timersub (&now, &last_shuttle_request, &diff);
-
-       if (!force && (diff.tv_usec + (diff.tv_sec * 1000000)) < engine->usecs_per_cycle()) {
+       if (!force && (last_shuttle_request - now) < (microseconds_t) engine->usecs_per_cycle()) {
                return;
        }
        
@@ -880,6 +876,7 @@ ARDOUR_UI::editor_realized ()
        set_size_request_to_display_given_text (speed_display_box, _("-0.55"), 2, 2);
        const guint32 FUDGE = 25; // Combo's are stupid - they steal space from the entry for the button
        set_size_request_to_display_given_text (shuttle_style_button, _("sprung"), 2+FUDGE, 10);
+       reset_dpi();
 }
 
 void