1 #ifndef AUDIOGRAPHER_SNDFILE_READER_H
2 #define AUDIOGRAPHER_SNDFILE_READER_H
4 #include "sndfile_base.h"
5 #include "listed_source.h"
6 #include "process_context.h"
11 /** Reader for audio files using libsndfile.
12 * Once again only short, int and float are valid template parameters
15 class SndfileReader : public virtual SndfileBase, public ListedSource<T>
20 SeekBeginning = SEEK_SET, //< Seek from beginning of file
21 SeekCurrent = SEEK_CUR, //< Seek from current position
22 SeekEnd = SEEK_END //< Seek from end
27 SndfileReader (ChannelCount channels, nframes_t samplerate, int format, std::string path);
29 nframes_t seek (nframes_t frames, SeekType whence);
30 nframes_t read (ProcessContext<T> & context);
34 void init(); // init read function
35 sf_count_t (*read_func)(SNDFILE *, T *, sf_count_t);
40 #endif // AUDIOGRAPHER_SNDFILE_READER_H