2 Copyright (C) 2007 Tim Mayberry
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 #ifndef __ardour_session_directory_h__
20 #define __ardour_session_directory_h__
27 class SessionDirectory
32 * @param session_path An absolute path to a session directory.
34 SessionDirectory (const std::string& session_path);
37 * Change the root path of this SessionDirectory object
39 SessionDirectory& operator= (const std::string& path);
42 * @return the absolute path to the root directory of the session
44 const std::string root_path() const { return m_root_path; }
47 * @return the absolute path to the directory in which
48 * the session stores audio files.
50 * If the session is an older session with an existing
51 * "sounds" directory then it will return a path to that
52 * directory otherwise it will return the new location
53 * of root_path()/interchange/session_name/audiofiles
55 const std::string sound_path () const;
58 * @return the absolute path to the directory in which
59 * the session stores audio files for Ardour 2.X.
61 * If the session is an older session with an existing
62 * "sounds" directory then it will return a path to that
63 * directory otherwise it will return the new location
64 * of root_path()/interchange/session_name/audiofiles
66 const std::string sound_path_2X () const;
69 * @return the absolute path to the directory in which
70 * the session stores MIDI files, ie
71 * root_path()/interchange/session_name/midifiles
73 const std::string midi_path () const;
76 * @return the absolute path to the directory in which
77 * the session stores MIDNAM patch files, ie
78 * root_path()/interchange/session_name/patchfiles
80 const std::string midi_patch_path () const;
83 * @return The absolute path to the directory in which all
84 * peak files are stored for a session.
86 const std::string peak_path () const;
89 * @return The absolute path to the directory in which all
90 * video files are stored for a session.
92 const std::string video_path () const;
95 * @return The absolute path to the directory that source
96 * files are moved to when they are no longer part of the
99 const std::string dead_path () const;
102 * @return The absolute path to the directory that audio
103 * files are created in by default when exporting.
105 const std::string export_path () const;
108 * @return true if session directory and all the required
109 * subdirectories exist.
111 bool is_valid () const;
114 * Create the session directory and all the subdirectories.
116 * @return true If a new session directory and subdirectories were
117 * created, otherwise false.
124 * @return The path to the directory under which source directories
125 * are created for different source types.
126 * i.e root_path()/interchange/session_name
128 const std::string sources_root() const;
131 * @return The path to the directory under which source directories
132 * are created for different source types in Ardour 2.X
133 * i.e root_path()/interchange/session_name
135 const std::string sources_root_2X() const;
140 * @return The path to the old style sound directory.
141 * It isn't created by create().
143 const std::string old_sound_path () const;
146 * @return a vector containing the fullpath of all subdirectories.
148 const std::vector<std::string> sub_directories () const;
150 /// The path to the root of the session directory.
151 std::string m_root_path;
154 } // namespace ARDOUR