From 8cbb9727e959a744057de387a293aecdce09a62c Mon Sep 17 00:00:00 2001 From: Sakari Bergen Date: Sun, 17 Mar 2013 12:32:48 +0200 Subject: Handle mutiple export files with the same extension but different format. If multiple filenames have the same extension, append the format name to the filename. This still requires a bit of extra logic to be optimal, as the format name will now be added in some situations where it is not needed. However, this is better than producing a broken file... --- libs/ardour/export_filename.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libs/ardour/export_filename.cc') diff --git a/libs/ardour/export_filename.cc b/libs/ardour/export_filename.cc index a5b0a07a60..9e126ed087 100644 --- a/libs/ardour/export_filename.cc +++ b/libs/ardour/export_filename.cc @@ -49,6 +49,7 @@ ExportFilename::ExportFilename (Session & session) : include_session (false), include_revision (false), include_channel_config (false), + include_format_name (false), include_channel (false), include_timespan (true), // Include timespan name always include_time (false), @@ -206,6 +207,12 @@ ExportFilename::get_path (ExportFormatSpecPtr format) const filename_empty = false; } + if (include_format_name) { + path += filename_empty ? "" : "_"; + path += format->name(); + filename_empty = false; + } + path += "."; path += format->extension (); -- cgit v1.2.3