rename fluid_get_num_mod => fluid_mod_get_linked_count

This commit is contained in:
derselbst 2019-10-10 18:23:28 +02:00
parent c5b24141e6
commit 07affccc25
7 changed files with 18 additions and 18 deletions

View file

@ -2083,7 +2083,7 @@ static void fluid_limit_mod_list(char *list_name, fluid_mod_t **list_mod)
while(mod)
{
if((mod_idx + fluid_get_num_mod(mod)) > FLUID_NUM_MOD )
if((mod_idx + fluid_mod_get_linked_count(mod)) > FLUID_NUM_MOD )
{
/* truncation of list_mod */
if(mod_idx)

View file

@ -164,7 +164,7 @@ fluid_mod_get_amount(const fluid_mod_t *mod)
* @return number of modulators.
* Must be > 1 for complex modulator and 1 for unlinked modulator.
*/
int fluid_get_num_mod(const fluid_mod_t *mod)
int fluid_mod_get_linked_count(const fluid_mod_t *mod)
{
int count = 0;
do
@ -993,8 +993,8 @@ int fluid_linked_mod_test_identity(fluid_mod_t *cm0,
fluid_mod_t *cm1,
unsigned char test_mode)
{
int count0 = fluid_get_num_mod(cm0);
int count1 = fluid_get_num_mod(cm1);
int count0 = fluid_mod_get_linked_count(cm0);
int count1 = fluid_mod_get_linked_count(cm1);
/* test of count and identity of final modulators cm0 and cm1 */
if((count0 == count1) && (count0 > 1)
@ -1155,7 +1155,7 @@ void fluid_dump_modulator(fluid_mod_t * mod)
*/
void fluid_dump_linked_mod(fluid_mod_t *mod, int mod_idx, int offset)
{
int i, num = fluid_get_num_mod(mod);
int i, num = fluid_mod_get_linked_count(mod);
printf("modulator #%d, member count:%d\n",mod_idx, num);
for (i = 0; i < num; i++)

View file

@ -50,7 +50,7 @@ struct _fluid_mod_t
/* bit link of destination in fluidsynth modulators */
#define FLUID_MOD_LINK_DEST (1 << 7) /* Link is bit 7 of destination */
int fluid_get_num_mod(const fluid_mod_t *mod);
int fluid_mod_get_linked_count(const fluid_mod_t *mod);
int fluid_get_count_mod(const fluid_mod_t *mod);
fluid_mod_t *fluid_get_next_mod(fluid_mod_t *mod);

View file

@ -1259,7 +1259,7 @@ int fluid_voice_modulate(fluid_voice_t* voice, int cc, int ctrl)
/* step 2: for every attached modulator, calculate the modulation
* value for the generator gen */
for (k = 0; k < voice->mod_count; k += fluid_get_num_mod(modk))
for (k = 0; k < voice->mod_count; k += fluid_mod_get_linked_count(modk))
{
modk = &voice->mod[k];
if (fluid_mod_has_dest(modk, gen))
@ -1597,7 +1597,7 @@ fluid_voice_add_mod_local(fluid_voice_t *voice, fluid_mod_t *mod, int mode, int
{
int i;
/* number of modulators to add: 1 for unlinked, > 1 for complex modulators */
unsigned char count = fluid_get_num_mod(mod);
unsigned char count = fluid_mod_get_linked_count(mod);
if( count < 1)
{
/* internal error: this should never happen */
@ -2230,7 +2230,7 @@ void fluid_voice_print_mod(fluid_voice_t *voice)
fluid_return_if_fail(voice != NULL);
for(i = 0, mod_idx = 0; i < voice->mod_count; i+= fluid_get_num_mod(mod), mod_idx++)
for(i = 0, mod_idx = 0; i < voice->mod_count; i+= fluid_mod_get_linked_count(mod), mod_idx++)
{
mod = &voice->mod[i];
fluid_dump_linked_mod (mod, mod_idx, i);
@ -2257,7 +2257,7 @@ int fluid_voice_get_count_modulators(fluid_voice_t *voice)
fluid_return_val_if_fail(voice != NULL, FLUID_FAILED);
for(i = 0, mod_idx = 0; i < voice->mod_count; i+= fluid_get_num_mod(mod), mod_idx++)
for(i = 0, mod_idx = 0; i < voice->mod_count; i+= fluid_mod_get_linked_count(mod), mod_idx++)
{
mod = &voice->mod[i];
}
@ -2286,7 +2286,7 @@ fluid_mod_t *fluid_voice_get_modulator(fluid_voice_t *voice, int mod_idx)
fluid_return_val_if_fail(voice != NULL, NULL);
fluid_return_val_if_fail((0 <= mod_idx), NULL);
for (i = 0, count = 0; i < voice->mod_count; i += fluid_get_num_mod(mod))
for (i = 0, count = 0; i < voice->mod_count; i += fluid_mod_get_linked_count(mod))
{
mod = &voice->mod[i];
if (count == mod_idx)

View file

@ -381,8 +381,8 @@ static int fluid_compare_complex_mod_structure(fluid_mod_t *cm1, fluid_mod_t *cm
double amount2_mul)
{
int offset1, offset2;
int count1 = fluid_get_num_mod(cm1);
int count2 = fluid_get_num_mod(cm2);
int count1 = fluid_mod_get_linked_count(cm1);
int count2 = fluid_mod_get_linked_count(cm2);
// compare members count and ending modulators
if ((count1 != count2)

View file

@ -1218,13 +1218,13 @@ static void fluid_linked_mod_dump_test_identity(fluid_mod_t *mod0, fluid_mod_t *
/* First complex modulator : cm0_idx, cm0, cm0_count*/
cm0 = mod0;
cm0_count = fluid_get_num_mod(cm0);
cm0_count = fluid_mod_get_linked_count(cm0);
if(cm0_count)
{
/* 2nd complex modulator : cm1_idx, cm1, cm1_count*/
cm1 = mod1;
cm1_count = fluid_get_num_mod(cm1);
cm1_count = fluid_mod_get_linked_count(cm1);
}
FLUID_LOG(FLUID_INFO, "------------------------------------------");
@ -1302,7 +1302,7 @@ static void fluid_dump_list_linked_mod(fluid_mod_t *mod)
while(mod)
{
fluid_dump_linked_mod(mod, mod_idx, count);
count+=fluid_get_num_mod(mod);
count+=fluid_mod_get_linked_count(mod);
mod_idx++;
mod = fluid_get_next_mod(mod);
}

View file

@ -190,7 +190,7 @@ static fluid_real_t get_expected_simple_mod_min_val(fluid_voice_t *voice)
// Check that the voice contains one modulator
TEST_ASSERT(fluid_voice_get_count_modulators(voice) == 1);
// Check that the modulator is a simple modulator
TEST_ASSERT(fluid_get_num_mod(&voice->mod[0]) == 1);
TEST_ASSERT(fluid_mod_get_linked_count(&voice->mod[0]) == 1);
// Set src1_cc, src2_cc values to 0, 0 and update expected_mod_min_val
expected_mod_min_val = update_expected_simple_mod_min_val(voice, 0, 0, expected_mod_min_val);
@ -365,7 +365,7 @@ static fluid_real_t get_expected_complex_mod_min_val(fluid_voice_t *voice)
// Check that the voice contains one modulator
TEST_ASSERT(fluid_voice_get_count_modulators(voice) == 1);
// Check that the modulator is a complex modulator
TEST_ASSERT(fluid_get_num_mod(&voice->mod[0]) > 1);
TEST_ASSERT(fluid_mod_get_linked_count(&voice->mod[0]) > 1);
// Set m0_src2_cc, m1_src1_cc, m2_src1_cc values to 0, 0, 0 and update expected_mod_min_val
expected_mod_min_val = update_expected_complex_mod_min_val(voice, 0, 0, 0, expected_mod_min_val);