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
6423670e
Commit
6423670e
authored
Apr 26, 2020
by
John Regan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gme: use song-reported fade-out time when available
parent
90a2109f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
GmeDecoderPlugin.cxx
src/decoder/plugins/GmeDecoderPlugin.cxx
+14
-4
No files found.
src/decoder/plugins/GmeDecoderPlugin.cxx
View file @
6423670e
...
...
@@ -173,10 +173,16 @@ gme_file_decode(DecoderClient &client, Path path_fs)
}
const
int
length
=
ti
->
play_length
;
#if GME_VERSION >= 0x000700
const
int
fade
=
ti
->
fade_length
;
#else
const
int
fade
=
-
1
;
#endif
gme_free_info
(
ti
);
const
SignedSongTime
song_len
=
length
>
0
?
SignedSongTime
::
FromMS
(
length
+
gme_default_fade
)
?
SignedSongTime
::
FromMS
(
length
+
(
fade
==
-
1
?
gme_default_fade
:
fade
))
:
SignedSongTime
::
Negative
();
/* initialize the MPD decoder */
...
...
@@ -191,10 +197,10 @@ gme_file_decode(DecoderClient &client, Path path_fs)
if
(
gme_err
!=
nullptr
)
LogWarning
(
gme_domain
,
gme_err
);
if
(
length
>
0
)
if
(
length
>
0
&&
fade
!=
0
)
gme_set_fade
(
emu
,
length
#if GME_VERSION >= 0x000700
,
gme_default_
fade
,
fade
==
-
1
?
gme_default_fade
:
fade
#endif
);
...
...
@@ -229,7 +235,11 @@ ScanGmeInfo(const gme_info_t &info, unsigned song_num, int track_count,
TagHandler
&
handler
)
noexcept
{
if
(
info
.
play_length
>
0
)
handler
.
OnDuration
(
SongTime
::
FromMS
(
info
.
play_length
+
gme_default_fade
));
handler
.
OnDuration
(
SongTime
::
FromMS
(
info
.
play_length
#if GME_VERSION >= 0x000700
+
(
info
.
fade_length
==
-
1
?
gme_default_fade
:
info
.
fade_length
)
#endif
));
if
(
track_count
>
1
)
handler
.
OnTag
(
TAG_TRACK
,
StringFormat
<
16
>
(
"%u"
,
song_num
+
1
).
c_str
());
...
...
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