diff --git a/doc/plugins.rst b/doc/plugins.rst index 28efb9bb9..8bff5e3b2 100644 --- a/doc/plugins.rst +++ b/doc/plugins.rst @@ -391,6 +391,8 @@ Video game music file emulator based on `game-music-emu = 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());