aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-10-21 23:53:27 +0200
committerMax Kellermann <max@duempel.org>2013-10-21 23:53:30 +0200
commitf8c23488c942a89df74b231307281cf1919fab61 (patch)
tree20923b8ac9b8507ff1ce5e409d5c465e51fe6e2d
parent1e2cda923970057cfab700422ec27f94e7458c25 (diff)
downloadmpd-f8c23488c942a89df74b231307281cf1919fab61.tar.gz
mpd-f8c23488c942a89df74b231307281cf1919fab61.tar.xz
mpd-f8c23488c942a89df74b231307281cf1919fab61.zip
Song: add method ReplaceTag()
-rw-r--r--src/Song.cxx8
-rw-r--r--src/Song.hxx2
2 files changed, 10 insertions, 0 deletions
diff --git a/src/Song.cxx b/src/Song.cxx
index 7a11a0611..86a5b4672 100644
--- a/src/Song.cxx
+++ b/src/Song.cxx
@@ -109,6 +109,14 @@ Song::Free()
g_free(this);
}
+void
+Song::ReplaceTag(Tag &&_tag)
+{
+ if (tag == nullptr)
+ tag = new Tag();
+ *tag = std::move(_tag);
+}
+
gcc_pure
static inline bool
directory_equals(const Directory &a, const Directory &b)
diff --git a/src/Song.hxx b/src/Song.hxx
index bd7465013..b74690e77 100644
--- a/src/Song.hxx
+++ b/src/Song.hxx
@@ -126,6 +126,8 @@ struct Song {
return parent == &detached_root;
}
+ void ReplaceTag(Tag &&tag);
+
bool UpdateFile();
bool UpdateFileInArchive();