summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/ardour/session_directory.h7
-rw-r--r--libs/ardour/session_directory.cc14
2 files changed, 18 insertions, 3 deletions
diff --git a/libs/ardour/ardour/session_directory.h b/libs/ardour/ardour/session_directory.h
index 06fa52a53b..a4fb7d07c5 100644
--- a/libs/ardour/ardour/session_directory.h
+++ b/libs/ardour/ardour/session_directory.h
@@ -116,6 +116,13 @@ protected:
const path old_sound_path () const;
/**
+ * @return The path to the directory under which source directories
+ * are created for different source types.
+ * i.e root_path()/interchange/session_name
+ */
+ const path sources_root() const;
+
+ /**
* @return a vector containing the fullpath of all subdirectories.
*/
const vector<PBD::sys::path> sub_directories () const;
diff --git a/libs/ardour/session_directory.cc b/libs/ardour/session_directory.cc
index fcdaed3a29..1a2b476cad 100644
--- a/libs/ardour/session_directory.cc
+++ b/libs/ardour/session_directory.cc
@@ -22,6 +22,7 @@
#include <ardour/directory_names.h>
#include <ardour/session_directory.h>
+#include <ardour/utils.h>
#include "i18n.h"
@@ -86,19 +87,26 @@ SessionDirectory::old_sound_path () const
}
const path
+SessionDirectory::sources_root () const
+{
+ const string legalized_root(legalize_for_path(m_root_path.leaf()));
+
+ return m_root_path / interchange_dir_name / legalized_root;
+}
+
+const path
SessionDirectory::sound_path () const
{
if(is_directory (old_sound_path ())) return old_sound_path();
// the new style sound directory
- return m_root_path / interchange_dir_name / m_root_path.leaf() / sound_dir_name;
+ return sources_root() / sound_dir_name;
}
const path
SessionDirectory::midi_path () const
{
- // the new style sound directory
- return m_root_path / interchange_dir_name / m_root_path.leaf() / midi_dir_name;
+ return sources_root() / midi_dir_name;
}
const path