From 48ec16f3d2a04295767b6bac38aed7bef5180881 Mon Sep 17 00:00:00 2001 From: Wohlstand Date: Wed, 29 Jun 2022 18:27:00 +0300 Subject: Added the chip channels allocation mode option --- utils/vlc_codec/libadlmidi.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'utils/vlc_codec/libadlmidi.c') diff --git a/utils/vlc_codec/libadlmidi.c b/utils/vlc_codec/libadlmidi.c index 5ce054f..278233f 100644 --- a/utils/vlc_codec/libadlmidi.c +++ b/utils/vlc_codec/libadlmidi.c @@ -77,6 +77,10 @@ #define VOLUME_MODEL_LONGTEXT N_( \ "Declares volume scaling model which will affect volume levels.") +#define CHANNEL_ALLOCATION_TEXT N_("Channel allocation mode") +#define CHANNEL_ALLOCATION_LONGTEXT N_( \ + "Declares the method of chip channel allocation for new notes.") + #define FULL_RANGE_CC74_TEXT N_("Full-range of brightness") #define FULL_RANGE_CC74_LONGTEXT N_( \ "Scale range of CC-74 \"Brightness\" with full 0~127 range. By default is only 0~64 affects the sounding.") @@ -103,6 +107,16 @@ static const char * const volume_models_descriptions[] = NULL }; +static const int channel_alloc_values[] = { -1, 0, 1, 2 }; +static const char * const channel_alloc_descriptions[] = +{ + N_("Auto (defined by bank)"), + N_("By sounding delays"), + N_("Released channel of same instrument"), + N_("Any released channel"), + NULL +}; + #define EMULATOR_TYPE_TEXT N_("OPL3 Emulation core") #define EMULATOR_TYPE_LINGTEXT N_( \ "OPL3 Emulator that will be used to generate final sound.") @@ -157,6 +171,9 @@ vlc_module_begin () add_integer (CONFIG_PREFIX "volume-model", 0, VOLUME_MODEL_TEXT, VOLUME_MODEL_LONGTEXT, false ) change_integer_list( volume_models_values, volume_models_descriptions ) + add_integer (CONFIG_PREFIX "channel-allocation", -1, CHANNEL_ALLOCATION_TEXT, CHANNEL_ALLOCATION_LONGTEXT, false ) + change_integer_list( channel_alloc_values, channel_alloc_descriptions ) + add_integer (CONFIG_PREFIX "emulator-type", 0, EMULATOR_TYPE_TEXT, EMULATOR_TYPE_LINGTEXT, false) change_integer_list( emulator_type_values, emulator_type_descriptions ) @@ -223,6 +240,8 @@ static int Open (vlc_object_t *p_this) adl_setVolumeRangeModel(p_sys->synth, var_InheritInteger(p_this, CONFIG_PREFIX "volume-model")); + adl_setChannelAllocMode(p_sys->synth, var_InheritInteger(p_this, CONFIG_PREFIX "channel-allocation")); + adl_setSoftPanEnabled(p_sys->synth, var_InheritBool(p_this, CONFIG_PREFIX "full-panning")); adl_setFullRangeBrightness(p_sys->synth, var_InheritBool(p_this, CONFIG_PREFIX "full-range-brightness")); -- cgit v1.2.3