don't display internal returns to user
[ardour.git] / libs / ardour / caimportable.cc
index 229bfa8809a314d66e6ef9e162076d13dded6f20..e78691a1dd41621cdb27723b83107ca6390c8b64 100644 (file)
@@ -1,6 +1,6 @@
-#include <ardour/caimportable.h>
+#include "ardour/caimportable.h"
 #include <sndfile.h>
-#include <pbd/error.h>
+#include "pbd/error.h"
 
 #include "i18n.h"
 
@@ -24,7 +24,9 @@ CAImportableSource::CAImportableSource (const string& path)
                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 ();
        }
 
@@ -35,7 +37,7 @@ CAImportableSource::~CAImportableSource ()
 }
 
 nframes_t
-CAImportableSource::read (Sample* buffer, nframes_t nframes) 
+CAImportableSource::read (Sample* buffer, nframes_t nframes)
 {
        nframes_t nread = 0;
        AudioBufferList abl;
@@ -48,12 +50,12 @@ CAImportableSource::read (Sample* buffer, nframes_t nframes)
        per_channel = nframes / abl.mBuffers[0].mNumberChannels;
 
        while (nread < per_channel) {
-               
+
                UInt32 new_cnt = per_channel - 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) {
@@ -73,18 +75,18 @@ CAImportableSource::read (Sample* buffer, nframes_t nframes)
        if (!at_end && nread < per_channel) {
                return 0;
        } else {
-               return nread *  abl.mBuffers[0].mNumberChannels;
+               return nread * abl.mBuffers[0].mNumberChannels;
        }
 }
 
 uint
-CAImportableSource::channels () const 
+CAImportableSource::channels () const
 {
        return af.GetFileDataFormat().NumberChannels();
 }
 
-nframes_t
-CAImportableSource::length () const 
+framecnt_t
+CAImportableSource::length () const
 {
        return af.GetNumberFrames();
 }
@@ -114,5 +116,5 @@ CAImportableSource::seek (nframes_t pos)
        }
 }
 
-       
+