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__
25 #include "pbd/filesystem.h"
29 class SessionDirectory
34 * @param session_path An absolute path to a session directory.
36 SessionDirectory (const PBD::sys::path& session_path);
39 * @return the absolute path to the root directory of the session
41 const PBD::sys::path root_path() const { return m_root_path; }
44 * @return the absolute path to the directory in which
45 * the session stores audio files.
47 * If the session is an older session with an existing
48 * "sounds" directory then it will return a path to that
49 * directory otherwise it will return the new location
50 * of root_path()/interchange/session_name/audiofiles
52 const PBD::sys::path sound_path () const;
55 * @return the absolute path to the directory in which
56 * the session stores STUB audio files.
58 * If the session is an older session with an existing
59 * "sounds" directory then it will return a path to that
60 * directory otherwise it will return the new location
61 * of root_path()/interchange/session_name/audiofiles/.stubs
63 const PBD::sys::path sound_stub_path () const;
66 * @return the absolute path to the directory in which
67 * the session stores MIDI files, ie
68 * root_path()/interchange/session_name/midifiles
70 const PBD::sys::path midi_path () const;
73 * @return the absolute path to the directory in which
74 * the session stores STUB MIDI files, ie
75 * root_path()/interchange/session_name/midifiles/.stubs
77 const PBD::sys::path midi_stub_path () const;
80 * @return the absolute path to the directory in which
81 * the session stores MIDNAM patch files, ie
82 * root_path()/interchange/session_name/patchfiles
84 const PBD::sys::path midi_patch_path () const;
87 * @return The absolute path to the directory in which all
88 * peak files are stored for a session.
90 const PBD::sys::path peak_path () const;
93 * @return The absolute path to the directory that audio
94 * files are moved to when they are no longer part of the
97 const PBD::sys::path dead_sound_path () const;
100 * @return The absolute path to the directory that midi
101 * files are moved to when they are no longer part of the
104 const PBD::sys::path dead_midi_path () const;
107 * @return The absolute path to the directory that audio
108 * files are created in by default when exporting.
110 const PBD::sys::path export_path () const;
113 * @return true if session directory and all the required
114 * subdirectories exist.
116 bool is_valid () const;
119 * Create the session directory and all the subdirectories.
121 * @throw PBD::sys::filesystem_error if the directories were
122 * not able to be created.
124 * @return true If a new session directory was created, otherwise
125 * (if it already existed) false.
134 * @return The path to the old style sound directory.
135 * It isn't created by create().
137 const PBD::sys::path old_sound_path () const;
140 * @return The path to the directory under which source directories
141 * are created for different source types.
142 * i.e root_path()/interchange/session_name
144 const PBD::sys::path sources_root() const;
147 * @return a vector containing the fullpath of all subdirectories.
149 const std::vector<PBD::sys::path> sub_directories () const;
151 /// The path to the root of the session directory.
152 const PBD::sys::path m_root_path;
155 } // namespace ARDOUR