From 4997dec4143ef0242aa0e636505bec6bc3aaf7e2 Mon Sep 17 00:00:00 2001 From: Tim Mayberry Date: Wed, 5 Sep 2007 01:53:51 +0000 Subject: Fix source directory paths so that the session name element is "legalized" and compatible with 2.0 Fixes bug 1854. git-svn-id: svn://localhost/ardour2/trunk@2418 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/ardour/session_directory.h | 7 +++++++ libs/ardour/session_directory.cc | 14 +++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) (limited to 'libs') 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 @@ -115,6 +115,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. */ 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 #include +#include #include "i18n.h" @@ -85,20 +86,27 @@ SessionDirectory::old_sound_path () const return m_root_path / old_sound_dir_name; } +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 -- cgit v1.2.3