This creates an export direcory for new sessions. The export dialog will also default to that directory
git-svn-id: svn://localhost/ardour2/trunk@1466 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
e72e12d4ba
commit
1cf6978cad
|
@ -947,12 +947,12 @@ ExportDialog::start_export ()
|
|||
}
|
||||
|
||||
/* If the filename hasn't been set before, use the
|
||||
directory above the current session as a default
|
||||
current session's export directory as a default
|
||||
location for the export.
|
||||
*/
|
||||
|
||||
if (file_entry.get_text().length() == 0) {
|
||||
string dir = session->path();
|
||||
string dir = session->export_dir();
|
||||
string::size_type last_slash;
|
||||
|
||||
if ((last_slash = dir.find_last_of ('/')) != string::npos && last_slash != 0) {
|
||||
|
|
|
@ -237,6 +237,7 @@ class Session : public PBD::StatefulDestructible
|
|||
string name() const { return _name; }
|
||||
string snap_name() const { return _current_snapshot_name; }
|
||||
string raid_path () const;
|
||||
string export_dir () const;
|
||||
|
||||
void set_snap_name ();
|
||||
|
||||
|
@ -1562,6 +1563,7 @@ class Session : public PBD::StatefulDestructible
|
|||
static const char* dead_sound_dir_name;
|
||||
static const char* interchange_dir_name;
|
||||
static const char* peak_dir_name;
|
||||
static const char* export_dir_name;
|
||||
|
||||
string discover_best_sound_dir (bool destructive = false);
|
||||
int ensure_sound_dir (string, string&);
|
||||
|
|
|
@ -88,6 +88,7 @@ const char* Session::sound_dir_name = X_("audiofiles");
|
|||
const char* Session::peak_dir_name = X_("peaks");
|
||||
const char* Session::dead_sound_dir_name = X_("dead_sounds");
|
||||
const char* Session::interchange_dir_name = X_("interchange");
|
||||
const char* Session::export_dir_name = X_("export");
|
||||
|
||||
Session::compute_peak_t Session::compute_peak = 0;
|
||||
Session::apply_gain_to_buffer_t Session::apply_gain_to_buffer = 0;
|
||||
|
|
|
@ -487,6 +487,13 @@ Session::create (bool& new_session, string* mix_template, nframes_t initial_leng
|
|||
return -1;
|
||||
}
|
||||
|
||||
dir = export_dir ();
|
||||
|
||||
if (g_mkdir_with_parents (dir.c_str(), 0755) < 0) {
|
||||
error << string_compose(_("Session: cannot create session export dir \"%1\" (%2)"), dir, strerror (errno)) << endmsg;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
/* check new_session so we don't overwrite an existing one */
|
||||
|
||||
|
@ -1907,6 +1914,15 @@ Session::template_dir ()
|
|||
return path;
|
||||
}
|
||||
|
||||
string
|
||||
Session::export_dir () const
|
||||
{
|
||||
string res = _path;
|
||||
res += export_dir_name;
|
||||
res += '/';
|
||||
return res;
|
||||
}
|
||||
|
||||
string
|
||||
Session::suffixed_search_path (string suffix, bool data)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user