save version string with session for informational purposes
[ardour.git] / libs / ardour / ardour / session_directory.h
index 16d7115aee3d3c1695fc76551a83d71fa12de833..6f4126e0bbab6b049bed0bf502a63eba627d30b1 100644 (file)
 
 #include <string>
 #include <vector>
+#include <map>
 
-#include "pbd/filesystem.h"
+#include "ardour/libardour_visibility.h"
 
 namespace ARDOUR {
 
-class SessionDirectory
+class LIBARDOUR_API SessionDirectory
 {
 public:
 
        /**
         * @param session_path An absolute path to a session directory.
         */
-       SessionDirectory (const PBD::sys::path& session_path);
+       SessionDirectory (const std::string& session_path);
 
        /**
         * Change the root path of this SessionDirectory object
@@ -43,7 +44,7 @@ public:
        /**
         * @return the absolute path to the root directory of the session
         */
-       const PBD::sys::path root_path() const { return m_root_path; }
+       const std::string root_path() const { return m_root_path; }
 
        /**
         * @return the absolute path to the directory in which
@@ -54,40 +55,57 @@ public:
         * directory otherwise it will return the new location
         * of root_path()/interchange/session_name/audiofiles
         */
-       const PBD::sys::path sound_path () const;
+       const std::string sound_path () const;
+
+       /**
+        * @return the absolute path to the directory in which
+        * the session stores audio files for Ardour 2.X.
+        *
+        * If the session is an older session with an existing
+        * "sounds" directory then it will return a path to that
+        * directory otherwise it will return the new location
+        * of root_path()/interchange/session_name/audiofiles
+        */
+       const std::string sound_path_2X () const;
 
        /**
         * @return the absolute path to the directory in which
         * the session stores MIDI files, ie
         * root_path()/interchange/session_name/midifiles
         */
-       const PBD::sys::path midi_path () const;
+       const std::string midi_path () const;
 
        /**
         * @return the absolute path to the directory in which
         * the session stores MIDNAM patch files, ie
         * root_path()/interchange/session_name/patchfiles
         */
-       const PBD::sys::path midi_patch_path () const;
+       const std::string midi_patch_path () const;
 
        /**
         * @return The absolute path to the directory in which all
         * peak files are stored for a session.
         */
-       const PBD::sys::path peak_path () const;
+       const std::string peak_path () const;
+
+       /**
+        * @return The absolute path to the directory in which all
+        * video files are stored for a session.
+        */
+       const std::string video_path () const;
 
        /**
         * @return The absolute path to the directory that source
         * files are moved to when they are no longer part of the
         * session.
         */
-       const PBD::sys::path dead_path () const;
+       const std::string dead_path () const;
 
        /**
         * @return The absolute path to the directory that audio
         * files are created in by default when exporting.
         */
-       const PBD::sys::path export_path () const;
+       const std::string export_path () const;
 
        /**
         * @return true if session directory and all the required
@@ -98,38 +116,44 @@ public:
        /**
         * Create the session directory and all the subdirectories.
         *
-        * @throw PBD::sys::filesystem_error if the directories were
-        * not able to be created.
-        *
-        * @return true If a new session directory was created, otherwise
-        * (if it already existed) false.
+        * @return true If a new session directory and subdirectories were
+        * created, otherwise false.
         *
         * @post is_valid ()
         */
        bool create ();
 
-protected:
-
        /**
-        * @return The path to the old style sound directory.
-        * It isn't created by create().
+        * @return The path to the directory under which source directories
+        * are created for different source types.
+        * i.e root_path()/interchange/session_name
         */
-       const PBD::sys::path old_sound_path () const;
+       const std::string sources_root() const;
 
        /**
         * @return The path to the directory under which source directories
-        * are created for different source types.
+        * are created for different source types in Ardour 2.X
         * i.e root_path()/interchange/session_name
         */
-       const PBD::sys::path sources_root() const;
+       const std::string sources_root_2X() const;
+
+private:
+
+       /**
+        * @return The path to the old style sound directory.
+        * It isn't created by create().
+        */
+       const std::string old_sound_path () const;
 
        /**
         * @return a vector containing the fullpath of all subdirectories.
         */
-       const std::vector<PBD::sys::path> sub_directories () const;
+       const std::vector<std::string> sub_directories () const;
 
        /// The path to the root of the session directory.
-       PBD::sys::path m_root_path;
+       std::string m_root_path;
+
+       static std::map<std::string,std::string> root_cache;
 };
 
 } // namespace ARDOUR