Add enum fluid_path_flags path in fluid_mod_t struct

- Replace path variable in  fluid_mod_check_linked_mod  by path field in
  fluid_mod_t struct.
- When a modulator is invalid, it is returned with bit FLUID_MOD_VALID set
  to 0, instead of amount field forced to 0.
This commit is contained in:
jjceresa 2019-10-13 23:13:40 +02:00
parent c96acb01ed
commit eabbc78b19
5 changed files with 302 additions and 307 deletions

View file

@ -1253,7 +1253,7 @@ void fluid_dump_linked_mod(fluid_mod_t *mod, int mod_idx, int offset)
}
}
/* description of bit flags set in path variable by fluid_mod_check_linked_mod_LOCAL()
/* description of bit flags set in modulator's path field by fluid_mod_check_linked_mod_LOCAL()
These flags indicates if a modulator belongs to a linked path.
FLUID_PATH_CURRENT | FLUID_PATH_VALID | Modulator state
@ -1265,15 +1265,6 @@ void fluid_dump_linked_mod(fluid_mod_t *mod, int mod_idx, int offset)
1 | 1 | belongs to a complete linked path
*/
/* bit FLUID_MOD_VALID set to 1 indicates that the modulator is valid */
#define FLUID_MOD_VALID (1 << 0)
/* bit FLUID_PATH_VALID set to 1 indicates that the modulator belongs to
a complete valid linked path already discovered */
#define FLUID_PATH_VALID (1 << 1)
/* bit FLUID_PATH_CURRENT set to 1 indicates that the modulator belongs to
the current linked path. It allows detection of circular and isolated path */
#define FLUID_PATH_CURRENT (1 << 2)
/**
* Check linked modulator paths without destination and circular linked modulator
* paths (specif SF 2.0 7.4, 7.8 and 9.5.4).
@ -1336,20 +1327,20 @@ void fluid_dump_linked_mod(fluid_mod_t *mod, int mod_idx, int offset)
* @param list_name, list name used to prefix warning messages displayed.
* if NULL, no message are displayed.
* @param list_mod, pointer on modulators list.
* On output, invalid linked modulator are marked with amount value to 0.
* @param dest_idx, index of the destination linked modulator to search.
* Must be - 1 at first call.
* if < 0, search first modulator (i.e first linked modulateur).
* if >= 0 index of the destination linked modulator to search.
* @param path, pointer on table for path registering.
* On input, FLUID_PATH_CURRENT , FLUID_PATH_VALID must be initialized to 0.
* FLUID_MOD_VALID to 1 indicates that the modulator is valid.
* On output, path table contains bit for each modulator that indicates if
* the modulator belongs to a linked path.
* On input, modulators's path field must be initialized:
* - FLUID_PATH_CURRENT , FLUID_PATH_VALID must be initialized to 0.
* - FLUID_MOD_VALID to 1 indicates that the modulator is valid.
* On output, modulators's path field indicates if the modulator belongs to
* a linked path:
* - no path (FLUID_PATH_CURRENT set to 0, FLUID_PATH_VALID set to 0) or
* - valid complete paths (FLUID_PATH_CURRENT, FLUID_PATH_VALID set to 1) or
* - invalid incomplete paths (FLUID_PATH_CURRENT set to 1, FLUID_PATH_VALID
* set to 0).
* - invalid linked modulator are marqued with FLUID_MOD_VALID to 0.
* @param dest_idx, index of the destination linked modulator to search.
* Must be - 1 at first call.
* if < 0, search first modulator (i.e first linked modulateur).
* if >= 0 index of the destination linked modulator to search.
*
* @return
* - the number of linked modulators if any valid linked path exists.
@ -1357,8 +1348,7 @@ void fluid_dump_linked_mod(fluid_mod_t *mod, int mod_idx, int offset)
*/
static int
fluid_mod_check_linked_mod_LOCAL(char *list_name, fluid_mod_t *list_mod,
int dest_idx,
unsigned char path[])
int dest_idx)
{
int linked_count = 0; /* number of linked modulators */
int mod_idx = 0; /* index of current mod in list */
@ -1370,19 +1360,17 @@ fluid_mod_check_linked_mod_LOCAL(char *list_name, fluid_mod_t *list_mod,
{
/* checks if mod source isn't linked and mod destination is linked */
if (!fluid_mod_has_linked_src1(mod) && (mod->dest & FLUID_MOD_LINK_DEST)
&& (path[mod_idx] & FLUID_MOD_VALID))
&& (mod->path & FLUID_MOD_VALID))
{
int count;
/* memorizes mod state: in current linked path */
path[mod_idx] |= FLUID_PATH_CURRENT;
mod->path |= FLUID_PATH_CURRENT;
/* search and check the full path to the end. */
count = fluid_mod_check_linked_mod_LOCAL(list_name, list_mod, mod->dest,
path);
count = fluid_mod_check_linked_mod_LOCAL(list_name, list_mod, mod->dest);
if (count < 0)
{ /* no final destination found for mod */
mod->amount = 0; /* mod marked invalid */
path[mod_idx] &= ~FLUID_MOD_VALID;
mod->path &= ~FLUID_MOD_VALID; /* mod marked invalid */
/* warning: path is without destination */
if(list_name != NULL)
{
@ -1392,7 +1380,7 @@ fluid_mod_check_linked_mod_LOCAL(char *list_name, fluid_mod_t *list_mod,
}
else
{
path[mod_idx] |= FLUID_PATH_VALID; /* current path is valid */
mod->path |= FLUID_PATH_VALID; /* current path is valid */
linked_count += (count + 1);
}
}
@ -1402,7 +1390,7 @@ fluid_mod_check_linked_mod_LOCAL(char *list_name, fluid_mod_t *list_mod,
{
/* mod is destination of a previous modulator in path */
/* is this modulator destination valid ? */
if (!fluid_mod_has_linked_src1(mod) || !(path[mod_idx] & FLUID_MOD_VALID))
if (!fluid_mod_has_linked_src1(mod) || !(mod->path & FLUID_MOD_VALID))
{
/* warning: path have an invalid destination */
if(list_name != NULL)
@ -1415,13 +1403,13 @@ fluid_mod_check_linked_mod_LOCAL(char *list_name, fluid_mod_t *list_mod,
/* mod is a valid destination modulator */
/* Checks if mod belongs to a path already discovered */
if (path[mod_idx] & FLUID_PATH_VALID)
if (mod->path & FLUID_PATH_VALID)
{
return 0; /* current path is valid */
}
/* Checks if mod belongs to current path */
if (path[mod_idx] & FLUID_PATH_CURRENT)
if (mod->path & FLUID_PATH_CURRENT)
{
/* warning: invalid circular path */
if(list_name != NULL)
@ -1433,22 +1421,21 @@ fluid_mod_check_linked_mod_LOCAL(char *list_name, fluid_mod_t *list_mod,
}
/* memorizes mod state: in current linked path */
path[mod_idx] |= FLUID_PATH_CURRENT;
mod->path |= FLUID_PATH_CURRENT;
/* does mod destination linked ? */
if(mod->dest & FLUID_MOD_LINK_DEST)
{
linked_count = fluid_mod_check_linked_mod_LOCAL(list_name, list_mod,
mod->dest, path);
mod->dest);
if (linked_count < 0)
{
mod->amount = 0; /* mod marked invalid */
path[mod_idx] &= ~FLUID_MOD_VALID;
mod->path &= ~FLUID_MOD_VALID; /* mod marked invalid */
return -1; /* current path is invalid */
}
}
linked_count++;
path[mod_idx] |= FLUID_PATH_VALID; /* current path is valid */
mod->path |= FLUID_PATH_VALID; /* current path is valid */
return linked_count;
}
mod = mod->next;
@ -1482,7 +1469,10 @@ fluid_mod_check_linked_mod_LOCAL(char *list_name, fluid_mod_t *list_mod,
* The function is recursive and intended to be called the first time to
* start the search from ending linked modulator (see dest_idx, new_idx).
*
* @param list_mod, modulators list.
* @param list_mod, modulators list. Modulators in this list must be prepared
* by fluid_mod_check_linked_mod_LOCAL() before calling this function.
* Only modulators with path field set to FLUID_PATH_VALID will be cloned.
*
* @param dest_idx, initial index of linked destination modulator to search.
* Must be set to -1 at first call.
* -1, to search ending linked modulator.
@ -1491,10 +1481,6 @@ fluid_mod_check_linked_mod_LOCAL(char *list_name, fluid_mod_t *list_mod,
* @param new_idx, index (1 based) of the most recent modulator at the end
* of linked_mod. Must be set to 0 at first call.
*
* @param path, pointer on table that must be initialized by
* fluid_mod_check_linked_mod_LOCAL() before calling this function. The table
* indicates valid path registered (FLUID_PATH_VALID set to 1).
*
* @param linked_mod, address of pointer on linked modulators list returned
* if any linked modulators exist.
* @param linked_count, number of modulators in linked_mod:
@ -1511,7 +1497,6 @@ fluid_mod_check_linked_mod_LOCAL(char *list_name, fluid_mod_t *list_mod,
*/
static int
fluid_mod_copy_linked_mod(const fluid_mod_t *list_mod, int dest_idx, int new_idx,
const unsigned char path[],
fluid_mod_t **linked_mod,
int linked_count)
{
@ -1521,7 +1506,7 @@ fluid_mod_copy_linked_mod(const fluid_mod_t *list_mod, int dest_idx, int new_idx
const fluid_mod_t *mod = list_mod;
while(mod)
{
if (path[mod_idx] & FLUID_PATH_VALID) /* ignores invalid path */
if (mod->path & FLUID_PATH_VALID) /* ignores invalid path */
{
/* is_src_linked is true when modulator mod's input are linked */
int is_src1_linked = fluid_mod_has_linked_src1(mod);
@ -1606,7 +1591,7 @@ fluid_mod_copy_linked_mod(const fluid_mod_t *list_mod, int dest_idx, int new_idx
{ /* search a modulator with output linked to mod */
linked_idx = fluid_mod_copy_linked_mod(list_mod,
mod_idx | FLUID_MOD_LINK_DEST,
linked_idx, path,
linked_idx,
linked_mod, linked_count);
if(linked_idx == FLUID_FAILED)
{
@ -1688,9 +1673,6 @@ fluid_mod_check_linked_mod(char *list_name,
fluid_mod_t **linked_mod, int linked_count)
{
int result;
/* path is a flags table state to register valid modulators belonging
to valid complete linked modulator paths */
unsigned char *path;
fluid_mod_t *mod;
if (mod_count > 0) /* list_mod is a table */
@ -1699,13 +1681,26 @@ fluid_mod_check_linked_mod(char *list_name,
/* intialize list_mod as a list */
for (i = 0, count = mod_count-1; i < count; i++)
{
list_mod[i].next = &list_mod[i+1];
list_mod[i].next = &list_mod[i+1]; /* initialize next field */
/* initialize path:
- reset bits FLUID_PATH_VALID, FLUID_PATH_CURRENT
- set bit FLUID_MOD_VALID
*/
list_mod[i].path = FLUID_MOD_VALID;
}
list_mod[count].next = NULL; /* last next field must be NULL */
list_mod[count].path = FLUID_MOD_VALID; /* initialize path */
}
else /* lis_mod is a list of modulators */
{
mod_count = fluid_mod_get_list_count(list_mod);
mod = list_mod; /* first modulator in list_mod */
mod_count = 0;
while(mod)
{
mod_count++;
mod->path = FLUID_MOD_VALID; /* initialize path */
mod = mod->next;
}
}
if(!mod_count)
@ -1713,28 +1708,6 @@ fluid_mod_check_linked_mod(char *list_name,
return 0;
}
if(linked_count <= 0)
{
/* path allocation (in memory pool) */
path = FLUID_MALLOC (sizeof(*path) * mod_count);
}
else
{
/* path allocation (on stack) */
path = alloca(sizeof(*path) * mod_count);
}
if(path == NULL)
{
return FLUID_FAILED;
}
/* initialize path:
- reset bits FLUID_PATH_VALID, FLUID_PATH_CURRENT
- set bits FLUID_MOD_VALID
*/
FLUID_MEMSET(path, FLUID_MOD_VALID, mod_count);
/* checks valid modulator sources (specs SF 2.01 7.4, 7.8, 8.2.1).*/
/* checks identic modulators in the list (specs SF 2.01 7.4, 7.8). */
if(list_name != NULL)
@ -1754,8 +1727,7 @@ fluid_mod_check_linked_mod(char *list_name,
/* or is mod identic to any following modulator ? */
||fluid_mod_is_identic_in_list(mod, list_mod_name))
{ /* marks this modulator invalid for future checks */
path[mod_count] &= ~FLUID_MOD_VALID;
mod->amount = 0;
mod->path &= ~FLUID_MOD_VALID;
}
mod_count++;
@ -1764,7 +1736,7 @@ fluid_mod_check_linked_mod(char *list_name,
}
/* Now check linked modulator path */
result = fluid_mod_check_linked_mod_LOCAL(list_name, list_mod, -1, path);
result = fluid_mod_check_linked_mod_LOCAL(list_name, list_mod, -1);
/* Now path contains complete or partial discovered modulators paths.
Other unreachable linked modulators path (isolated) are still in list_mod but
@ -1777,12 +1749,12 @@ fluid_mod_check_linked_mod(char *list_name,
while(mod)
{
if( /* Check linked mod only not in discovered paths */
(path[mod_count] & FLUID_MOD_VALID)
(mod->path & FLUID_MOD_VALID)
&& fluid_mod_has_linked_src1(mod)
/* Check if mod doesn't belong to any discovered paths */
&& !(path[mod_count] & FLUID_PATH_CURRENT) )
&& !(mod->path & FLUID_PATH_CURRENT) )
{
mod->amount = 0; /* marked invalid */
mod->path &= ~FLUID_MOD_VALID; /* mod marked invalid */
FLUID_LOG(FLUID_WARN, "Invalid isolated path %s/mod%d",
list_name, mod_count);
}
@ -1803,16 +1775,10 @@ fluid_mod_check_linked_mod(char *list_name,
{
/* one or more linked modulators paths exists */
/* clone valid linked modulator paths from list_mod to linked_mod.*/
result = fluid_mod_copy_linked_mod(list_mod, -1, 0, path,
result = fluid_mod_copy_linked_mod(list_mod, -1, 0,
linked_mod, linked_count);
}
}
/* free path */
if(linked_count <= 0)
{
FLUID_FREE(path);
}
return result;
}

View file

@ -37,6 +37,7 @@ struct _fluid_mod_t
unsigned char flags2; /**< Source controller 2 flags */
double amount; /**< Multiplier amount */
double link; /**< Summation of modulator nodes linked to this modulator */
enum fluid_path_flags path; /**< Flags indicating if the modulator is valid */
/* The 'next' field allows to link modulators into a list. It is
* not used in fluid_voice.c, there each voice allocates memory for a
* fixed number of modulators. Since there may be a huge number of
@ -83,6 +84,34 @@ int fluid_mod_check_sources(const fluid_mod_t *mod, char *name);
void fluid_mod_remove_invalid_from_list(fluid_mod_t **list_mod);
/* this enum is used internally by fluid_mod_check_linked_mod() for setting
modulators 's path field.
*/
/* description of bit flags set in modulator's path field.
These flags indicates if a modulator belongs to a linked path.
FLUID_PATH_CURRENT | FLUID_PATH_VALID | Modulator state
-------------------|------------------|--------------------------------------
0 | 0 | doesn't belong to any linked path
-------------------|------------------|--------------------------------------
1 | 0 | belongs to a linked path not yet complete
-------------------|------------------|--------------------------------------
1 | 1 | belongs to a complete linked path
*/
enum fluid_path_flags
{
/* bit FLUID_MOD_VALID set to 1 indicates that the modulator is valid */
FLUID_MOD_VALID = (1 << 0),
/* bit FLUID_PATH_VALID set to 1 indicates that the modulator belongs to
a complete valid linked path already discovered */
FLUID_PATH_VALID = (1 << 1),
/* bit FLUID_PATH_CURRENT set to 1 indicates that the modulator belongs to
the current linked path. It allows detection of circular and isolated path */
FLUID_PATH_CURRENT = (1 << 2)
};
int fluid_mod_check_linked_mod(char *list_name,
fluid_mod_t *list_mod, int mod_count,
fluid_mod_t **linked_mod, int linked_count);

View file

@ -26,8 +26,8 @@ fluid_mod_t mod1_simple_in[] =
{
// dest , src1 , flags1 , src2 , flags2
GEN_ATTENUATION , 3 , FLUID_MOD_CC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
10.0 , 0.0 , NULL
// amount, link, path, next
10.0 , 0.0 ,0 , NULL
}
};
@ -37,8 +37,8 @@ fluid_mod_t mod2_simple_in[] =
{
// dest , src1 , flags1 , src2 , flags2
GEN_ATTENUATION , 4 , FLUID_MOD_CC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
10.0 , 0.0 , NULL
// amount, link, path, next
10.0 , 0.0 ,0 , NULL
}
};
@ -48,8 +48,8 @@ fluid_mod_t mod3_simple_in[] =
{
// dest , src1 , flags1 , src2 , flags2
2 , 0 , FLUID_MOD_CC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
10.0 , 0.0 , NULL
// amount, link, path, next
10.0 , 0.0 ,0 , NULL
}
};

View file

@ -42,8 +42,8 @@ fluid_mod_t mod_table_1[] =
{
// dest , src1 , flags1 , src2 , flags2
GEN_ATTENUATION , FLUID_MOD_VELOCITY, FLUID_MOD_GC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
10.0 , 0.0 , NULL
// amount, link, path, next
10.0 , 0.0 , 0 , NULL
}
};
@ -54,8 +54,8 @@ fluid_mod_t mod_table_1_1[] =
{
// dest , src1 , flags1 , src2 , flags2
GEN_ATTENUATION , FLUID_MOD_VELOCITY, FLUID_MOD_GC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
0.0 , 0.0 , NULL
// amount, link, path, next
0.0 , 0.0 , 0 , NULL
}
};
@ -66,14 +66,14 @@ fluid_mod_t mod_table_1_2[] =
{
// dest , src1 , flags1 , src2 , flags2
GEN_ATTENUATION , FLUID_MOD_NONE , FLUID_MOD_GC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
10.0 , 0.0 , NULL
// amount, link, path, next
10.0 , 0.0 ,0 , NULL
},
{
// dest , src1 , flags1 , src2 , flags2
GEN_ATTENUATION , FLUID_MOD_KEY , FLUID_MOD_GC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
0.0 , 0.0 , NULL
// amount, link, path, next
0.0 , 0.0 , 0 , NULL
}
};
@ -84,8 +84,8 @@ fluid_mod_t mod_table_1_3[] =
{
// dest , src1 , flags1 , src2 , flags2
GEN_ATTENUATION, FLUID_MOD_VELOCITY, FLUID_MOD_GC, FLUID_MOD_NONE, FLUID_MOD_GC|FLUID_MOD_BIPOLAR,
// amount, link, next
0.0 , 0.0 , NULL
// amount, link, path, next
0.0 , 0.0 , 0 , NULL
}
};
@ -96,14 +96,14 @@ fluid_mod_t mod_table_2[] =
{
// dest , src1 , flags1 , src2 , flags2
GEN_ATTENUATION, FLUID_MOD_VELOCITY, FLUID_MOD_GC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
0.0 , 0.0 , NULL
// amount, link, path, next
0.0 , 0.0 , 0 , NULL
},
{
// dest , src1 , flags1 , src2 , flags2
GEN_ATTENUATION , 1 , FLUID_MOD_GC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
10.0 , 0.0 , NULL
// amount, link, path, next
10.0 , 0.0 ,0 , NULL
}
};
@ -114,8 +114,8 @@ fluid_mod_t mod_table_3[] =
{
// dest , src1 , flags1 , src2 , flags2
GEN_ATTENUATION , 3 , FLUID_MOD_CC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
10.0 , 0.0 , NULL
// amount, link, path, next
10.0 , 0.0 ,0 , NULL
}
};
@ -126,14 +126,14 @@ fluid_mod_t mod_table_4[] =
{
// dest , src1 , flags1 , src2 , flags2
GEN_ATTENUATION , FLUID_MOD_VELOCITY, FLUID_MOD_GC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
0.0 , 0.0 , NULL
// amount, link, path, next
0.0 , 0.0 , 0 , NULL
},
{
// dest , src1 , flags1 , src2 , flags2
2 , 0 , FLUID_MOD_CC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
10.0 , 0.0 , NULL
// amount, link, path, next
10.0 , 0.0 ,0 , NULL
}
};
@ -144,32 +144,32 @@ fluid_mod_t mod_table_5[] =
{
// dest , src1 , flags1 , src2 , flags2
GEN_ATTENUATION , FLUID_MOD_VELOCITY, FLUID_MOD_GC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
0.0 , 0.0 , NULL
// amount, link, path, next
0.0 , 0.0 , 0 , NULL
},
{
// dest , src1 , flags1 , src2 , flags2
GEN_ATTENUATION , 3 , FLUID_MOD_CC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
10.0 , 0.0 , NULL
// amount, link, path, next
10.0 , 0.0 , 0 , NULL
},
{
// dest , src1 , flags1 , src2 , flags2
GEN_ATTENUATION, FLUID_MOD_VELOCITY , FLUID_MOD_GC , FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
1.0 , 0.0 , NULL
// amount, link, path, next
1.0 , 0.0 , 0 , NULL
},
{
// dest , src1 , flags1 , src2 , flags2
GEN_ATTENUATION , FLUID_MOD_VELOCITY, FLUID_MOD_GC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
3.0 , 0.0 , NULL
// amount, link, path, next
3.0 , 0.0 , 0 , NULL
},
{
// dest , src1 , flags1 , src2 , flags2
GEN_ATTENUATION , FLUID_MOD_VELOCITY, FLUID_MOD_GC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
5.0 , 0.0 , NULL
// amount, link, path, next
5.0 , 0.0 , 0 , NULL
}
};
@ -182,20 +182,20 @@ fluid_mod_t mod_table_6[] =
{
// dest , src1 , flags1 , src2 , flags2
2|FLUID_MOD_LINK_DEST, FLUID_MOD_VELOCITY, FLUID_MOD_GC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
1.0 , 0.0 , NULL
// amount, link, path, next
1.0 , 0.0 , 0 , NULL
},
{
// dest , src1 , flags1 , src2 , flags2
GEN_ATTENUATION , FLUID_MOD_VELOCITY , FLUID_MOD_GC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
2.0 , 0.0 , NULL
// amount, link, path, next
2.0 , 0.0 , 0 , NULL
},
{
// dest , src1 , flags1 , src2 , flags2
GEN_ATTENUATION , FLUID_MOD_LINK_SRC , FLUID_MOD_GC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
3.0 , 0.0 , NULL
// amount, link, path, next
3.0 , 0.0 , 0 , NULL
}
};
@ -208,55 +208,55 @@ fluid_mod_t mod_table_6[] =
char test_6_1_mod_linked[] = "test 6_1: linked modulators valid: src1->mod0->mod2, src2->mod1->mod2";
fluid_mod_t mod_table_6_1[] =
{
/* mod complexe */
/* complex mod */
{
// dest , src1 , flags1 , src2 , flags2
2|FLUID_MOD_LINK_DEST, FLUID_MOD_LINK_SRC, FLUID_MOD_GC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
1.0 , 0.0 , NULL
// amount, link, path, next
1.0 , 0.0 , 0 , NULL
},
{
// dest , src1 , flags1 , src2 , flags2
2|FLUID_MOD_LINK_DEST, FLUID_MOD_KEY , FLUID_MOD_GC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
2.0 , 0.0 , NULL
// amount, link, path, next
2.0 , 0.0 , 0 , NULL
},
{
// dest , src1 , flags1 , src2 , flags2
GEN_ATTENUATION , FLUID_MOD_LINK_SRC, FLUID_MOD_GC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
3.0 , 0.0 , NULL
// amount, link, path, next
3.0 , 0.0 , 0 , NULL
},
{
// dest , src1 , flags1 , src2 , flags2
GEN_ATTENUATION , FLUID_MOD_VELOCITY, FLUID_MOD_GC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
4.0 , 0.0 , NULL
// amount, link, path, next
4.0 , 0.0 , 0 , NULL
},
{
// dest , src1 , flags1 , src2 , flags2
0|FLUID_MOD_LINK_DEST, FLUID_MOD_KEY , FLUID_MOD_GC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
5.0 , 0.0 , NULL
// amount, link, path, next
5.0 , 0.0 , 0 , NULL
},
/* mod complexe */
/* complex mod */
{
// dest , src1 , flags1 , src2 , flags2
7|FLUID_MOD_LINK_DEST, FLUID_MOD_VELOCITY, FLUID_MOD_GC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
6.0 , 0.0 , NULL
// amount, link, path, next
6.0 , 0.0 , 0 , NULL
},
{
// dest , src1 , flags1 , src2 , flags2
7|FLUID_MOD_LINK_DEST, FLUID_MOD_KEY , FLUID_MOD_GC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
7.0 , 0.0 , NULL
// amount, link, path, next
7.0 , 0.0 , 0 , NULL
},
{
// dest , src1 , flags1 , src2 , flags2
GEN_VOLENVHOLD, FLUID_MOD_LINK_SRC ,FLUID_MOD_GC , FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
8.0 , 0.0 , NULL
// amount, link, path, next
8.0 , 0.0 , 0 , NULL
}
};
@ -267,26 +267,26 @@ fluid_mod_t mod_table_6_2[] =
{
// dest , src1 , flags1 , src2 , flags2
2|FLUID_MOD_LINK_DEST, FLUID_MOD_LINK_SRC, FLUID_MOD_GC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
2.0 , 0.0 , NULL
// amount, link, path, next
2.0 , 0.0 , 0 , NULL
},
{
// dest , src1 , flags1 , src2 , flags2
GEN_ATTENUATION , FLUID_MOD_VELOCITY, FLUID_MOD_GC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
4.0 , 0.0 , NULL
// amount, link, path, next
4.0 , 0.0 , 0 , NULL
},
{
// dest , src1 , flags1 , src2 , flags2
GEN_ATTENUATION , FLUID_MOD_LINK_SRC, FLUID_MOD_GC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
3.0 , 0.0 , NULL
// amount, link, path, next
3.0 , 0.0 , 0 , NULL
},
{
// dest , src1 , flags1 , src2 , flags2
0|FLUID_MOD_LINK_DEST, FLUID_MOD_VELOCITY, FLUID_MOD_GC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
1.0 , 0.0 , NULL
// amount, link, path, next
1.0 , 0.0 , 0 , NULL
}
};
@ -300,15 +300,15 @@ fluid_mod_t mod_table_6_3_0[] =
{
// dest , src1 , flags1 , src2 , flags2
GEN_VOLENVHOLD , FLUID_MOD_LINK_SRC, FLUID_MOD_GC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
1.0 , 0.0 , NULL
// amount, link, path, next
1.0 , 0.0 , 0 , NULL
},
/* mod0<-mod1<- */
{
// dest , src1 , flags1 , src2 , flags2
0|FLUID_MOD_LINK_DEST, 2 , FLUID_MOD_CC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
2.0 , 0.0 , NULL
// amount, link, path, next
2.0 , 0.0 , 0 , NULL
}
};
@ -319,15 +319,15 @@ fluid_mod_t mod_table_6_3_1[] =
{
// dest , src1 , flags1 , src2 , flags2
GEN_VOLENVHOLD , FLUID_MOD_LINK_SRC, FLUID_MOD_GC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
2.0 , 0.0 , NULL
// amount, link, path, next
2.0 , 0.0 , 0 , NULL
},
/* mod0<-mod1<- */
{
// dest , src1 , flags1 , src2 , flags2
0|FLUID_MOD_LINK_DEST, 2 , FLUID_MOD_CC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
3.0 , 0.0 , NULL
// amount, link, path, next
3.0 , 0.0 , 0 , NULL
}
};
@ -341,22 +341,22 @@ fluid_mod_t mod_table_6_4_0[] =
{
// dest , src1 , flags1 , src2 , flags2
GEN_VOLENVHOLD , FLUID_MOD_LINK_SRC, FLUID_MOD_GC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
1.0 , 0.0 , NULL
// amount, link, path, next
1.0 , 0.0 , 0 , NULL
},
/* mod0<-mod1<- */
{
// dest , src1 , flags1 , src2 , flags2
0|FLUID_MOD_LINK_DEST, FLUID_MOD_LINK_SRC, FLUID_MOD_GC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
2.0 , 0.0 , NULL
// amount, link, path, next
2.0 , 0.0 , 0 , NULL
},
/* mod1<-mod2<- */
{
// dest , src1 , flags1 , src2 , flags2
1|FLUID_MOD_LINK_DEST, 2 , FLUID_MOD_CC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
3.0 , 0.0 , NULL
// amount, link, path, next
3.0 , 0.0 , 0 , NULL
}
};
@ -367,15 +367,15 @@ fluid_mod_t mod_table_6_4_1[] =
{
// dest , src1 , flags1 , src2 , flags2
GEN_VOLENVHOLD , FLUID_MOD_LINK_SRC, FLUID_MOD_GC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
2.0 , 0.0 , NULL
// amount, link, path, next
2.0 , 0.0 , 0 , NULL
},
/* mod0<-mod1<- */
{
// dest , src1 , flags1 , src2 , flags2
0|FLUID_MOD_LINK_DEST, 2 , FLUID_MOD_CC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
3.0 , 0.0 , NULL
// amount, link, path, next
3.0 , 0.0 , 0 , NULL
}
};
@ -389,22 +389,22 @@ fluid_mod_t mod_table_6_5_0[] =
{
// dest , src1 , flags1 , src2 , flags2
GEN_VOLENVHOLD , FLUID_MOD_LINK_SRC, FLUID_MOD_GC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
1.0 , 0.0 , NULL
// amount, link, path, next
1.0 , 0.0 , 0 , NULL
},
/* mod0<-mod1<- */
{
// dest , src1 , flags1 , src2 , flags2
0|FLUID_MOD_LINK_DEST, FLUID_MOD_LINK_SRC, FLUID_MOD_GC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
2.0 , 0.0 , NULL
// amount, link, path, next
2.0 , 0.0 , 0 , NULL
},
/* mod1<-mod2<- */
{
// dest , src1 , flags1 , src2 , flags2
1|FLUID_MOD_LINK_DEST, 2 , FLUID_MOD_CC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
3.0 , 0.0 , NULL
// amount, link, path, next
3.0 , 0.0 , 0 , NULL
}
};
@ -415,22 +415,22 @@ fluid_mod_t mod_table_6_5_1[] =
{
// dest , src1 , flags1 , src2 , flags2
GEN_VOLENVHOLD , FLUID_MOD_LINK_SRC, FLUID_MOD_GC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
4.0 , 0.0 , NULL
// amount, link, path, next
4.0 , 0.0 , 0 , NULL
},
/* mod0<-mod1<- */
{
// dest , src1 , flags1 , src2 , flags2
0|FLUID_MOD_LINK_DEST, FLUID_MOD_LINK_SRC, FLUID_MOD_GC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
5.0 , 0.0 , NULL
// amount, link, path, next
5.0 , 0.0 , 0 , NULL
},
/* mod1<-mod2<- */
{
// dest , src1 , flags1 , src2 , flags2
1|FLUID_MOD_LINK_DEST, 2 , FLUID_MOD_CC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
6.0 , 0.0 , NULL
// amount, link, path, next
6.0 , 0.0 , 0 , NULL
}
};
@ -445,22 +445,22 @@ fluid_mod_t mod_table_6_6_0[] =
{
// dest , src1 , flags1 , src2 , flags2
GEN_VOLENVHOLD , FLUID_MOD_LINK_SRC, FLUID_MOD_GC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
1.0 , 0.0 , NULL
// amount, link, path, next
1.0 , 0.0 , 0 , NULL
},
/* mod0<-mod1<- */
{
// dest , src1 , flags1 , src2 , flags2
0|FLUID_MOD_LINK_DEST, FLUID_MOD_LINK_SRC, FLUID_MOD_GC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
2.0 , 0.0 , NULL
// amount, link, path, next
2.0 , 0.0 , 0 , NULL
},
/* mod1<-mod2<- */
{
// dest , src1 , flags1 , src2 , flags2
1|FLUID_MOD_LINK_DEST, 2 , FLUID_MOD_CC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
3.0 , 0.0 , NULL
// amount, link, path, next
3.0 , 0.0 , 0 , NULL
}
};
@ -472,22 +472,22 @@ fluid_mod_t mod_table_6_6_1[] =
{
// dest , src1 , flags1 , src2 , flags2
GEN_VOLENVHOLD , FLUID_MOD_LINK_SRC, FLUID_MOD_GC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
4.0 , 0.0 , NULL
// amount, link, path, next
4.0 , 0.0 , 0 , NULL
},
/* mod0<-mod1<- */
{
// dest , src1 , flags1 , src2 , flags2
0|FLUID_MOD_LINK_DEST, FLUID_MOD_NONE , FLUID_MOD_GC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
5.0 , 0.0 , NULL
// amount, link, path, next
5.0 , 0.0 , 0 , NULL
},
/* mod0<-mod2<- */
{
// dest , src1 , flags1 , src2 , flags2
0|FLUID_MOD_LINK_DEST, 2 , FLUID_MOD_CC, FLUID_MOD_NONE, FLUID_MOD_GC,
// amount, link, next
6.0 , 0.0 , NULL
// amount, link, path, next
6.0 , 0.0 , 0 , NULL
}
};
@ -503,22 +503,22 @@ fluid_mod_t mod_table_6_7_0[] =
{
// dest , src1 , flags1 , src2 , flags2
GEN_ATTENUATION , FLUID_MOD_LINK_SRC, FLUID_MOD_GC, 5 ,FLUID_MOD_CC,
// amount, link, next
1.0 , 0.0 , NULL
// amount, link, path, next
1.0 , 0.0 , 0 , NULL
},
/* mod0<-mod1<- */
{
// dest , src1 , flags1 , src2 , flags2
0|FLUID_MOD_LINK_DEST, 4 , FLUID_MOD_CC, FLUID_MOD_VELOCITY, FLUID_MOD_GC,
// amount, link, next
2.0 , 0.0 , NULL
// amount, link, path, next
2.0 , 0.0 , 0 , NULL
},
/* mod0<-mod2<- */
{
// dest , src1 , flags1 , src2 , flags2
0|FLUID_MOD_LINK_DEST, 2 , FLUID_MOD_CC, FLUID_MOD_NONE , FLUID_MOD_GC,
// amount, link, next
3.0 , 0.0 , NULL
// amount, link, path, next
3.0 , 0.0 , 0 , NULL
}
};
@ -530,22 +530,22 @@ fluid_mod_t mod_table_6_7_1[] =
{
// dest , src1 , flags1 , src2 , flags2
GEN_ATTENUATION , FLUID_MOD_LINK_SRC, FLUID_MOD_GC, 5 , FLUID_MOD_CC,
// amount, link, next
4.0 , 0.0 , NULL
// amount, link, path, next
4.0 , 0.0 , 0 , NULL
},
/* mod0<-mod1<- */
{
// dest , src1 , flags1 , src2 , flags2
0|FLUID_MOD_LINK_DEST, 4 , FLUID_MOD_CC, FLUID_MOD_VELOCITY, FLUID_MOD_GC,
// amount, link, next
5.0 , 0.0 , NULL
// amount, link, path, next
5.0 , 0.0 , 0 , NULL
},
/* mod0<-mod2<- */
{
// dest , src1 , flags1 , src2 , flags2
0|FLUID_MOD_LINK_DEST, 2 , FLUID_MOD_CC, FLUID_MOD_NONE , FLUID_MOD_GC,
// amount, link, next
6.0 , 0.0 , NULL
// amount, link, path, next
6.0 , 0.0 , 0 , NULL
}
};
@ -561,36 +561,36 @@ fluid_mod_t mod_table_6_8_0[] =
{
// dest , src1 , flags1 , src2 , flags2
GEN_VOLENVHOLD , FLUID_MOD_LINK_SRC, FLUID_MOD_GC , FLUID_MOD_NONE , FLUID_MOD_GC,
// amount, link, next
1.0 , 0.0 , NULL
// amount, link, path, next
1.0 , 0.0 , 0 , NULL
},
/* mod0<-mod1<- */
{
// dest , src1 , flags1 , src2 , flags2
0|FLUID_MOD_LINK_DEST, FLUID_MOD_LINK_SRC, FLUID_MOD_GC , FLUID_MOD_VELOCITY, FLUID_MOD_GC,
// amount, link, next
2.0 , 0.0 , NULL
// amount, link, path, next
2.0 , 0.0 , 0 , NULL
},
/* mod1<-mod2<- */
{
// dest , src1 , flags1 , src2 , flags2
1|FLUID_MOD_LINK_DEST, 2 , FLUID_MOD_CC , FLUID_MOD_NONE , FLUID_MOD_GC,
// amount, link, next
3.0 , 0.0 , NULL
// amount, link, path, next
3.0 , 0.0 , 0 , NULL
},
/* mod0<-mod3<- */
{
// dest , src1 , flags1 , src2 , flags2
0|FLUID_MOD_LINK_DEST, FLUID_MOD_LINK_SRC, FLUID_MOD_GC , FLUID_MOD_NONE , FLUID_MOD_GC,
// amount, link, next
4.0 , 0.0 , NULL
// amount, link, path, next
4.0 , 0.0 , 0 , NULL
},
/* mod3<-mod4<- */
{
// dest , src1 , flags1 , src2 , flags2
3|FLUID_MOD_LINK_DEST, 2 , FLUID_MOD_CC , FLUID_MOD_NONE , FLUID_MOD_GC,
// amount, link, next
5.0 , 0.0 , NULL
// amount, link, path, next
5.0 , 0.0 , 0 , NULL
}
};
@ -602,36 +602,36 @@ fluid_mod_t mod_table_6_8_1[] =
{
// dest , src1 , flags1 , src2 , flags2
GEN_VOLENVHOLD , FLUID_MOD_LINK_SRC, FLUID_MOD_GC , FLUID_MOD_NONE , FLUID_MOD_GC,
// amount, link, next
6.0 , 0.0 , NULL
// amount, link, path, next
6.0 , 0.0 , 0 , NULL
},
/* mod0<-mod1<- */
{
// dest , src1 , flags1 , src2 , flags2
0|FLUID_MOD_LINK_DEST, FLUID_MOD_LINK_SRC, FLUID_MOD_GC , FLUID_MOD_NONE , FLUID_MOD_GC,
// amount, link, next
7.0 , 0.0 , NULL
// amount, link, path, next
7.0 , 0.0 , 0 , NULL
},
/* mod1<-mod2<- */
{
// dest , src1 , flags1 , src2 , flags2
1|FLUID_MOD_LINK_DEST, 2 , FLUID_MOD_CC , FLUID_MOD_NONE , FLUID_MOD_GC,
// amount, link, next
8.0 , 0.0 , NULL
// amount, link, path, next
8.0 , 0.0 , 0 , NULL
},
/* mod0<-mod3<- */
{
// dest , src1 , flags1 , src2 , flags2
0|FLUID_MOD_LINK_DEST, FLUID_MOD_LINK_SRC, FLUID_MOD_GC , FLUID_MOD_VELOCITY, FLUID_MOD_GC,
// amount, link, next
9.0 , 0.0 , NULL
// amount, link, path, next
9.0 , 0.0 , 0 , NULL
},
/* mod3<-mod4<- */
{
// dest , src1 , flags1 , src2 , flags2
3|FLUID_MOD_LINK_DEST, 2 , FLUID_MOD_CC , FLUID_MOD_NONE , FLUID_MOD_GC,
// amount, link, next
10.0 , 0.0 , NULL
// amount, link, path, next
10.0 , 0.0 , 0 , NULL
}
};
@ -642,20 +642,20 @@ fluid_mod_t mod_table_7[] =
{
// dest , src1 , flags1 , src2 , flags2
2|FLUID_MOD_LINK_DEST, FLUID_MOD_VELOCITY , FLUID_MOD_GC , FLUID_MOD_NONE , FLUID_MOD_GC,
// amount, link, next
1.0 , 0.0 , NULL
// amount, link, path, next
1.0 , 0.0 , 0 , NULL
},
{
// dest , src1 , flags1 , src2 , flags2
GEN_ATTENUATION , FLUID_MOD_KEYPRESSURE, FLUID_MOD_GC , FLUID_MOD_NONE , FLUID_MOD_GC,
// amount, link, next
2.0 , 0.0 , NULL
// amount, link, path, next
2.0 , 0.0 , 0 , NULL
},
{
// dest , src1 , flags1 , src2 , flags2
GEN_ATTENUATION , FLUID_MOD_VELOCITY , FLUID_MOD_GC , FLUID_MOD_NONE , FLUID_MOD_GC,
// amount, link, next
3.0 , 0.0 , NULL
// amount, link, path, next
3.0 , 0.0 , 0 , NULL
}
};
@ -667,20 +667,20 @@ fluid_mod_t mod_table_8[] =
{
// dest , src1 , flags1 , src2 , flags2
2|FLUID_MOD_LINK_DEST, FLUID_MOD_VELOCITY, FLUID_MOD_GC , FLUID_MOD_NONE , FLUID_MOD_GC,
// amount, link, next
1.0 , 0.0 , NULL
// amount, link, path, next
1.0 , 0.0 , 0 , NULL
},
{
// dest , src1 , flags1 , src2 , flags2
GEN_ATTENUATION , FLUID_MOD_VELOCITY, FLUID_MOD_GC , FLUID_MOD_NONE , FLUID_MOD_GC,
// amount, link, next
2.0 , 0.0 , NULL
// amount, link, path, next
2.0 , 0.0 , 0 , NULL
},
{
// dest , src1 , flags1 , src2 , flags2
GEN_ATTENUATION , FLUID_MOD_LINK_SRC, FLUID_MOD_GC , FLUID_MOD_NONE , FLUID_MOD_GC,
// amount, link, next
0.0 , 0.0 , NULL
// amount, link, path, next
0.0 , 0.0 , 0 , NULL
}
};
@ -691,20 +691,20 @@ fluid_mod_t mod_table_9[] =
{
// dest , src1 , flags1 , src2 , flags2
3|FLUID_MOD_LINK_DEST, FLUID_MOD_VELOCITY , FLUID_MOD_GC , FLUID_MOD_NONE , FLUID_MOD_GC,
// amount, link, next
1.0 , 0.0 , NULL
// amount, link, path, next
1.0 , 0.0 , 0 , NULL
},
{
// dest , src1 , flags1 , src2 , flags2
GEN_ATTENUATION , FLUID_MOD_KEYPRESSURE, FLUID_MOD_GC , FLUID_MOD_NONE , FLUID_MOD_GC,
// amount, link, next
2.0 , 0.0 , NULL
// amount, link, path, next
2.0 , 0.0 , 0 , NULL
},
{
// dest , src1 , flags1 , src2 , flags2
GEN_ATTENUATION , FLUID_MOD_VELOCITY , FLUID_MOD_GC , FLUID_MOD_NONE , FLUID_MOD_GC,
// amount, link, next
3.0 , 0.0 , NULL
// amount, link, path, next
3.0 , 0.0 , 0 , NULL
}
};
@ -716,20 +716,20 @@ fluid_mod_t mod_table_10[] =
{
// dest , src1 , flags1 , src2 , flags2
2|FLUID_MOD_LINK_DEST, FLUID_MOD_LINK_SRC, FLUID_MOD_GC , FLUID_MOD_NONE , FLUID_MOD_GC,
// amount, link, next
1.0 , 0.0 , NULL
// amount, link, path, next
1.0 , 0.0 , 0 , NULL
},
{
// dest , src1 , flags1 , src2 , flags2
GEN_ATTENUATION , FLUID_MOD_VELOCITY, FLUID_MOD_GC , FLUID_MOD_NONE , FLUID_MOD_GC,
// amount, link, next
2.0 , 0.0 , NULL
// amount, link, path, next
2.0 , 0.0 , 0 , NULL
},
{
// dest , src1 , flags1 , src2 , flags2
GEN_ATTENUATION , FLUID_MOD_LINK_SRC, FLUID_MOD_GC , FLUID_MOD_NONE , FLUID_MOD_GC,
// amount, link, next
3.0 , 0.0 , NULL
// amount, link, path, next
3.0 , 0.0 , 0 , NULL
}
};
@ -740,26 +740,26 @@ fluid_mod_t mod_table_11[] =
{
// dest , src1 , flags1 , src2 , flags2
2|FLUID_MOD_LINK_DEST, FLUID_MOD_LINK_SRC, FLUID_MOD_GC , FLUID_MOD_NONE , FLUID_MOD_GC,
// amount, link, next
2.0 , 0.0 , NULL
// amount, link, path, next
2.0 , 0.0 , 0 , NULL
},
{
// dest , src1 , flags1 , src2 , flags2
GEN_ATTENUATION, FLUID_MOD_VELOCITY , FLUID_MOD_GC , FLUID_MOD_NONE , FLUID_MOD_GC,
// amount, link, next
4.0 , 0.0 , NULL
// amount, link, path, next
4.0 , 0.0 , 0 , NULL
},
{
// dest , src1 , flags1 , src2 , flags2
0|FLUID_MOD_LINK_DEST, FLUID_MOD_LINK_SRC, FLUID_MOD_GC , FLUID_MOD_NONE , FLUID_MOD_GC,
// amount, link, next
3.0 , 0.0 , NULL
// amount, link, path, next
3.0 , 0.0 , 0 , NULL
},
{
// dest , src1 , flags1 , src2 , flags2
0|FLUID_MOD_LINK_DEST, FLUID_MOD_VELOCITY, FLUID_MOD_GC , FLUID_MOD_NONE , FLUID_MOD_GC,
// amount, link, next
1.0 , 0.0 , NULL
// amount, link, path, next
1.0 , 0.0 , 0 , NULL
}
};

View file

@ -540,7 +540,7 @@ int main(void)
TEST_ASSERT(fluid_mod_get_amount(mod0) == 100);
TEST_ASSERT(fluid_mod_get_amount(mod1) == 200);
TEST_ASSERT(fluid_mod_get_amount(mod2) == 300);
TEST_ASSERT(fluid_mod_get_amount(mod3) == 0); // invalidated because mod1 without FLUID_MOD_LINK_SRC
TEST_ASSERT((mod3->path & FLUID_MOD_VALID) == 0); // invalidated because mod1 without FLUID_MOD_LINK_SRC
}
// Test 4.1: Same test as 4 but with linked_mod not NULL. The function expects to return any
@ -641,9 +641,9 @@ int main(void)
// modulators that are part of the circular list are invalidated
TEST_ASSERT(fluid_mod_get_amount(mod0) == 100);
TEST_ASSERT(fluid_mod_get_amount(mod1) == 0); // invalid destination
TEST_ASSERT((mod1->path & FLUID_MOD_VALID) == 0); // invalid destination
TEST_ASSERT(fluid_mod_get_amount(mod2) == 300);
TEST_ASSERT(fluid_mod_get_amount(mod3) == 0); // path without destination
TEST_ASSERT((mod3->path & FLUID_MOD_VALID) == 0); // path without destination
}
// Circular complex modulators
@ -681,9 +681,9 @@ int main(void)
// modulators that are part of the circular list are invalidated: mod3,mod1
TEST_ASSERT(fluid_mod_get_amount(mod0) == 100);
TEST_ASSERT(fluid_mod_get_amount(mod1) == 0);
TEST_ASSERT((mod1->path & FLUID_MOD_VALID) == 0);
TEST_ASSERT(fluid_mod_get_amount(mod2) == 300);
TEST_ASSERT(fluid_mod_get_amount(mod3) == 0);
TEST_ASSERT((mod3->path & FLUID_MOD_VALID) == 0);
}
// Test 6.0.1: Same test as 6.0 but with linked_mod not NULL. The function expects to return any
@ -740,10 +740,10 @@ int main(void)
TEST_ASSERT(list_of_mods->next->next->next->next == NULL);
// modulators that are part of the circular list are invalidated
TEST_ASSERT(fluid_mod_get_amount(mod0) == 0); // part of circular path
TEST_ASSERT(fluid_mod_get_amount(mod1) == 0); // part of circular path
TEST_ASSERT(fluid_mod_get_amount(mod2) == 0); // part of circular path
TEST_ASSERT(fluid_mod_get_amount(mod3) == 0); // without destination.
TEST_ASSERT((mod0->path & FLUID_MOD_VALID) == 0); // part of circular path
TEST_ASSERT((mod1->path & FLUID_MOD_VALID) == 0); // part of circular path
TEST_ASSERT((mod2->path & FLUID_MOD_VALID) == 0); // part of circular path
TEST_ASSERT((mod3->path & FLUID_MOD_VALID) == 0); // without destination.
}
// Test 6.1.1: Same test as 6.1 but with linked_mod not NULL. The function expects to return any
@ -803,10 +803,10 @@ int main(void)
TEST_ASSERT(list_of_mods->next->next->next->next == NULL);
// modulators that are part of the circular list are invalidated
TEST_ASSERT(fluid_mod_get_amount(mod0) == 0);
TEST_ASSERT(fluid_mod_get_amount(mod1) == 0);
TEST_ASSERT(fluid_mod_get_amount(mod2) == 0);
TEST_ASSERT(fluid_mod_get_amount(mod3) == 0);
TEST_ASSERT((mod0->path & FLUID_MOD_VALID) == 0);
TEST_ASSERT((mod1->path & FLUID_MOD_VALID) == 0);
TEST_ASSERT((mod2->path & FLUID_MOD_VALID) == 0);
TEST_ASSERT((mod3->path & FLUID_MOD_VALID) == 0);
}
// circular complex modulators, but detected isolated because none of these
@ -849,10 +849,10 @@ int main(void)
TEST_ASSERT(list_of_mods->next->next->next == mod3);
TEST_ASSERT(list_of_mods->next->next->next->next == NULL);
TEST_ASSERT(fluid_mod_get_amount(mod0) == 0);
TEST_ASSERT(fluid_mod_get_amount(mod1) == 0);
TEST_ASSERT(fluid_mod_get_amount(mod2) == 0);
TEST_ASSERT(fluid_mod_get_amount(mod3) == 0);
TEST_ASSERT((mod0->path & FLUID_MOD_VALID) == 0);
TEST_ASSERT((mod1->path & FLUID_MOD_VALID) == 0);
TEST_ASSERT((mod2->path & FLUID_MOD_VALID) == 0);
TEST_ASSERT((mod3->path & FLUID_MOD_VALID) == 0);
}
// circular complex modulators m1->m0->m3->m1, but detected isolated because none of these
@ -898,10 +898,10 @@ int main(void)
TEST_ASSERT(list_of_mods->next->next->next->next == NULL);
// modulators that are part of the circular list are invalidated
TEST_ASSERT(fluid_mod_get_amount(mod0) == 0);
TEST_ASSERT(fluid_mod_get_amount(mod1) == 0);
TEST_ASSERT((mod0->path & FLUID_MOD_VALID) == 0);
TEST_ASSERT((mod1->path & FLUID_MOD_VALID) == 0);
TEST_ASSERT(fluid_mod_get_amount(mod2) == 300);
TEST_ASSERT(fluid_mod_get_amount(mod3) == 0);
TEST_ASSERT((mod3->path & FLUID_MOD_VALID) == 0);
}
// circular complex modulators m3->m1->m3, but detected isolated because none of these
@ -949,9 +949,9 @@ int main(void)
// modulators that are part of the circular list are invalidated
TEST_ASSERT(fluid_mod_get_amount(mod0) == 100);
TEST_ASSERT(fluid_mod_get_amount(mod1) == 0);
TEST_ASSERT((mod1->path & FLUID_MOD_VALID) == 0);
TEST_ASSERT(fluid_mod_get_amount(mod2) == 300);
TEST_ASSERT(fluid_mod_get_amount(mod3) == 0);
TEST_ASSERT((mod3->path & FLUID_MOD_VALID) == 0);
}
// invalid list of complex modulators: path without destination, isolated
@ -995,9 +995,9 @@ int main(void)
TEST_ASSERT(list_of_mods->next->next->next == NULL);
// all mods are invalidated
TEST_ASSERT(fluid_mod_get_amount(mod1) == 0); // path without destination
TEST_ASSERT(fluid_mod_get_amount(mod0) == 0); // invalid isolated path
TEST_ASSERT(fluid_mod_get_amount(mod2) == 0); // path without destination
TEST_ASSERT((mod1->path & FLUID_MOD_VALID) == 0); // path without destination
TEST_ASSERT((mod0->path & FLUID_MOD_VALID) == 0); // invalid isolated path
TEST_ASSERT((mod2->path & FLUID_MOD_VALID) == 0); // path without destination
}
// invalid list of complex modulators: invalid destinations
@ -1041,7 +1041,7 @@ int main(void)
// all mods are invalidated
TEST_ASSERT(fluid_mod_get_amount(mod0) == 100);
TEST_ASSERT(fluid_mod_get_amount(mod1) == 0); // path without destination
TEST_ASSERT((mod1->path & FLUID_MOD_VALID) == 0); // path without destination
TEST_ASSERT(fluid_mod_get_amount(mod2) == 300);
}
@ -1091,9 +1091,9 @@ int main(void)
// amounts not changed
TEST_ASSERT(fluid_mod_get_amount(mod0) == 100);
TEST_ASSERT(fluid_mod_get_amount(mod1) == 0); // Invalided because isolated
TEST_ASSERT((mod1->path & FLUID_MOD_VALID) == 0); // Invalided because isolated
TEST_ASSERT(fluid_mod_get_amount(mod2) == 300);
TEST_ASSERT(fluid_mod_get_amount(mod3) == 0);// Invalided because isolated
TEST_ASSERT((mod3->path & FLUID_MOD_VALID) == 0); // Invalided because isolated
}
// Test 9.1: Same test as 9 but with linked_mod not NULL. The function expects to return any
@ -1131,36 +1131,36 @@ int main(void)
{
// dest , src1 , flags1 , src2 , flags2
GEN_VOLENVHOLD , FLUID_MOD_LINK_SRC, FLUID_MOD_GC , FLUID_MOD_NONE , FLUID_MOD_GC,
// amount, link, next
1.0 , 0.0 , NULL
// amount, link, path, next
1.0 , 0.0 , 0 , NULL
},
/* mod0<-mod1<- */
{
// dest , src1 , flags1 , src2 , flags2
0|FLUID_MOD_LINK_DEST, FLUID_MOD_LINK_SRC, FLUID_MOD_GC , FLUID_MOD_VELOCITY, FLUID_MOD_GC,
// amount, link, next
2.0 , 0.0 , NULL
// amount, link, path, next
2.0 , 0.0 , 0 , NULL
},
/* mod1<-mod2<- */
{
// dest , src1 , flags1 , src2 , flags2
1|FLUID_MOD_LINK_DEST, 2 , FLUID_MOD_CC , FLUID_MOD_NONE , FLUID_MOD_GC,
// amount, link, next
3.0 , 0.0 , NULL
// amount, link, path, next
3.0 , 0.0 , 0 , NULL
},
/* mod0<-mod3<- */
{
// dest , src1 , flags1 , src2 , flags2
0|FLUID_MOD_LINK_DEST, FLUID_MOD_LINK_SRC, FLUID_MOD_GC , FLUID_MOD_NONE , FLUID_MOD_GC,
// amount, link, next
4.0 , 0.0 , NULL
// amount, link, path, next
4.0 , 0.0 , 0 , NULL
},
/* mod3<-mod4<- */
{
// dest , src1 , flags1 , src2 , flags2
3|FLUID_MOD_LINK_DEST, 2 , FLUID_MOD_CC , FLUID_MOD_NONE , FLUID_MOD_GC,
// amount, link, next
5.0 , 0.0 , NULL
// amount, link, path, next
5.0 , 0.0 , 0 , NULL
}
};
//--- Input lists build from the table mod_table
@ -1244,36 +1244,36 @@ int main(void)
{
// dest , src1 , flags1 , src2 , flags2
GEN_VOLENVHOLD , FLUID_MOD_LINK_SRC, FLUID_MOD_GC , FLUID_MOD_NONE , FLUID_MOD_GC,
// amount, link, next
1.0 , 0.0 , NULL
// amount, link, path, next
1.0 , 0.0 , 0 , NULL
},
/* mod0<-mod1<- */
{
// dest , src1 , flags1 , src2 , flags2
0|FLUID_MOD_LINK_DEST, FLUID_MOD_LINK_SRC, FLUID_MOD_GC , FLUID_MOD_VELOCITY, FLUID_MOD_GC,
// amount, link, next
2.0 , 0.0 , NULL
// amount, link, path, next
2.0 , 0.0 , 0 , NULL
},
/* mod1<-mod2<- */
{
// dest , src1 , flags1 , src2 , flags2
1|FLUID_MOD_LINK_DEST, 2 , FLUID_MOD_CC , FLUID_MOD_NONE , FLUID_MOD_GC,
// amount, link, next
3.0 , 0.0 , NULL
// amount, link, path, next
3.0 , 0.0 , 0 , NULL
},
/* mod0<-mod3<- */
{
// dest , src1 , flags1 , src2 , flags2
0|FLUID_MOD_LINK_DEST, FLUID_MOD_LINK_SRC, FLUID_MOD_GC , FLUID_MOD_NONE , FLUID_MOD_GC,
// amount, link, next
4.0 , 0.0 , NULL
// amount, link, path, next
4.0 , 0.0 , 0 , NULL
},
/* mod3<-mod4<- */
{
// dest , src1 , flags1 , src2 , flags2
3|FLUID_MOD_LINK_DEST, 2 , FLUID_MOD_CC , FLUID_MOD_NONE , FLUID_MOD_GC,
// amount, link, next
5.0 , 0.0 , NULL
// amount, link, path, next
5.0 , 0.0 , 0 , NULL
}
};
//--- Input lists build from the table mod_table