diff options
author | Tim Mayberry <mojofunk@gmail.com> | 2007-09-05 01:53:51 +0000 |
---|---|---|
committer | Tim Mayberry <mojofunk@gmail.com> | 2007-09-05 01:53:51 +0000 |
commit | 4997dec4143ef0242aa0e636505bec6bc3aaf7e2 (patch) | |
tree | cf3bfe69a32c2431288d2dce0470fe051f7749a4 /libs | |
parent | 2a7b23d51553b68c5d0ac28e68307e041feceb8a (diff) |
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
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/ardour/session_directory.h | 7 | ||||
-rw-r--r-- | libs/ardour/session_directory.cc | 14 |
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 |