diff layer/TimeRulerLayer.cpp @ 272:87e4c880b4c8

* highlight the nearest measurement rect * fix rewind during playback
author Chris Cannam
date Fri, 29 Jun 2007 13:58:08 +0000
parents 1a49bd0d8375
children cd2492c5fe45
line wrap: on
line diff
--- a/layer/TimeRulerLayer.cpp	Thu Jun 28 14:50:58 2007 +0000
+++ b/layer/TimeRulerLayer.cpp	Fri Jun 29 13:58:08 2007 +0000
@@ -151,13 +151,17 @@
     RealTime rt = RealTime::frame2RealTime(frame, rate);
     double ratio = rt / rtick;
 
-    int rounded = lrint(ratio);
+    int rounded = int(ratio);
     RealTime rdrt = rtick * rounded;
 
     int left = RealTime::realTime2Frame(rdrt, rate);
     resolution = RealTime::realTime2Frame(rtick, rate);
     int right = left + resolution;
 
+//    std::cerr << "TimeRulerLayer::snapToFeatureFrame: type "
+//              << int(snap) << ", frame " << frame << " (time "
+//              << rt << ", tick " << rtick << ", rounded " << rdrt << ") ";
+
     switch (snap) {
 
     case SnapLeft:
@@ -217,6 +221,8 @@
     }
     }
 
+//    std::cerr << " -> " << frame << " (resolution = " << resolution << ")" << std::endl;
+
     return true;
 }