summaryrefslogtreecommitdiff
path: root/libs/ardour
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour')
-rw-r--r--libs/ardour/ardour/session_metadata.h4
-rw-r--r--libs/ardour/session_metadata.cc26
2 files changed, 30 insertions, 0 deletions
diff --git a/libs/ardour/ardour/session_metadata.h b/libs/ardour/ardour/session_metadata.h
index c0bfdb4003..7232d9ec5d 100644
--- a/libs/ardour/ardour/session_metadata.h
+++ b/libs/ardour/ardour/session_metadata.h
@@ -132,6 +132,10 @@ class LIBARDOUR_API SessionMetadata : public PBD::StatefulDestructible
void set_organization (const std::string &);
void set_country (const std::string &);
+ /*** Export ***/
+ typedef std::map<std::string,std::string> MetaDataMap;
+ void av_export_tag (MetaDataMap&) const;
+
/*** Serialization ***/
XMLNode & get_state (); //serializes stuff in the map, to be stored in session file
XMLNode & get_user_state (); //serializes stuff in the user_map, to be stored in user's config file
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(); }
+}