diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2012-01-18 21:56:06 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2012-01-18 21:56:06 +0000 |
commit | 65c8d673a2f88db61c68bf119f9dccbe82efd9ff (patch) | |
tree | eb68af3e954faeea680de64eb190feac4a63b6a0 /libs/ardour/export_handler.cc | |
parent | 577469a06aa48310ec5cd9a6428f32c35fca5fcb (diff) |
restore ability to create TOC and CUE files during export. this is an option in a given export format, not a per-export choice. so you need export formats with them set (or not) in order to utilize this choice. the resulting CUE/TOC files have not been checked with a burner (e.g. cdrdao) and testing of them would be appreciated - i (paul) have no CD burner h/w
git-svn-id: svn://localhost/ardour2/branches/3.0@11266 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/export_handler.cc')
-rw-r--r-- | libs/ardour/export_handler.cc | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/libs/ardour/export_handler.cc b/libs/ardour/export_handler.cc index 91b3429bff..f19dfe048c 100644 --- a/libs/ardour/export_handler.cc +++ b/libs/ardour/export_handler.cc @@ -237,6 +237,17 @@ void ExportHandler::finish_timespan () { while (config_map.begin() != timespan_bounds.second) { + + ExportFormatSpecPtr fmt = config_map.begin()->second.format; + + if (fmt->with_cue()) { + export_cd_marker_file (current_timespan, fmt, config_map.begin()->second.filename->get_path(fmt), CDMarkerCUE); + } + + if (fmt->with_toc()) { + export_cd_marker_file (current_timespan, fmt, config_map.begin()->second.filename->get_path(fmt), CDMarkerTOC); + } + config_map.erase (config_map.begin()); } @@ -256,12 +267,11 @@ ExportHandler::export_cd_marker_file (ExportTimespanPtr timespan, ExportFormatSp std::string filename, CDMarkerFormat format) { string filepath; - string basename = Glib::path_get_basename(filename); - size_t ext_pos = basename.rfind('.'); - if (ext_pos != string::npos) { - basename = basename.substr(0, ext_pos); /* strip file extension, if there is one */ - } + /* do not strip file suffix because there may be more than one format, + and we do not want the CD marker file from one format to overwrite + another (e.g. foo.wav.cue > foo.aiff.cue) + */ void (ExportHandler::*header_func) (CDMarkerStatus &); void (ExportHandler::*track_func) (CDMarkerStatus &); @@ -269,13 +279,15 @@ ExportHandler::export_cd_marker_file (ExportTimespanPtr timespan, ExportFormatSp switch (format) { case CDMarkerTOC: - filepath = Glib::build_filename(Glib::path_get_dirname(filename), basename + ".toc"); + filepath = filename; + filepath += ".toc"; header_func = &ExportHandler::write_toc_header; track_func = &ExportHandler::write_track_info_toc; index_func = &ExportHandler::write_index_info_toc; break; case CDMarkerCUE: - filepath = Glib::build_filename(Glib::path_get_dirname(filename), basename + ".cue"); + filepath = filename; + filepath += ".cue"; header_func = &ExportHandler::write_cue_header; track_func = &ExportHandler::write_track_info_cue; index_func = &ExportHandler::write_index_info_cue; |