mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2025-02-25 21:31:49 +00:00
get rid of redundant fluid_sample_refcount macro
and access field directly
This commit is contained in:
parent
4776b7e407
commit
4d65e07156
4 changed files with 4 additions and 5 deletions
|
@ -85,7 +85,7 @@ Changes in FluidSynth 2.0.0 concerning developers:
|
|||
- remove fluid_synth_set_gen2(), fluid_synth_set_gen() now behaves as fluid_synth_set_gen2()
|
||||
- remove struct fluid_mod_t from public API, use the getters and setters of mod.h instead
|
||||
- remove struct _fluid_gen_t, fluid_gen_set_default_values() and enum fluid_gen_flags from public API
|
||||
- remove macro fluid_sfont_get_id() from public API
|
||||
- remove macros fluid_sfont_get_id() and fluid_sample_refcount() from public API
|
||||
<br /><br />
|
||||
- all public \c fluid_settings_* functions that return an integer which is not meant to be interpreted as bool consistently return either FLUID_OK or FLUID_FAILED
|
||||
- all public delete_* functions return void and are safe when called with NULL
|
||||
|
|
|
@ -290,7 +290,7 @@ struct _fluid_sample_t
|
|||
int amplitude_that_reaches_noise_floor_is_valid; /**< Indicates if \a amplitude_that_reaches_noise_floor is valid (TRUE), set to FALSE initially to calculate. */
|
||||
double amplitude_that_reaches_noise_floor; /**< The amplitude at which the sample's loop will be below the noise floor. For voice off optimization, calculated automatically. */
|
||||
|
||||
unsigned int refcount; /**< Count of voices using this sample (use #fluid_sample_refcount to access this field) */
|
||||
unsigned int refcount; /**< Count of voices using this sample */
|
||||
|
||||
/**
|
||||
* Implement this function to receive notification when sample is no longer used.
|
||||
|
@ -304,7 +304,6 @@ struct _fluid_sample_t
|
|||
};
|
||||
|
||||
|
||||
#define fluid_sample_refcount(_sample) ((_sample)->refcount) /**< Get the reference count of a sample. Should only be called from within synthesis context (noteon method for example) */
|
||||
|
||||
|
||||
#define FLUID_SAMPLETYPE_MONO 1 /**< Flag for #fluid_sample_t \a sampletype field for mono samples */
|
||||
|
|
|
@ -552,7 +552,7 @@ int delete_fluid_defsfont(fluid_defsfont_t* sfont)
|
|||
/* Check that no samples are currently used */
|
||||
for (list = sfont->sample; list; list = fluid_list_next(list)) {
|
||||
sample = (fluid_sample_t*) fluid_list_get(list);
|
||||
if (fluid_sample_refcount(sample) != 0) {
|
||||
if (sample->refcount != 0) {
|
||||
return FLUID_FAILED;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -256,7 +256,7 @@ delete_fluid_ramsfont (fluid_ramsfont_t* sfont)
|
|||
/* Check that no samples are currently used */
|
||||
for (list = sfont->sample; list; list = fluid_list_next(list)) {
|
||||
fluid_sample_t* sam = (fluid_sample_t*) fluid_list_get(list);
|
||||
if (fluid_sample_refcount(sam) != 0) {
|
||||
if (sam->refcount != 0) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue