string linked_path;
SoundFileInfo finfo;
int ret = 0;
+ Glib::ustring path_to_use;
track_canvas->get_window()->set_cursor (Gdk::Cursor (Gdk::WATCH));
gdk_flush ();
linked_path = session->sound_dir();
linked_path += '/';
linked_path += Glib::path_get_basename (path);
+
+ path_to_use = path;
if (link (path.c_str(), linked_path.c_str()) == 0) {
*/
path = linked_path;
+ path_to_use = Glib::path_get_basename (linked_path);
} else {
if (stat (linked_path.c_str(), &sb) == 0) {
if (sb.st_nlink > 1) { // its a hard link, assume its the one we want
path = linked_path;
+ path_to_use = Glib::path_get_basename (linked_path);
}
}
}
if ((s = session->source_by_path_and_channel (path, n)) == 0) {
source = boost::dynamic_pointer_cast<AudioFileSource> (SourceFactory::createReadable
- (*session, path, n,
+ (*session, path_to_use, n,
(mode == ImportAsTapeTrack ?
AudioFileSource::Destructive :
AudioFileSource::Flag (0)),
timeline_position = 0;
_peaks_built = false;
- if (!find (pathstr, must_exist, is_embedded(), file_is_new, _channel, _path, _name)) {
+ /* is_embedded() can't work yet, because our _path is not set */
+
+ bool embedded = determine_embeddedness (pathstr);
+
+ if (!find (pathstr, must_exist, embedded, file_is_new, _channel, _path, _name)) {
throw non_existent_source ();
}
if (embedded) {
name = pathstr;
} else {
- name = pathstr.substr (pathstr.find_last_of ('/') + 1);
+ name = Glib::path_get_basename (pathstr);
}
if (!Glib::file_test (pathstr, Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_REGULAR)) {