summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorColin Fletcher <colin.m.fletcher@googlemail.com>2015-02-12 12:52:36 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2015-03-30 09:19:00 -0500
commit88146f0e3addca5ec6c434361a57eaff072122bb (patch)
tree482aea8f97afbb63d683e2c1fadec05c37db64f4 /libs
parentaca81bd89444e4105dbaff2664360b2f3c3f2770 (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.
Diffstat (limited to 'libs')
-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