Respond to MMC even when synced to JACK. Fixes #3700.
[ardour.git] / libs / ardour / ardour / panner.h
index 9d6a248de0af7b3c2c7f69b7b0b798a7ebf400e1..b07167862e038a4ca721f5b7b9d7d62566c693eb 100644 (file)
@@ -140,13 +140,23 @@ class BaseStereoPanner : public StreamPanner
        static double azimuth_to_lr_fract (double azi) { 
                /* 180.0 degrees=> left => 0.0 */
                /* 0.0 degrees => right => 1.0 */
-               return 1.0 - (azi/180.0);
+
+                /* humans can only distinguish 1 degree of arc between two positions,
+                   so force azi back to an integral value before computing
+                */
+
+               return 1.0 - (rint(azi)/180.0);
        }
 
        static double lr_fract_to_azimuth (double fract) { 
                /* fract = 0.0 => degrees = 180.0 => left */
                /* fract = 1.0 => degrees = 0.0 => right */
-               return 180.0 - (fract * 180.0);
+
+                /* humans can only distinguish 1 degree of arc between two positions,
+                   so force azi back to an integral value after computing
+                */
+
+               return rint (180.0 - (fract * 180.0));
        }
        
        /* old school automation loading */