changeset 378:a38cd7823cb2

* PortAudio driver: do not specify frames per buffer, let PA decide * Remove old non-RubberBand time stretcher -- it doesn't work with varying buffer sizes such as the PA driver may now be using * Rewrite getCurrentPlayingFrame for greater correctness when using long buffer sizes (interpolating according to audio stream timestamp) * Several changes to make the timestretch management RT safe(r)
author Chris Cannam
date Fri, 08 Feb 2008 17:51:15 +0000
parents 166c22eff678
children 62789d79b98f
files base/RealTime.cpp base/RealTime.h
diffstat 2 files changed, 19 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/base/RealTime.cpp	Thu Feb 07 15:25:05 2008 +0000
+++ b/base/RealTime.cpp	Fri Feb 08 17:51:15 2008 +0000
@@ -272,6 +272,22 @@
     return RealTime(secdiv, int(nsecdiv + 0.5));
 }
 
+RealTime
+RealTime::operator*(double m) const
+{
+    double t = (double(nsec) / ONE_BILLION) * m;
+    t += sec * m;
+    return fromSeconds(t);
+}
+
+RealTime
+RealTime::operator/(double d) const
+{
+    double t = (double(nsec) / ONE_BILLION) / d;
+    t += sec / d;
+    return fromSeconds(t);
+}
+
 double 
 RealTime::operator/(const RealTime &r) const
 {
--- a/base/RealTime.h	Thu Feb 07 15:25:05 2008 +0000
+++ b/base/RealTime.h	Fri Feb 08 17:51:15 2008 +0000
@@ -95,6 +95,9 @@
     RealTime operator*(int m) const;
     RealTime operator/(int d) const;
 
+    RealTime operator*(double m) const;
+    RealTime operator/(double d) const;
+
     /**
      * Return the ratio of two times.
      */