Commit 6f64fa07 authored by GrimReaperFloof's avatar GrimReaperFloof

Add repeat count setting to openmpt decoder

parent dc5b9d98
...@@ -505,6 +505,8 @@ Module player based on `libopenmpt <https://lib.openmpt.org>`_. ...@@ -505,6 +505,8 @@ Module player based on `libopenmpt <https://lib.openmpt.org>`_.
* - Setting * - Setting
- Description - Description
* - **repeat_count**
- Set how many times the module repeats. -1: repeat forever. 0: play once, repeat zero times (the default). n>0: play once and repeat n times after that.
* - **stereo_separation** * - **stereo_separation**
- Sets the stereo separation. The supported value range is [0,200]. Defaults to 100. - Sets the stereo separation. The supported value range is [0,200]. Defaults to 100.
* - **interpolation_filter 0|1|2|4|8** * - **interpolation_filter 0|1|2|4|8**
......
...@@ -38,6 +38,7 @@ static constexpr Domain openmpt_domain("openmpt"); ...@@ -38,6 +38,7 @@ static constexpr Domain openmpt_domain("openmpt");
static constexpr size_t OPENMPT_FRAME_SIZE = 4096; static constexpr size_t OPENMPT_FRAME_SIZE = 4096;
static constexpr int32_t OPENMPT_SAMPLE_RATE = 48000; static constexpr int32_t OPENMPT_SAMPLE_RATE = 48000;
static int openmpt_repeat_count;
static int openmpt_stereo_separation; static int openmpt_stereo_separation;
static int openmpt_interpolation_filter; static int openmpt_interpolation_filter;
static bool openmpt_override_mptm_interp_filter; static bool openmpt_override_mptm_interp_filter;
...@@ -51,6 +52,7 @@ static std::string_view openmpt_emulate_amiga_type; ...@@ -51,6 +52,7 @@ static std::string_view openmpt_emulate_amiga_type;
static bool static bool
openmpt_decoder_init(const ConfigBlock &block) openmpt_decoder_init(const ConfigBlock &block)
{ {
openmpt_repeat_count = block.GetBlockValue("repeat_count", 0);
openmpt_stereo_separation = block.GetBlockValue("stereo_separation", 100); openmpt_stereo_separation = block.GetBlockValue("stereo_separation", 100);
openmpt_interpolation_filter = block.GetBlockValue("interpolation_filter", 0); openmpt_interpolation_filter = block.GetBlockValue("interpolation_filter", 0);
openmpt_override_mptm_interp_filter = block.GetBlockValue("override_mptm_interp_filter", false); openmpt_override_mptm_interp_filter = block.GetBlockValue("override_mptm_interp_filter", false);
...@@ -79,6 +81,7 @@ mod_decode(DecoderClient &client, InputStream &is) ...@@ -79,6 +81,7 @@ mod_decode(DecoderClient &client, InputStream &is)
openmpt::module mod(buffer.data(), buffer.size()); openmpt::module mod(buffer.data(), buffer.size());
/* alter settings */ /* alter settings */
mod.set_repeat_count(openmpt_repeat_count);
mod.set_render_param(mod.RENDER_STEREOSEPARATION_PERCENT, openmpt_stereo_separation); mod.set_render_param(mod.RENDER_STEREOSEPARATION_PERCENT, openmpt_stereo_separation);
mod.set_render_param(mod.RENDER_INTERPOLATIONFILTER_LENGTH, openmpt_interpolation_filter); mod.set_render_param(mod.RENDER_INTERPOLATIONFILTER_LENGTH, openmpt_interpolation_filter);
if (!openmpt_override_mptm_interp_filter && mod.get_metadata("type") == "mptm") { if (!openmpt_override_mptm_interp_filter && mod.get_metadata("type") == "mptm") {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment