diff options
author | Doug McLain <doug@nostar.net> | 2007-02-15 16:44:22 +0000 |
---|---|---|
committer | Doug McLain <doug@nostar.net> | 2007-02-15 16:44:22 +0000 |
commit | 1cf6978cadcfc9a32b3ed52914d0fc80f3359e29 (patch) | |
tree | d0334baf4d9870dadfd64c8c56d369ac5648ef2d /libs | |
parent | e72e12d4bab557bbbc9d9cfa2a574ad06c3e8170 (diff) |
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
Diffstat (limited to 'libs')
-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 |
3 files changed, 19 insertions, 0 deletions
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; |