From 050c9c3f7d695ea8736d050f3eac5c4f0a3158ca Mon Sep 17 00:00:00 2001 From: Colin Fletcher Date: Thu, 12 Feb 2015 12:52:36 +0000 Subject: Add CD Metadata "PERFORMER" & "TITLE" fields to .toc & .cue export Add "PERFORMER" to the exported .toc & .cue files based on the value of the "album_artist" metadata field, and also use the value of the "album" field for the TITLE if is set, falling back to the session or range name if it is blank. --- libs/ardour/export_handler.cc | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) (limited to 'libs/ardour') diff --git a/libs/ardour/export_handler.cc b/libs/ardour/export_handler.cc index b45edc9b9e..b44c46e549 100644 --- a/libs/ardour/export_handler.cc +++ b/libs/ardour/export_handler.cc @@ -519,15 +519,26 @@ void ExportHandler::write_cue_header (CDMarkerStatus & status) { string title = status.timespan->name().compare ("Session") ? status.timespan->name() : (string) session.name(); - string catalog = SessionMetadata::Metadata()->catalog(); + + // Album metadata + string barcode = SessionMetadata::Metadata()->barcode(); + string album_artist = SessionMetadata::Metadata()->album_artist(); + string album_title = SessionMetadata::Metadata()->album(); status.out << "REM Cue file generated by " << PROGRAM_NAME << endl; - if (catalog != "") - status.out << "CATALOG " << catalog << endl; + + if (barcode != "") + status.out << "CATALOG " << barcode << endl; + + if (album_artist != "") + status.out << "PERFORMER " << cue_escape_cdtext (album_artist) << endl; + + if (album_title != "") + title = album_title; status.out << "TITLE " << cue_escape_cdtext (title) << endl; - /* The original cue sheet sepc metions five file types + /* The original cue sheet spec mentions five file types WAVE, AIFF, BINARY = "header-less" audio (44.1 kHz, 16 Bit, little endian), MOTOROLA = "header-less" audio (44.1 kHz, 16 Bit, big endian), @@ -559,15 +570,23 @@ void ExportHandler::write_toc_header (CDMarkerStatus & status) { string title = status.timespan->name().compare ("Session") ? status.timespan->name() : (string) session.name(); - string catalog = SessionMetadata::Metadata()->catalog(); - if (catalog != "") - status.out << "CATALOG " << catalog << endl; + // Album metadata + string barcode = SessionMetadata::Metadata()->barcode(); + string album_artist = SessionMetadata::Metadata()->album_artist(); + string album_title = SessionMetadata::Metadata()->album(); + + if (barcode != "") + status.out << "CATALOG " << barcode << endl; + + if (album_title != "") + title = album_title; 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 \"\"" << endl << " }" << endl << "}" << endl; + status.out << " PERFORMER \"" << toc_escape_cdtext (album_artist) << "\"" << endl; + status.out << " }" << endl << "}" << endl; } void -- cgit v1.2.3