1)@param mod_count number of modulators in table list_mod:
- If > 0, the function assumes that list_mod is a table and
initializes it as a list of modulators chained by next field, so that the caller
doesn't need to do this initialization. This is appropriate when the
function is called from fluid_voice_add_mod2().
- If 0, the function assumes that mod_list is a list of modulators with next
field properly initalialized by the caller. This is appropriate when the
function is called from the soundfont loader.
2) Test 11 is added to test_modulator_links.c allowing to test this new parameter.
1)@param linked_count, number of modulators in linked_mod:
- If > 0, the function assumes that linked_mod contains a table provided
by the caller. The function returns linked modulators directly in
this table which is faster because it doesn't allocate memory.
This is appropriate when the function is called from fluid_voice_add_mod2().
- If 0, the function makes internal allocation and returns the list in
linked_mod. This is appropriate when the function is called from
the soundfont loader as the list of linked modulators must exist during the
life of the preset it belongs to. NULL is returned in linked_mod if there is
no linked modulators in list_mod.
2) Test 10 is added to test_modulator_links.c allowing to test this new parameter.
- rename fluid_test_linked_mod_test_identity() to
fluid_linked_mod_dump_test_identity()
- make use of duplicate function fluid_dump_linked_mod() in
fluid_desfont.c
- add comments
- fluid_list_check_linked_mod() doens't modifiy list_mod.
This makes the function appropriate to be called by API
fluid_voice_add_mod(),fluid_synth_add_default_mod().
fluid_zone_check_linked_mod() is prepared to be called from API functions
fluid_voice_add_mod(), fluid_synth_add_default_mod().
The intend when calling these API is:
1) add a complex modulator as well a simple modulator.
2) keeping input parameter 'mod' list intact (i.e
any modulators shouldn't removed).
The changes are:
- fluid_zone_check_linked_mod() renamed fluid_list_check_linked_mod().
- fluid_zone_copy_linked_mod() renamed fluid_list_copy_linked_mod().
- Calling fluid_list_copy_linked_mod() is integrated in
fluid_list_check_linked_mod(). Now fluid_list_check_linked_mod()
have the possibility:
1) to check only the input list_mod (if linked_mod is NULL).
2) if linked_mod is not NULL, the function clones linked modulators from
lis_mod to linked_mod list.
-unit test test_modulator_links.c is updated with
fluid_zone_check_linked_mod() remamed to fluid_list_check_linked_mod() and
linked_mod parameter to NULL. The behaviour is the same.
- make use of fluid_dump_modulator() in fluid_mod.c
- make use of string literal for printf.
- allow test_fluid_zone_check_mod to be executed with no arguments.
- use of TEST_SUCCESS macro for each test.
- fix minor comments typos.
- the variable names are using zero-based indices (eg, mod0,mod1,..)
(instead of 1 based indices).
- this naming is coherent with indices displayed on output which are
zero-based:
Example of output message:
fluidsynth: warning: invalid destination test zone with linked modulators/mod1
This message says that mod1 (i.e modulator at index 1 in the list) is
an invalid destination.