|
From: | josh |
Subject: | Re: [fluid-dev] Qsynth broken with FluidSynth 1.1.0 |
Date: | Sat, 07 Nov 2009 12:13:00 -0800 |
User-agent: | Internet Messaging Program (IMP) H3 (4.1.6) |
Quoting Rui Nuno Capela <address@hidden>:
Sounds good. How about adding a size field to, so that there can be potential future extensions to fluid_preset_info_t. Example: fluid_preset_info_t info; fluid_synth_get_channel_preset_info(synth, chan, &info, sizeof (info));omg, that additional size argument just raises from the grave all too many windows api'esque nightmares. i'll pretend i did not read that and close my eyes if you really think it's necessary :))
Ha ha, that is kind of where I borrowed it from. I haven't had to suffer through much Windows programming though, so that probably accounts for my naivety :)
one possible and alternative solution is about having the fluid_preset_info_t as an opaque struct, accessible trough additional api functions (or macros): const char *fluid_preset_info_get_name(&info); int fluid_preset_info_get_bank(&info); int fluid_preset_info_get_num(&info); fluid_sfont_t *fluid_preset_info_get_sfont(&info); any additional fields would have corresponding accessors in a possible future.
The structure would have to be allocated by FluidSynth in that case, to maintain backwards compatibility if it was expanded. So something like:
fluid_preset_info_t *info; info = new_fluid_preset_info (); fluid_synth_get_channel_preset_info (synth, chan, info);It would then probably be fine to just access the structure fields directly, which would allow for additional fields to be added if need be.
cheers -- rncbc aka Rui Nuno Capela address@hidden
Cheers Josh
[Prev in Thread] | Current Thread | [Next in Thread] |