Add sample update function

This commit is contained in:
David Henningsson 2010-06-29 14:03:44 +00:00
parent d5cd9dee7e
commit ac8533c193
2 changed files with 10 additions and 3 deletions

View File

@ -94,6 +94,7 @@ fluid_rvoice_event_dispatch(fluid_rvoice_event_t* event)
EVENTFUNC_I1(fluid_rvoice_set_loopstart, fluid_rvoice_t*);
EVENTFUNC_I1(fluid_rvoice_set_loopend, fluid_rvoice_t*);
EVENTFUNC_I1(fluid_rvoice_set_samplemode, fluid_rvoice_t*);
EVENTFUNC_PTR(fluid_rvoice_set_sample, fluid_rvoice_t*, fluid_sample_t*);
EVENTFUNC_R1(fluid_rvoice_handler_set_polyphony, fluid_rvoice_handler_t*);

View File

@ -49,6 +49,14 @@ fluid_voice_get_lower_boundary_for_attenuation(fluid_voice_t* voice);
proc, voice->rvoice, 0, 0.0f); \
} while (0)
#define UPDATE_RVOICE_PTR(proc, obj) \
do { \
if (voice->can_access_rvoice) proc(voice->rvoice, obj); \
else fluid_rvoice_eventhandler_push_ptr(voice->channel->synth->eventhandler, \
proc, voice->rvoice, obj); \
} while (0)
#define UPDATE_RVOICE_GENERIC_R1(proc, obj, rarg) \
do { \
if (voice->can_access_rvoice) proc(obj, rarg); \
@ -171,8 +179,6 @@ fluid_voice_init(fluid_voice_t* voice, fluid_sample_t* sample,
* of IIR filters, position in sample etc) is initialized. */
int i;
fluid_return_val_if_fail(voice->can_access_rvoice, FLUID_FAILED);
voice->id = id;
voice->chan = fluid_channel_get_num(channel);
voice->key = (unsigned char) key;
@ -184,7 +190,7 @@ fluid_voice_init(fluid_voice_t* voice, fluid_sample_t* sample,
voice->debug = 0;
voice->has_noteoff = 0;
UPDATE_RVOICE0(fluid_rvoice_reset);
fluid_rvoice_set_sample(voice->rvoice, sample);
UPDATE_RVOICE_PTR(fluid_rvoice_set_sample, voice->rvoice, sample);
i = fluid_channel_get_interp_method(channel);
UPDATE_RVOICE_I1(fluid_rvoice_set_interp_method, i);