/* Rebuild the preset table. This is like a hash table in that it allows quick access to the zone information. For each preset there are zone structures linked by next_instr and by next_zone. Former is the whole link for this preset, and latter is the link for zone (i.e. instrument/ bank/key combination).  */
static void rebuild_presets(struct snd_sf_list *sflist)
/* Rebuild the preset table. This is like a hash table in that it allows quick access to the zone information. For each preset there are zone structures linked by next_instr and by next_zone. Former is the whole link for this preset, and latter is the link for zone (i.e. instrument/ bank/key combination).  */
static void rebuild_presets(struct snd_sf_list *sflist)
{
	struct snd_soundfont *sf;
	struct snd_sf_zone *cur;
	memset(sflist->presets, 0, sizeof(sflist->presets));
	for (sf = sflist->fonts; sf; sf = sf->next) {
		for (cur = sf->zones; cur; cur = cur->next) {
			if (! cur->mapped && cur->sample == NULL) {
				cur->sample = set_sample(sf, &cur->v);
				if (cur->sample == NULL)
					continue;
			}
			add_preset(sflist, cur);
		}
	}
}