summaryrefslogtreecommitdiff
path: root/src/tag/TagBuilder.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-08-29 12:14:27 +0200
committerMax Kellermann <max@duempel.org>2014-08-29 13:20:58 +0200
commit7c25d83f1cc4c7db2d2d3f4506525dd056b885e8 (patch)
treeb710e3f3d0f4edf7de0dcf6d61c823d8da7c9027 /src/tag/TagBuilder.cxx
parent8ce30c6a69a64f37a866541f66e3f242fe901f49 (diff)
Tag: use SignedSongTime for the song duration
Diffstat (limited to 'src/tag/TagBuilder.cxx')
-rw-r--r--src/tag/TagBuilder.cxx18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/tag/TagBuilder.cxx b/src/tag/TagBuilder.cxx
index bc8ea2ae7..85060e9ee 100644
--- a/src/tag/TagBuilder.cxx
+++ b/src/tag/TagBuilder.cxx
@@ -29,7 +29,7 @@
#include <stdlib.h>
TagBuilder::TagBuilder(const Tag &other)
- :time(other.time), has_playlist(other.has_playlist)
+ :duration(other.duration), has_playlist(other.has_playlist)
{
items.reserve(other.num_items);
@@ -40,7 +40,7 @@ TagBuilder::TagBuilder(const Tag &other)
}
TagBuilder::TagBuilder(Tag &&other)
- :time(other.time), has_playlist(other.has_playlist)
+ :duration(other.duration), has_playlist(other.has_playlist)
{
/* move all TagItem pointers from the Tag object; we don't
need to contact the tag pool, because all we do is move
@@ -58,7 +58,7 @@ TagBuilder &
TagBuilder::operator=(const TagBuilder &other)
{
/* copy all attributes */
- time = other.time;
+ duration = other.duration;
has_playlist = other.has_playlist;
items = other.items;
@@ -74,7 +74,7 @@ TagBuilder::operator=(const TagBuilder &other)
TagBuilder &
TagBuilder::operator=(TagBuilder &&other)
{
- time = other.time;
+ duration = other.duration;
has_playlist = other.has_playlist;
items = std::move(other.items);
@@ -84,7 +84,7 @@ TagBuilder::operator=(TagBuilder &&other)
TagBuilder &
TagBuilder::operator=(Tag &&other)
{
- time = other.time;
+ duration = other.duration;
has_playlist = other.has_playlist;
/* move all TagItem pointers from the Tag object; we don't
@@ -105,7 +105,7 @@ TagBuilder::operator=(Tag &&other)
void
TagBuilder::Clear()
{
- time = -1;
+ duration = SignedSongTime::Negative();
has_playlist = false;
RemoveAll();
}
@@ -115,7 +115,7 @@ TagBuilder::Commit(Tag &tag)
{
tag.Clear();
- tag.time = time;
+ tag.duration = duration;
tag.has_playlist = has_playlist;
/* move all TagItem pointers to the new Tag object without
@@ -162,8 +162,8 @@ TagBuilder::HasType(TagType type) const
void
TagBuilder::Complement(const Tag &other)
{
- if (time <= 0)
- time = other.time;
+ if (duration.IsNegative())
+ duration = other.duration;
has_playlist |= other.has_playlist;