summaryrefslogtreecommitdiff
path: root/libs/ardour/coreaudiosource.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2014-04-14 03:03:35 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2014-04-14 13:07:07 -0400
commitbe0da8ff5c1a3bfbdf0a2934a79aeeed26ade3bc (patch)
tree85176c4f282901d2b61485aad0c7aaa0e9957987 /libs/ardour/coreaudiosource.cc
parent2e3a84b15afb749fbbfd05d765badb53434188b0 (diff)
merge 5764970709f15e85ec30c9cea89c318eb8114c58 from cairocanvas as final(?) change related to data loss
Diffstat (limited to 'libs/ardour/coreaudiosource.cc')
-rw-r--r--libs/ardour/coreaudiosource.cc15
1 files changed, 14 insertions, 1 deletions
diff --git a/libs/ardour/coreaudiosource.cc b/libs/ardour/coreaudiosource.cc
index 947c66e756..010905d120 100644
--- a/libs/ardour/coreaudiosource.cc
+++ b/libs/ardour/coreaudiosource.cc
@@ -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