Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
888ab0c8
Commit
888ab0c8
authored
Aug 28, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
db/simple/Song: use std::chrono::duration for start_ms and end_ms
parent
2efd8ef5
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
10 deletions
+12
-10
SongSave.cxx
src/SongSave.cxx
+1
-1
Song.cxx
src/db/plugins/simple/Song.cxx
+6
-5
Song.hxx
src/db/plugins/simple/Song.hxx
+5
-4
No files found.
src/SongSave.cxx
View file @
888ab0c8
...
...
@@ -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
);
...
...
src/db/plugins/simple/Song.cxx
View file @
888ab0c8
...
...
@@ -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
;
}
src/db/plugins/simple/Song.hxx
View file @
888ab0c8
...
...
@@ -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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment