make AutomationList::operator==() private and abort() as its core, because it should...
[ardour.git] / libs / ardour / coreaudiosource.cc
index ef99b9afcfb7c5adcb15009837f19c21ed93f95e..010905d120cc371beaa8437b0e6613a8674bed8c 100644 (file)
@@ -28,6 +28,8 @@
 #include <appleutility/CAAudioFile.h>
 #include <appleutility/CAStreamBasicDescription.h>
 
+#include <glibmm/fileutils.h>
+
 #include "i18n.h"
 
 #include <AudioToolbox/AudioFormat.h>
@@ -36,21 +38,32 @@ using namespace std;
 using namespace ARDOUR;
 using namespace PBD;
 
+/** Create a new CoreAudioSource using session state, which implies that the
+ *  file must already exist.
+ */
 CoreAudioSource::CoreAudioSource (Session& s, const XMLNode& node)
        : Source (s, node)
        , AudioFileSource (s, node)
 {
        init_cafile ();
+
+        assert (Glib::file_test (_path, Glib::FILE_TEST_EXISTS));
+       existence_check ();
 }
 
+/** Create a new CoreAudioSource from an existing file. Sources created with this
+ *  method are never writable or removable.
+ */
 CoreAudioSource::CoreAudioSource (Session& s, const string& path, int chn, Flag flags)
-       /* files created this way are never writable or removable */
        : Source (s, DataType::AUDIO, path, Source::Flag (flags & ~(Writable|Removable|RemovableIfEmpty|RemoveAtDestroy))),
                AudioFileSource (s, path,
                        Source::Flag (flags & ~(Writable|Removable|RemovableIfEmpty|RemoveAtDestroy)))
 {
        _channel = chn;
        init_cafile ();
+
+        assert (Glib::file_test (_path, Glib::FILE_TEST_EXISTS));
+       existence_check ();
 }
 
 void
@@ -224,7 +237,7 @@ CoreAudioSource::get_soundfile_info (string path, SoundFileInfo& _info, string&)
 {
        FSRef ref;
        ExtAudioFileRef af = 0;
-       size_t size;
+       UInt32 size;
        CFStringRef name;
        int ret = -1;