diff options
-rw-r--r-- | gtk2_ardour/export_dialog.cc | 4 | ||||
-rw-r--r-- | libs/ardour/ardour/session.h | 2 | ||||
-rw-r--r-- | libs/ardour/session.cc | 1 | ||||
-rw-r--r-- | libs/ardour/session_state.cc | 16 |
4 files changed, 21 insertions, 2 deletions
diff --git a/gtk2_ardour/export_dialog.cc b/gtk2_ardour/export_dialog.cc index e0c11042ae..c55f4c70d6 100644 --- a/gtk2_ardour/export_dialog.cc +++ b/gtk2_ardour/export_dialog.cc @@ -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) { diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h index cfc2635146..f4e5f3dedc 100644 --- a/libs/ardour/ardour/session.h +++ b/libs/ardour/ardour/session.h @@ -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&); diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index d3063ba634..2da80e28f7 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -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; diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 9c2e854486..b62f4f3896 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -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 */ @@ -1908,6 +1915,15 @@ Session::template_dir () } string +Session::export_dir () const +{ + string res = _path; + res += export_dir_name; + res += '/'; + return res; +} + +string Session::suffixed_search_path (string suffix, bool data) { string path; |