openmpt: add at_end option

This commit is contained in:
latex 2023-01-06 02:48:10 +01:00
parent d7de8b1453
commit 7774e78864
2 changed files with 6 additions and 0 deletions

View File

@ -531,6 +531,8 @@ Module player based on `libopenmpt <https://lib.openmpt.org>`_.
- Sets the amount of volume ramping done by the libopenmpt mixer. The default value is -1, which indicates a recommended default value. The meaningful value range is [-1..10]. A value of 0 completely disables volume ramping. This might cause clicks in sound output. Higher values imply slower/softer volume ramps.
* - **sync_samples yes|no**
- Syncs sample playback when seeking. Defaults to yes.
* - **at_end fadeout|stop**
- Chooses the behaviour when the end of song is reached. "fadeout": Fades the module out for a short while. "stop": will immediately stop playing and MPD will play next track.
* - **emulate_amiga yes|no**
- Enables the Amiga resampler for Amiga modules. This emulates the sound characteristics of the Paula chip and overrides the selected interpolation filter. Non-Amiga module formats are not affected by this setting. Defaults to yes.
* - **emulate_amiga_type**

View File

@ -42,6 +42,7 @@ static int openmpt_interpolation_filter;
static bool openmpt_override_mptm_interp_filter;
static int openmpt_volume_ramping;
static bool openmpt_sync_samples;
static std::string_view openmpt_at_end;
static bool openmpt_emulate_amiga;
#ifdef HAVE_LIBOPENMPT_VERSION_0_5
static std::string_view openmpt_emulate_amiga_type;
@ -56,6 +57,7 @@ openmpt_decoder_init(const ConfigBlock &block)
openmpt_override_mptm_interp_filter = block.GetBlockValue("override_mptm_interp_filter", false);
openmpt_volume_ramping = block.GetBlockValue("volume_ramping", -1);
openmpt_sync_samples = block.GetBlockValue("sync_samples", true);
openmpt_at_end = block.GetBlockValue("at_end", "fadeout");
openmpt_emulate_amiga = block.GetBlockValue("emulate_amiga", true);
#ifdef HAVE_LIBOPENMPT_VERSION_0_5
openmpt_emulate_amiga_type = block.GetBlockValue("emulate_amiga_type", "auto");
@ -92,9 +94,11 @@ mod_decode(DecoderClient &client, InputStream &is)
mod.ctl_set_boolean("seek.sync_samples", openmpt_sync_samples);
mod.ctl_set_boolean("render.resampler.emulate_amiga", openmpt_emulate_amiga);
mod.ctl_set_text("render.resampler.emulate_amiga_type", openmpt_emulate_amiga_type);
mod.ctl_set_text("play.at_end", openmpt_at_end);
#else
mod.ctl_set("seek.sync_samples", std::to_string((unsigned)openmpt_sync_samples));
mod.ctl_set("render.resampler.emulate_amiga", std::to_string((unsigned)openmpt_emulate_amiga));
mod.ctl_set("play.at_end", std::to_string((unsigned)openmpt_at_end));
#endif
static constexpr unsigned channels = 2;