aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/SongSave.cxx2
-rw-r--r--src/db/plugins/simple/Song.cxx11
-rw-r--r--src/db/plugins/simple/Song.hxx9
3 files changed, 12 insertions, 10 deletions
diff --git a/src/SongSave.cxx b/src/SongSave.cxx
index d06dabfd6..8b532bedd 100644
--- a/src/SongSave.cxx
+++ b/src/SongSave.cxx
@@ -52,7 +52,7 @@ song_save(BufferedOutputStream &os, const Song &song)
{
os.Format(SONG_BEGIN "%s\n", song.uri);
- range_save(os, song.start_ms, song.end_ms);
+ range_save(os, song.start_time.ToMS(), song.end_time.ToMS());
tag_save(os, song.tag);
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.