63 { SNDFILE_ref (
void) ;
83 #ifdef ENABLE_SNDFILE_WINDOWS_PROTOTYPES
94 int refCount (
void)
const {
return (p == NULL) ? 0 : p->ref ; }
96 operator bool ()
const {
return (p != NULL) ; }
101 int format (
void)
const {
return p ? p->sfinfo.format : 0 ; }
102 int channels (
void)
const {
return p ? p->sfinfo.channels : 0 ; }
103 int samplerate (
void)
const {
return p ? p->sfinfo.samplerate : 0 ; }
105 int error (
void)
const ;
106 const char *
strError (
void)
const ;
108 int command (
int cmd,
void *data,
int datasize) ;
114 int setString (
int str_type,
const char* str) ;
116 const char*
getString (
int str_type)
const ;
155 SndfileHandle::SNDFILE_ref::SNDFILE_ref (
void)
160 SndfileHandle::SNDFILE_ref::~SNDFILE_ref (
void)
167 p =
new (std::nothrow) SNDFILE_ref () ;
172 p->sfinfo.frames = 0 ;
173 p->sfinfo.channels = chans ;
174 p->sfinfo.format = fmt ;
175 p->sfinfo.samplerate = srate ;
176 p->sfinfo.sections = 0 ;
177 p->sfinfo.seekable = 0 ;
179 p->sf =
sf_open (path, mode, &p->sfinfo) ;
189 p =
new (std::nothrow) SNDFILE_ref () ;
194 p->sfinfo.frames = 0 ;
195 p->sfinfo.channels = chans ;
196 p->sfinfo.format = fmt ;
197 p->sfinfo.samplerate = srate ;
198 p->sfinfo.sections = 0 ;
199 p->sfinfo.seekable = 0 ;
201 p->sf =
sf_open (path.c_str (), mode, &p->sfinfo) ;
214 p =
new (std::nothrow) SNDFILE_ref () ;
219 p->sfinfo.frames = 0 ;
220 p->sfinfo.channels = chans ;
221 p->sfinfo.format = fmt ;
222 p->sfinfo.samplerate = srate ;
223 p->sfinfo.sections = 0 ;
224 p->sfinfo.seekable = 0 ;
226 p->sf =
sf_open_fd (fd, mode, &p->sfinfo, close_desc) ;
234 {
if (p != NULL && --p->ref == 0)
251 if (p != NULL && --p->ref == 0)
271 {
return sf_command (p->sf, cmd, data, datasize) ; }
275 {
return sf_seek (p->sf, frame_count, whence) ; }
380 {
return (p ? p->sf : NULL) ; }
385 if (p == NULL || (p->ref != 1))
395 #ifdef ENABLE_SNDFILE_WINDOWS_PROTOTYPES
401 p =
new (std::nothrow) SNDFILE_ref () ;
406 p->sfinfo.frames = 0 ;
407 p->sfinfo.channels = chans ;
408 p->sfinfo.format = fmt ;
409 p->sfinfo.samplerate = srate ;
410 p->sfinfo.sections = 0 ;
411 p->sfinfo.seekable = 0 ;
413 p->sf = sf_wchar_open (wpath, mode, &p->sfinfo) ;