*/
+#include <pbd/error.h>
+
#include <ardour/coreaudio_source.h>
#include "i18n.h"
FSRef ref;
err = FSPathMakeRef ((UInt8*)file.c_str(), &ref, 0);
if (err != noErr) {
+ error << err << endmsg;
throw failed_constructor();
}
err = ExtAudioFileOpen (&ref, &af);
if (err != noErr) {
+ error << err << endmsg;
ExtAudioFileDispose (af);
throw failed_constructor();
}
err = ExtAudioFileGetProperty(af,
kExtAudioFileProperty_FileDataFormat, &absd_size, &absd);
if (err != noErr) {
+ error << err << endmsg;
ExtAudioFileDispose (af);
throw failed_constructor();
}
if (channel >= n_channels) {
error << string_compose(_("CoreAudioSource: file only contains %1 channels; %2 is invalid as a channel number"), n_channels, channel) << endmsg;
+ error << err << endmsg;
ExtAudioFileDispose (af);
throw failed_constructor();
}
err = ExtAudioFileGetProperty(af, kExtAudioFileProperty_FileLengthFrames, &prop_size, &ca_frames);
if (err != noErr) {
+ error << err << endmsg;
ExtAudioFileDispose (af);
throw failed_constructor();
}
if (build_peak) {
if (initialize_peakfile (false, file)) {
+ error << "initialize peakfile failed" << endmsg;
ExtAudioFileDispose (af);
throw failed_constructor ();
}
return 0;
}
- AudioBuffer ab;
- ab.mNumberChannels = n_channels;
- ab.mDataByteSize = cnt;
- ab.mData = dst;
-
AudioBufferList abl;
abl.mNumberBuffers = 1;
- abl.mBuffers[1] = ab;
+ abl.mBuffers[0].mNumberChannels = n_channels;
+ abl.mBuffers[0].mDataByteSize = cnt;
+ abl.mBuffers[0].mData = dst;
if (n_channels == 1) {
err = ExtAudioFileRead(af, (UInt32*) &cnt, &abl);
tmpbuf = new float[tmpbufsize];
}
- ab.mDataByteSize = real_cnt;
- ab.mData = tmpbuf;
+ abl.mBuffers[0].mDataByteSize = real_cnt;
+ abl.mBuffers[0].mData = tmpbuf;
err = ExtAudioFileRead(af, (UInt32*) &real_cnt, &abl);
float *ptr = tmpbuf + channel;