From 35c6b52c36ca047ada5b1b127128c03049ebfc89 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Tue, 23 Oct 2012 14:52:26 +0000 Subject: 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 --- libs/ardour/session_directory.cc | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'libs/ardour/session_directory.cc') 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 @@ -102,6 +102,22 @@ SessionDirectory::sources_root () const return Glib::build_filename (sources_root_path, legalized_root); } +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 { @@ -111,6 +127,12 @@ SessionDirectory::sound_path () const return Glib::build_filename (sources_root(), sound_dir_name); } +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 { -- cgit v1.2.3