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
1d445d10
Commit
1d445d10
authored
Feb 20, 2017
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SongPrint: move duplicate code into PrintRange()
parent
29d03ab9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
20 deletions
+14
-20
SongPrint.cxx
src/SongPrint.cxx
+14
-20
No files found.
src/SongPrint.cxx
View file @
1d445d10
...
@@ -76,14 +76,11 @@ song_print_uri(Response &r, Partition &partition,
...
@@ -76,14 +76,11 @@ song_print_uri(Response &r, Partition &partition,
song_print_uri
(
r
,
partition
,
song
.
GetURI
(),
base
);
song_print_uri
(
r
,
partition
,
song
.
GetURI
(),
base
);
}
}
void
static
void
song_print_info
(
Response
&
r
,
Partition
&
partition
,
PrintRange
(
Response
&
r
,
SongTime
start_time
,
SongTime
end_time
)
const
LightSong
&
song
,
bool
base
)
{
{
song_print_uri
(
r
,
partition
,
song
,
base
);
const
unsigned
start_ms
=
start_time
.
ToMS
();
const
unsigned
end_ms
=
end_time
.
ToMS
();
const
unsigned
start_ms
=
song
.
start_time
.
ToMS
();
const
unsigned
end_ms
=
song
.
end_time
.
ToMS
();
if
(
end_ms
>
0
)
if
(
end_ms
>
0
)
r
.
Format
(
"Range: %u.%03u-%u.%03u
\n
"
,
r
.
Format
(
"Range: %u.%03u-%u.%03u
\n
"
,
...
@@ -95,6 +92,15 @@ song_print_info(Response &r, Partition &partition,
...
@@ -95,6 +92,15 @@ song_print_info(Response &r, Partition &partition,
r
.
Format
(
"Range: %u.%03u-
\n
"
,
r
.
Format
(
"Range: %u.%03u-
\n
"
,
start_ms
/
1000
,
start_ms
/
1000
,
start_ms
%
1000
);
start_ms
%
1000
);
}
void
song_print_info
(
Response
&
r
,
Partition
&
partition
,
const
LightSong
&
song
,
bool
base
)
{
song_print_uri
(
r
,
partition
,
song
,
base
);
PrintRange
(
r
,
song
.
start_time
,
song
.
end_time
);
if
(
song
.
mtime
>
0
)
if
(
song
.
mtime
>
0
)
time_print
(
r
,
"Last-Modified"
,
song
.
mtime
);
time_print
(
r
,
"Last-Modified"
,
song
.
mtime
);
...
@@ -108,19 +114,7 @@ song_print_info(Response &r, Partition &partition,
...
@@ -108,19 +114,7 @@ song_print_info(Response &r, Partition &partition,
{
{
song_print_uri
(
r
,
partition
,
song
,
base
);
song_print_uri
(
r
,
partition
,
song
,
base
);
const
unsigned
start_ms
=
song
.
GetStartTime
().
ToMS
();
PrintRange
(
r
,
song
.
GetStartTime
(),
song
.
GetEndTime
());
const
unsigned
end_ms
=
song
.
GetEndTime
().
ToMS
();
if
(
end_ms
>
0
)
r
.
Format
(
"Range: %u.%03u-%u.%03u
\n
"
,
start_ms
/
1000
,
start_ms
%
1000
,
end_ms
/
1000
,
end_ms
%
1000
);
else
if
(
start_ms
>
0
)
r
.
Format
(
"Range: %u.%03u-
\n
"
,
start_ms
/
1000
,
start_ms
%
1000
);
if
(
song
.
GetLastModified
()
>
0
)
if
(
song
.
GetLastModified
()
>
0
)
time_print
(
r
,
"Last-Modified"
,
song
.
GetLastModified
());
time_print
(
r
,
"Last-Modified"
,
song
.
GetLastModified
());
...
...
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