aboutsummaryrefslogtreecommitdiffstats
path: root/src/db
diff options
context:
space:
mode:
Diffstat (limited to 'src/db')
-rw-r--r--src/db/plugins/simple/Song.cxx11
-rw-r--r--src/db/plugins/simple/Song.hxx9
2 files changed, 11 insertions, 9 deletions
diff --git a/src/db/plugins/simple/Song.cxx b/src/db/plugins/simple/Song.cxx
index ff7796b30..fbfc2ec19 100644
--- a/src/db/plugins/simple/Song.cxx
+++ b/src/db/plugins/simple/Song.cxx
@@ -30,7 +30,8 @@
#include <stdlib.h>
inline Song::Song(const char *_uri, size_t uri_length, Directory &_parent)
- :parent(&_parent), mtime(0), start_ms(0), end_ms(0)
+ :parent(&_parent), mtime(0),
+ start_time(SongTime::zero()), end_time(SongTime::zero())
{
memcpy(uri, _uri, uri_length + 1);
}
@@ -59,8 +60,8 @@ Song::NewFrom(DetachedSong &&other, Directory &parent)
Song *song = song_alloc(other.GetURI(), parent);
song->tag = std::move(other.WritableTag());
song->mtime = other.GetLastModified();
- song->start_ms = other.GetStartTime().ToMS();
- song->end_ms = other.GetEndTime().ToMS();
+ song->start_time = other.GetStartTime();
+ song->end_time = other.GetEndTime();
return song;
}
@@ -105,7 +106,7 @@ Song::Export() const
dest.real_uri = nullptr;
dest.tag = &tag;
dest.mtime = mtime;
- dest.start_time = SongTime::FromMS(start_ms);
- dest.end_time = SongTime::FromMS(end_ms);
+ dest.start_time = start_time;
+ dest.end_time = end_time;
return dest;
}
diff --git a/src/db/plugins/simple/Song.hxx b/src/db/plugins/simple/Song.hxx
index b2e85aa6b..9f3a4a3ef 100644
--- a/src/db/plugins/simple/Song.hxx
+++ b/src/db/plugins/simple/Song.hxx
@@ -20,6 +20,7 @@
#ifndef MPD_SONG_HXX
#define MPD_SONG_HXX
+#include "Chrono.hxx"
#include "tag/Tag.hxx"
#include "Compiler.h"
@@ -71,15 +72,15 @@ struct Song {
time_t mtime;
/**
- * Start of this sub-song within the file in milliseconds.
+ * Start of this sub-song within the file.
*/
- unsigned start_ms;
+ SongTime start_time;
/**
- * End of this sub-song within the file in milliseconds.
+ * End of this sub-song within the file.
* Unused if zero.
*/
- unsigned end_ms;
+ SongTime end_time;
/**
* The file name.