X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fexport_handler.cc;h=0def821ef623b5bb874268a74c40098cf96b9940;hb=7ac691ec821c1986282ba9e25b3890dcf07e3e51;hp=33e19d663f90777bcb41443e881b23b9e060623a;hpb=acd1ee1989549ecd48ee896a3e1d2158c92d6609;p=ardour.git diff --git a/libs/ardour/export_handler.cc b/libs/ardour/export_handler.cc index 33e19d663f..0def821ef6 100644 --- a/libs/ardour/export_handler.cc +++ b/libs/ardour/export_handler.cc @@ -20,7 +20,7 @@ #include "ardour/export_handler.h" -#include +#include #include #include @@ -118,7 +118,7 @@ ExportHandler::ExportHandler (Session & session) ExportHandler::~ExportHandler () { - // TODO remove files that were written but not finished + graph_builder->cleanup (export_status->aborted () ); } /** Add an export to the `to-do' list */ @@ -310,6 +310,13 @@ ExportHandler::finish_timespan () } if (fmt->tag()) { + /* close file first, otherwise TagLib enounters an ERROR_SHARING_VIOLATION + * The process cannot access the file because it is being used. + * + * TODO: check Umlauts and encoding in filename. + * TagLib eventually calls CreateFileA(), + */ + graph_builder->reset (); AudiofileTagger::tag_file(filename, *SessionMetadata::Metadata()); } @@ -520,7 +527,10 @@ ExportHandler::get_cd_marker_filename(std::string filename, CDMarkerFormat forma case CDMarkerCUE: return filename + ".cue"; case MP4Chaps: - return filename + ".chapters.txt"; + { + unsigned lastdot = filename.find_last_of('.'); + return filename.substr(0,lastdot) + ".chapters.txt"; + } default: return filename + ".marker"; // Should not be reached when actually creating a file } @@ -588,7 +598,7 @@ ExportHandler::write_toc_header (CDMarkerStatus & status) string album_title = SessionMetadata::Metadata()->album(); if (barcode != "") - status.out << "CATALOG " << barcode << endl; + status.out << "CATALOG \"" << barcode << "\"" << endl; if (album_title != "") title = album_title; @@ -596,13 +606,14 @@ ExportHandler::write_toc_header (CDMarkerStatus & status) status.out << "CD_DA" << endl; status.out << "CD_TEXT {" << endl << " LANGUAGE_MAP {" << endl << " 0 : EN" << endl << " }" << endl; status.out << " LANGUAGE 0 {" << endl << " TITLE " << toc_escape_cdtext (title) << endl ; - status.out << " PERFORMER \"" << toc_escape_cdtext (album_artist) << "\"" << endl; + status.out << " PERFORMER " << toc_escape_cdtext (album_artist) << endl; status.out << " }" << endl << "}" << endl; } void ExportHandler::write_mp4ch_header (CDMarkerStatus & status) { + status.out << "00:00:00.000 Intro" << endl; } void