diff audioio/AudioCallbackPlaySource.h @ 93:737b373246b5

* Further fixes to the handling of playback frame and buffered frame counts
author Chris Cannam
date Mon, 11 Feb 2008 12:46:39 +0000
parents 9fc4b256c283
children 9cc9862333bd
line wrap: on
line diff
--- a/audioio/AudioCallbackPlaySource.h	Fri Feb 08 17:54:49 2008 +0000
+++ b/audioio/AudioCallbackPlaySource.h	Mon Feb 11 12:46:39 2008 +0000
@@ -26,6 +26,7 @@
 #include <QWaitCondition>
 
 #include "base/Thread.h"
+#include "base/RealTime.h"
 
 #include <samplerate.h>
 
@@ -99,6 +100,12 @@
      * out of the speakers.  (i.e. compensating for playback latency.)
      */
     virtual size_t getCurrentPlayingFrame();
+    
+    /** 
+     * Return the last frame that would come out of the speakers if we
+     * stopped playback right now.
+     */
+    virtual size_t getCurrentBufferedFrame();
 
     /**
      * Return the frame at which playback is expected to end (if not looping).
@@ -331,6 +338,13 @@
     // Called from getSourceSamples.
     void applyAuditioningEffect(size_t count, float **buffers);
 
+    // Ranges of current selections, if play selection is active
+    std::vector<RealTime> m_rangeStarts;
+    std::vector<RealTime> m_rangeDurations;
+    void rebuildRangeLists();
+
+    size_t getCurrentFrame(RealTime outputLatency);
+
     class FillThread : public Thread
     {
     public: