From d169864b5bd08c9dbd064e8543ebd074e5695216 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 20 Nov 2018 23:56:12 +0100 Subject: Prepare session-metadata export to external command --- libs/ardour/session_metadata.cc | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'libs/ardour/session_metadata.cc') diff --git a/libs/ardour/session_metadata.cc b/libs/ardour/session_metadata.cc index 61818422cf..fbe5222552 100644 --- a/libs/ardour/session_metadata.cc +++ b/libs/ardour/session_metadata.cc @@ -647,3 +647,29 @@ SessionMetadata::set_country (const string & v) { set_value ("user_country", v); } + +void +SessionMetadata::av_export_tag (MetaDataMap& meta) const +{ + if (year() > 0) { + std::ostringstream osstream; osstream << year(); + meta["year"] = osstream.str(); + } + if (track_number() > 0) { + std::ostringstream osstream; osstream << track_number(); + meta["track"] = osstream.str(); + } + if (disc_number() > 0) { + std::ostringstream osstream; osstream << disc_number(); + meta["disc"] = osstream.str(); + } + if (!title().empty()) { meta["title"] = title(); } + if (!artist().empty()) { meta["author"] = artist(); } + if (!album_artist().empty()) { meta["album_artist"] = album_artist(); } + if (!album().empty()) { meta["album"] = album(); } + if (!genre().empty()) { meta["genre"] = genre(); } + if (!composer().empty()) { meta["composer"] = composer(); } + if (!comment().empty()) { meta["comment"] = comment(); } + if (!copyright().empty()) { meta["copyright"] = copyright(); } + if (!subtitle().empty()) { meta["description"] = subtitle(); } +} -- cgit v1.2.3