13 #ifndef __AUDIOFILE_H__ 14 #define __AUDIOFILE_H__ 40 bool open(
const QByteArray&);
41 const char*
error()
const {
return sf_strerror(sf); }
45 sf_count_t
frames()
const {
return info.frames; }
50 sf_count_t
read(
void* ptr, sf_count_t count);
51 sf_count_t
write(
const void* ptr, sf_count_t count);
52 sf_count_t
seek(sf_count_t offset,
int whence);
53 unsigned int loopStart(
int v = 0) {
return hasInstrument ? inst.loops[v].start : -1; }
54 unsigned int loopEnd(
int v = 0) {
return hasInstrument ? inst.loops[v].end : -1; }
55 int loopMode(
int v = 0) {
return hasInstrument ? inst.loops[v].mode : -1; }
QByteArray buf
Definition: audiofile.h:32
Definition: audiofile.h:26
Definition: audiofile.h:22
int idx
Definition: audiofile.h:33
Definition: audiofile.h:25
SNDFILE * sf
Definition: audiofile.h:29
SF_INSTRUMENT inst
Definition: audiofile.h:30
int loopMode(int v=0)
Definition: audiofile.h:55
FormatType
Definition: audiofile.h:23
unsigned int loopEnd(int v=0)
Definition: audiofile.h:54
sf_count_t tell() const
Definition: audiofile.h:49
SF_INFO info
Definition: audiofile.h:28
sf_count_t getFileLen() const
Definition: audiofile.h:48
sf_count_t readData(short *data, sf_count_t frames)
Definition: audiofile.cpp:74
FormatType _type
Definition: audiofile.h:34
~AudioFile()
Definition: audiofile.cpp:50
int channels() const
Definition: audiofile.h:44
sf_count_t seek(sf_count_t offset, int whence)
Definition: audiofile.cpp:110
const char * error() const
Definition: audiofile.h:41
int samplerate() const
Definition: audiofile.h:46
sf_count_t write(const void *ptr, sf_count_t count)
Definition: audiofile.cpp:142
bool open(const QByteArray &)
Definition: audiofile.cpp:60
sf_count_t frames() const
Definition: audiofile.h:45
unsigned int loopStart(int v=0)
Definition: audiofile.h:53
AudioFile()
Definition: audiofile.cpp:43
bool hasInstrument
Definition: audiofile.h:31
sf_count_t read(void *ptr, sf_count_t count)
Definition: audiofile.cpp:130