summaryrefslogtreecommitdiff
path: root/libs/ardour/session_directory.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2012-10-23 14:52:26 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2012-10-23 14:52:26 +0000
commit35c6b52c36ca047ada5b1b127128c03049ebfc89 (patch)
tree0ae4967ae71420d94bf1053dbb44d725689d8734 /libs/ardour/session_directory.cc
parent506adcb7a2cd237cecdac151fd2682506a55ac89 (diff)
probable fix for not being able to find audio files in a 2.X session that had "illegal" characters in the session name - adds the 2.X version of the search path to the audio file search path, if it exists
git-svn-id: svn://localhost/ardour2/branches/3.0@13321 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/session_directory.cc')
-rw-r--r--libs/ardour/session_directory.cc22
1 files changed, 22 insertions, 0 deletions
diff --git a/libs/ardour/session_directory.cc b/libs/ardour/session_directory.cc
index ec4fded685..7ff9c6f5a7 100644
--- a/libs/ardour/session_directory.cc
+++ b/libs/ardour/session_directory.cc
@@ -103,6 +103,22 @@ SessionDirectory::sources_root () const
}
const std::string
+SessionDirectory::sources_root_2X () const
+{
+ std::string p = m_root_path;
+ std::string filename = Glib::path_get_basename(p);
+
+ if (filename == ".") {
+ p = PBD::get_absolute_path (m_root_path);
+ }
+
+ const string legalized_root (legalize_for_path_2X (Glib::path_get_basename(p)));
+
+ std::string sources_root_path = Glib::build_filename (m_root_path, interchange_dir_name);
+ return Glib::build_filename (sources_root_path, legalized_root);
+}
+
+const std::string
SessionDirectory::sound_path () const
{
if (Glib::file_test (old_sound_path (), Glib::FILE_TEST_IS_DIR)) return old_sound_path();
@@ -112,6 +128,12 @@ SessionDirectory::sound_path () const
}
const std::string
+SessionDirectory::sound_path_2X () const
+{
+ return Glib::build_filename (sources_root_2X(), sound_dir_name);
+}
+
+const std::string
SessionDirectory::midi_path () const
{
return Glib::build_filename (sources_root(), midi_dir_name);