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
This commit is contained in:
Paul Davis 2012-01-18 21:56:06 +00:00
parent 577469a06a
commit 65c8d673a2
9 changed files with 99 additions and 10 deletions

View file

@ -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;