summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Fletcher <colin.m.fletcher@googlemail.com>2015-02-12 12:52:36 +0000
committerRobin Gareus <robin@gareus.org>2015-03-28 18:34:03 +0100
commit050c9c3f7d695ea8736d050f3eac5c4f0a3158ca (patch)
treec8a2497da7025efa60bc77f1998d6a71201b571c
parent8806e6ec9d09ced8eeb1b659b3d956d595620ab6 (diff)
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.
-rw-r--r--libs/ardour/export_handler.cc35
1 files changed, 27 insertions, 8 deletions
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