projects
/
ardour.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Hopefully fix disappearing MIDI recorded regions on the first record of a new session.
[ardour.git]
/
libs
/
ardour
/
caimportable.cc
diff --git
a/libs/ardour/caimportable.cc
b/libs/ardour/caimportable.cc
index 37e8f487f20b326bd08ee30078080c067af30d57..149f213222def48b574f0d236ee4dcc072fe7a8f 100644
(file)
--- a/
libs/ardour/caimportable.cc
+++ b/
libs/ardour/caimportable.cc
@@
-24,7
+24,9
@@
CAImportableSource::CAImportableSource (const string& path)
af.SetClientFormat (client_format);
} catch (CAXException& cax) {
af.SetClientFormat (client_format);
} catch (CAXException& cax) {
- error << string_compose ("CAImportable: %1", cax.mOperation) << endmsg;
+ //Don't report an error here since there is one higher up in import.
+ //Since libsndfile gets tried second, any failures here may show as
+ //invalid errors in the Error log.
throw failed_constructor ();
}
throw failed_constructor ();
}
@@
-34,12
+36,12
@@
CAImportableSource::~CAImportableSource ()
{
}
{
}
-
nframes
_t
-CAImportableSource::read (Sample* buffer,
nframes_t nframes)
+
framecnt
_t
+CAImportableSource::read (Sample* buffer,
framecnt_t nframes)
{
{
-
nframes
_t nread = 0;
+
framecnt
_t nread = 0;
AudioBufferList abl;
AudioBufferList abl;
-
nframes
_t per_channel;
+
framecnt
_t per_channel;
bool at_end = false;
abl.mNumberBuffers = 1;
bool at_end = false;
abl.mNumberBuffers = 1;
@@
-48,12
+50,12
@@
CAImportableSource::read (Sample* buffer, nframes_t nframes)
per_channel = nframes / abl.mBuffers[0].mNumberChannels;
while (nread < per_channel) {
per_channel = nframes / abl.mBuffers[0].mNumberChannels;
while (nread < per_channel) {
-
+
UInt32 new_cnt = per_channel - nread;
UInt32 new_cnt = per_channel - nread;
-
+
abl.mBuffers[0].mDataByteSize = new_cnt * abl.mBuffers[0].mNumberChannels * sizeof(Sample);
abl.mBuffers[0].mData = buffer + nread;
abl.mBuffers[0].mDataByteSize = new_cnt * abl.mBuffers[0].mNumberChannels * sizeof(Sample);
abl.mBuffers[0].mData = buffer + nread;
-
+
try {
af.Read (new_cnt, &abl);
} catch (CAXException& cax) {
try {
af.Read (new_cnt, &abl);
} catch (CAXException& cax) {
@@
-73,24
+75,24
@@
CAImportableSource::read (Sample* buffer, nframes_t nframes)
if (!at_end && nread < per_channel) {
return 0;
} else {
if (!at_end && nread < per_channel) {
return 0;
} else {
- return nread *
abl.mBuffers[0].mNumberChannels;
+ return nread * abl.mBuffers[0].mNumberChannels;
}
}
uint
}
}
uint
-CAImportableSource::channels () const
+CAImportableSource::channels () const
{
return af.GetFileDataFormat().NumberChannels();
}
{
return af.GetFileDataFormat().NumberChannels();
}
-
nframes
_t
-CAImportableSource::length () const
+
framecnt
_t
+CAImportableSource::length () const
{
return af.GetNumberFrames();
}
{
return af.GetNumberFrames();
}
-
nframes
_t
-CAImportableSource::samplerate() const
+
framecnt
_t
+CAImportableSource::samplerate
() const
{
CAStreamBasicDescription client_asbd;
{
CAStreamBasicDescription client_asbd;
@@
-105,7
+107,7
@@
CAImportableSource::samplerate() const
}
void
}
void
-CAImportableSource::seek (
nframe
s_t pos)
+CAImportableSource::seek (
framepo
s_t pos)
{
try {
af.Seek (pos);
{
try {
af.Seek (pos);
@@
-114,5
+116,5
@@
CAImportableSource::seek (nframes_t pos)
}
}
}
}
-
+