33 af.Open (path.c_str());
35 CAStreamBasicDescription file_format (af.GetFileDataFormat());
36 CAStreamBasicDescription client_format (file_format);
42 client_format.SetCanonical(client_format.NumberChannels(),
true);
43 af.SetClientFormat (client_format);
45 }
catch (CAXException& cax) {
66 abl.mNumberBuffers = 1;
67 abl.mBuffers[0].mNumberChannels = channels();
69 per_channel = nframes / abl.mBuffers[0].mNumberChannels;
71 while (nread < per_channel) {
73 UInt32 new_cnt = per_channel - nread;
75 abl.mBuffers[0].mDataByteSize = new_cnt * abl.mBuffers[0].mNumberChannels *
sizeof(
Sample);
76 abl.mBuffers[0].mData = buffer + nread;
79 af.Read (new_cnt, &abl);
80 }
catch (CAXException& cax) {
94 if (!at_end && nread < per_channel) {
97 return nread * abl.mBuffers[0].mNumberChannels;
104 return af.GetFileDataFormat().NumberChannels();
110 return af.GetNumberFrames();
116 CAStreamBasicDescription client_asbd;
119 client_asbd = af.GetClientDataFormat ();
120 }
catch (CAXException& cax) {
125 return client_asbd.mSampleRate;
133 }
catch (CAXException& cax) {
CAImportableSource(const std::string &path)
framecnt_t length() const
LIBPBD_API Transmitter error
std::ostream & endmsg(std::ostream &ostr)
uint32_t channels() const
void seek(framepos_t pos)
framecnt_t read(Sample *buffer, framecnt_t nframes)
std::string string_compose(const std::string &fmt, const T1 &o1)
virtual ~CAImportableSource()
framecnt_t samplerate() const