summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorTaybin Rutkin <taybin@taybin.com>2006-03-06 16:04:46 +0000
committerTaybin Rutkin <taybin@taybin.com>2006-03-06 16:04:46 +0000
commit4c9e99322edbcdb88818208205d81ca374f27124 (patch)
tree345857e19038306f816765ae51c19decac0c43b5 /libs
parentaed3483e14a3bf85ec793b50d5dda69ecf6deaf9 (diff)
Use AudioFile.h instead of ExtAudioFile.h.
git-svn-id: svn://localhost/trunk/ardour2@352 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/ardour/coreaudio_source.h6
-rw-r--r--libs/ardour/coreaudio_source.cc26
2 files changed, 16 insertions, 16 deletions
diff --git a/libs/ardour/ardour/coreaudio_source.h b/libs/ardour/ardour/coreaudio_source.h
index 54ccd1080d..394c8af795 100644
--- a/libs/ardour/ardour/coreaudio_source.h
+++ b/libs/ardour/ardour/coreaudio_source.h
@@ -23,7 +23,7 @@
#include <ardour/source.h>
-#include <AudioToolbox/ExtendedAudioFile.h>
+#include <AudioToolbox/AudioFile.h>
namespace ARDOUR {
@@ -45,8 +45,8 @@ class CoreAudioSource : public Source {
private:
static string peak_dir;
- ExtAudioFileRef* af_ref;
- uint16_t n_channels;
+ AudioFileID af;
+ AudioStreamBasicDescription _info;
uint16_t channel;
mutable float *tmpbuf;
diff --git a/libs/ardour/coreaudio_source.cc b/libs/ardour/coreaudio_source.cc
index cf0080c188..9f061e8103 100644
--- a/libs/ardour/coreaudio_source.cc
+++ b/libs/ardour/coreaudio_source.cc
@@ -79,14 +79,18 @@ CoreAudioSource::init (const string& idstr, bool build_peak)
if (err) {
throw failed_constructor();
}
- err = ExtAudioFileOpen (ref, af_ref);
+ err = AudioFileOpen (ref, 0, fsRdPerm, &af);
if (err) {
throw failed_constructor();
}
+ /* XXX get value for n_channels */
+ UInt32 size = sizeof(AudioStreamBasicDescription);
+ memset (_info, 0, size);
+
if (channel >= n_channels) {
error << string_compose(_("CoreAudioSource: file only contains %1 channels; %2 is invalid as a channel number"), n_channels, channel) << endmsg;
- ExtAudioFileDispose(*af_ref);
+ AudioFileClose(af);
throw failed_constructor();
}
@@ -103,7 +107,7 @@ CoreAudioSource::init (const string& idstr, bool build_peak)
if (build_peak) {
if (initialize_peakfile (false, file)) {
- ExtAudioFileDispose(*af_ref);
+ AudioFileClose(af);
throw failed_constructor ();
}
}
@@ -143,20 +147,16 @@ CoreAudioSource::read (Sample *dst, jack_nframes_t start, jack_nframes_t cnt) co
}
AudioBufferList abl;
- AudioBuffer ab;
-
abl.mNumberBuffers = 1;
- abl.mBuffers[0] = ab;
- ab.mNumberChannels = n_channels;
- ab.mDataByteSize = cnt;
- ab.mData = dst;
-
+ abl.mBuffers[0].mNumberChannels = n_channels;
if (n_channels == 1) {
- uint32_t ioNumber = cnt;
- err = ExtAudioFileRead(*af_ref, (UInt32*)&ioNumber, &abl);
+ abl.mBuffers[0].mDataByteSize = cnt * sizeof(float);
+ abl.mBuffers[0].mData = dst;
+ nread = cnt;
+ err = ExtAudioFileRead(*af_ref, (UInt32*)&nread, &abl);
_read_data_count = cnt * sizeof(float);
- return ioNumber;
+ return nread;
}
real_cnt = cnt * n_channels;