summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-02-11 20:51:19 +0100
committerRobin Gareus <robin@gareus.org>2016-02-11 20:58:05 +0100
commit2c2002ee9cae4fbfa1c72839cafc147506da5887 (patch)
treead95afbb7dea06dbc4bf3d731c8c95d536bff83c /libs
parente6b06597b75010c955c6b44db0025a3e8642d9b0 (diff)
Prepare for optional timespan name during export.
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/export_filename.cc18
-rw-r--r--libs/ardour/export_handler.cc8
2 files changed, 25 insertions, 1 deletions
diff --git a/libs/ardour/export_filename.cc b/libs/ardour/export_filename.cc
index 077106a4b0..8186982384 100644
--- a/libs/ardour/export_filename.cc
+++ b/libs/ardour/export_filename.cc
@@ -169,6 +169,18 @@ ExportFilename::get_path (ExportFormatSpecPtr format) const
{
string path;
bool filename_empty = true;
+ bool with_timespan = include_timespan;
+
+ if (!include_session
+ && !include_label
+ && !include_revision
+ && !include_timespan
+ && !include_channel_config
+ && !include_channel
+ && !include_date
+ && !include_format_name) {
+ with_timespan = true;
+ }
if (include_session) {
path += filename_empty ? "" : "_";
@@ -189,7 +201,7 @@ ExportFilename::get_path (ExportFormatSpecPtr format) const
filename_empty = false;
}
- if (include_timespan && timespan) {
+ if (with_timespan && timespan) {
path += filename_empty ? "" : "_";
path += timespan->name();
filename_empty = false;
@@ -226,6 +238,10 @@ ExportFilename::get_path (ExportFormatSpecPtr format) const
filename_empty = false;
}
+ if (path.empty ()) {
+ path = "export";
+ }
+
path += ".";
path += format->extension ();
diff --git a/libs/ardour/export_handler.cc b/libs/ardour/export_handler.cc
index 6b59afec89..42de0fa0c6 100644
--- a/libs/ardour/export_handler.cc
+++ b/libs/ardour/export_handler.cc
@@ -148,6 +148,14 @@ ExportHandler::do_export ()
}
export_status->total_timespans = timespan_set.size();
+ if (export_status->total_timespans > 1) {
+ // always include timespan if there's more than one.
+ for (ConfigMap::iterator it = config_map.begin(); it != config_map.end(); ++it) {
+ FileSpec & spec = it->second;
+ spec.filename->include_timespan = true;
+ }
+ }
+
/* Start export */
Glib::Threads::Mutex::Lock l (export_status->lock());