get rid of redundant fluid_sample_refcount macro

and access field directly
This commit is contained in:
derselbst 2017-11-27 17:27:37 +01:00
parent 4776b7e407
commit 4d65e07156
4 changed files with 4 additions and 5 deletions

View file

@ -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 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_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 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 /> <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 \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 - all public delete_* functions return void and are safe when called with NULL

View file

@ -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. */ 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. */ 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. * 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 */ #define FLUID_SAMPLETYPE_MONO 1 /**< Flag for #fluid_sample_t \a sampletype field for mono samples */

View file

@ -552,7 +552,7 @@ int delete_fluid_defsfont(fluid_defsfont_t* sfont)
/* Check that no samples are currently used */ /* Check that no samples are currently used */
for (list = sfont->sample; list; list = fluid_list_next(list)) { for (list = sfont->sample; list; list = fluid_list_next(list)) {
sample = (fluid_sample_t*) fluid_list_get(list); sample = (fluid_sample_t*) fluid_list_get(list);
if (fluid_sample_refcount(sample) != 0) { if (sample->refcount != 0) {
return FLUID_FAILED; return FLUID_FAILED;
} }
} }

View file

@ -256,7 +256,7 @@ delete_fluid_ramsfont (fluid_ramsfont_t* sfont)
/* Check that no samples are currently used */ /* Check that no samples are currently used */
for (list = sfont->sample; list; list = fluid_list_next(list)) { for (list = sfont->sample; list; list = fluid_list_next(list)) {
fluid_sample_t* sam = (fluid_sample_t*) fluid_list_get(list); fluid_sample_t* sam = (fluid_sample_t*) fluid_list_get(list);
if (fluid_sample_refcount(sam) != 0) { if (sam->refcount != 0) {
return -1; return -1;
} }
} }