Mercurial > hg > svcore
diff data/fileio/WavFileReader.h @ 823:f0558e69a074
Rename Resampling- to DecodingWavFileReader, and use it whenever we have an audio file that is not quickly seekable using libsndfile. Avoids very slow performance when analysing ogg files.
author | Chris Cannam |
---|---|
date | Wed, 17 Jul 2013 15:40:01 +0100 |
parents | 700cd3350391 |
children | 59e7fe1b1003 |
line wrap: on
line diff
--- a/data/fileio/WavFileReader.h Mon Jul 08 14:49:28 2013 +0100 +++ b/data/fileio/WavFileReader.h Wed Jul 17 15:40:01 2013 +0100 @@ -23,6 +23,16 @@ #include <set> +/** + * Reader for audio files using libsndfile. + * + * This is typically intended for seekable file types that can be read + * directly (e.g. WAV, AIFF etc). + * + * Compressed files supported by libsndfile (e.g. Ogg, FLAC) should + * normally be read using DecodingWavFileReader instead (which decodes + * to an intermediate cached file). + */ class WavFileReader : public AudioFileReader { public: @@ -32,6 +42,8 @@ virtual QString getLocation() const { return m_source.getLocation(); } virtual QString getError() const { return m_error; } + virtual bool isQuicklySeekable() const { return m_seekable; } + /** * Must be safe to call from multiple threads with different * arguments on the same object at the same time. @@ -59,6 +71,8 @@ QString m_path; QString m_error; + bool m_seekable; + mutable QMutex m_mutex; mutable float *m_buffer; mutable size_t m_bufsiz;