diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2012-12-06 19:56:33 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2012-12-06 19:56:33 +0000 |
commit | 9884773eea9764b6dacd3ade6a1d49cf389fe398 (patch) | |
tree | b46b3e936a09bf40954c6b3f00ebc7f59f632723 /libs/ardour/export_filename.cc | |
parent | 27bfb0f9e2db321d9596912ed95ccb6bcd00bc57 (diff) |
various fixes for exporting, including correct handling of errors during export which previously would hang when using jack1 because jack_set_freewheel() was called from inside a process() callback; use shared_ptr<Route> in parts of export code that weren't using them before; fix up generation of export filenames so that Glib::build_filename() is used and non-existent folders are ignored
git-svn-id: svn://localhost/ardour2/branches/3.0@13610 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/export_filename.cc')
-rw-r--r-- | libs/ardour/export_filename.cc | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/libs/ardour/export_filename.cc b/libs/ardour/export_filename.cc index 3b8c27bc07..d00b0147a7 100644 --- a/libs/ardour/export_filename.cc +++ b/libs/ardour/export_filename.cc @@ -21,6 +21,9 @@ #include <string> #include "ardour/export_filename.h" +#include <glibmm/miscutils.h> +#include <glibmm/fileutils.h> + #include "pbd/xml++.h" #include "pbd/convert.h" #include "pbd/enumwriter.h" @@ -101,15 +104,24 @@ ExportFilename::set_state (const XMLNode & node) folder = ""; if ((prop = child->property ("relative"))) { - if (!prop->value().compare ("true")) { + if (string_is_affirmative (prop->value())) { folder = session.session_directory().root_path(); } } if ((prop = child->property ("path"))) { - folder += prop->value(); + std::string tmp; + tmp = Glib::build_filename (folder, prop->value()); + if (!Glib::file_test (tmp, Glib::FILE_TEST_EXISTS)) { + warning << string_compose (_("Existing export folder for this session (%1) does not exist - ignored"), tmp) << endmsg; + } else { + folder = tmp; + } + } + + if (folder.empty()) { + folder = session.session_directory().export_path(); } - pair = get_field (node, "label"); include_label = pair.first; @@ -140,11 +152,9 @@ ExportFilename::set_state (const XMLNode & node) string ExportFilename::get_path (ExportFormatSpecPtr format) const { - string path = folder; + string path; bool filename_empty = true; - path += "/"; - if (include_session) { path += filename_empty ? "" : "_"; path += session.name(); @@ -198,7 +208,7 @@ ExportFilename::get_path (ExportFormatSpecPtr format) const path += "."; path += format->extension (); - return path; + return Glib::build_filename (folder, path); } string |