diff data/fileio/AudioFileReaderFactory.h @ 327:1d656dcda8ef

* some tweaks to improve usability of these classes in a console application
author Chris Cannam
date Fri, 02 Nov 2007 16:50:31 +0000
parents c324d410b096
children 183ee2a55fc7
line wrap: on
line diff
--- a/data/fileio/AudioFileReaderFactory.h	Thu Nov 01 16:02:01 2007 +0000
+++ b/data/fileio/AudioFileReaderFactory.h	Fri Nov 02 16:50:31 2007 +0000
@@ -44,7 +44,30 @@
      *
      * Caller owns the returned object and must delete it after use.
      */
-    static AudioFileReader *createReader(FileSource source, size_t targetRate = 0);
+    static AudioFileReader *createReader(FileSource source,
+                                         size_t targetRate = 0);
+
+    /**
+     * Return an audio file reader initialised to the file at the
+     * given path, or NULL if no suitable reader for this path is
+     * available or the file cannot be opened.  If the reader supports
+     * threaded decoding, it will be used and the file decoded in a
+     * background thread.
+     *
+     * If targetRate is non-zero, the file will be resampled to that
+     * rate (transparently).  You can query reader->getNativeRate()
+     * if you want to find out whether the file is being resampled
+     * or not.
+     *
+     * Caller owns the returned object and must delete it after use.
+     */
+    static AudioFileReader *createThreadingReader(FileSource source,
+                                                  size_t targetRate = 0);
+
+protected:
+    static AudioFileReader *create(FileSource source,
+                                   size_t targetRate,
+                                   bool threading);
 };
 
 #endif