summaryrefslogtreecommitdiff
path: root/libs/ardour/audiofilesource.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2007-04-06 02:27:24 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2007-04-06 02:27:24 +0000
commit8ed825c3dddbd0feaf30ef1311dac30454ac5cdd (patch)
tree106031abb005110218ceafc135adca98f0089c5b /libs/ardour/audiofilesource.cc
parentd4a73c373a5447ed777b62206159e57a2cc88607 (diff)
fix nasty logic error that leads to crashing bugs when trying to operate on regions that have been subject to undo/redo
git-svn-id: svn://localhost/ardour2/trunk@1670 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/audiofilesource.cc')
-rw-r--r--libs/ardour/audiofilesource.cc29
1 files changed, 27 insertions, 2 deletions
diff --git a/libs/ardour/audiofilesource.cc b/libs/ardour/audiofilesource.cc
index 9a3bf266ae..929cfc8083 100644
--- a/libs/ardour/audiofilesource.cc
+++ b/libs/ardour/audiofilesource.cc
@@ -29,11 +29,13 @@
#include <pbd/pathscanner.h>
#include <pbd/stl_delete.h>
#include <pbd/strsplit.h>
+#include <pbd/shortpath.h>
#include <pbd/enumwriter.h>
#include <sndfile.h>
#include <glibmm/miscutils.h>
+#include <glibmm/fileutils.h>
#include <ardour/audiofilesource.h>
#include <ardour/sndfile_helpers.h>
@@ -366,10 +368,33 @@ AudioFileSource::find (ustring& pathstr, bool must_exist, bool& isnew)
isnew = false;
- /* clean up PATH:CHANNEL notation so that we are looking for the correct path */
+ /* i (paul) made a nasty design error by using ':' as a special character in
+ Ardour 0.99 .. this hack tries to make things sort of work.
+ */
if ((pos = pathstr.find_last_of (':')) != ustring::npos) {
- pathstr = pathstr.substr (0, pos);
+ if (Glib::file_test (pathstr, Glib::FILE_TEST_EXISTS)) {
+ /* its a real file, no problem */
+
+ } else {
+
+ if (must_exist) {
+
+ /* older session using file:channel syntax */
+
+ warning << string_compose (_("This older session references an embedded\n\
+non-mono audio file:\n\n%1\n\n \
+The session file may be edited or the file must be removed before it can be used."),
+ short_path (pathstr, 48))
+ << endmsg;
+ return false;
+
+ } else {
+
+ /* new derived file (e.g. for timefx) being created in a newer session */
+
+ }
+ }
}
if (pathstr[0] != '/') {