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
90a2109f
Commit
90a2109f
authored
Apr 26, 2020
by
John Regan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gme: add configurable fade-out time
Also include fade-out time in song length.
parent
464b9021
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
+10
-3
plugins.rst
doc/plugins.rst
+2
-0
GmeDecoderPlugin.cxx
src/decoder/plugins/GmeDecoderPlugin.cxx
+8
-3
No files found.
doc/plugins.rst
View file @
90a2109f
...
...
@@ -391,6 +391,8 @@ Video game music file emulator based on `game-music-emu <https://bitbucket.org/m
- Description
* - **accuracy yes|no**
- Enable more accurate sound emulation.
* - **default_fade**
- The default fade-out time, in seconds. Used by songs that don't specify their own fade-out time.
hybrid_dsd
----------
...
...
src/decoder/plugins/GmeDecoderPlugin.cxx
View file @
90a2109f
...
...
@@ -60,6 +60,7 @@ struct GmeContainerPath {
#if GME_VERSION >= 0x000600
static
int
gme_accuracy
;
#endif
static
unsigned
gme_default_fade
;
static
bool
gme_plugin_init
([[
maybe_unused
]]
const
ConfigBlock
&
block
)
...
...
@@ -70,6 +71,10 @@ gme_plugin_init([[maybe_unused]] const ConfigBlock &block)
?
(
int
)
accuracy
->
GetBoolValue
()
:
-
1
;
#endif
auto
fade
=
block
.
GetBlockParam
(
"default_fade"
);
gme_default_fade
=
fade
!=
nullptr
?
fade
->
GetUnsignedValue
()
*
1000
:
8000
;
return
true
;
}
...
...
@@ -171,7 +176,7 @@ gme_file_decode(DecoderClient &client, Path path_fs)
gme_free_info
(
ti
);
const
SignedSongTime
song_len
=
length
>
0
?
SignedSongTime
::
FromMS
(
length
)
?
SignedSongTime
::
FromMS
(
length
+
gme_default_fade
)
:
SignedSongTime
::
Negative
();
/* initialize the MPD decoder */
...
...
@@ -189,7 +194,7 @@ gme_file_decode(DecoderClient &client, Path path_fs)
if
(
length
>
0
)
gme_set_fade
(
emu
,
length
#if GME_VERSION >= 0x000700
,
8000
,
gme_default_fade
#endif
);
...
...
@@ -224,7 +229,7 @@ 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
));
handler
.
OnDuration
(
SongTime
::
FromMS
(
info
.
play_length
+
gme_default_fade
));
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