Lines Matching refs:sf
27 static int is_identical_font(struct snd_soundfont *sf, int type, unsigned char *name);
31 struct snd_soundfont *sf, struct snd_sf_zone *zp);
33 struct snd_soundfont *sf);
35 struct snd_soundfont *sf, struct snd_sf_sample *sp);
37 struct snd_soundfont *sf);
39 struct snd_soundfont *sf, struct snd_sf_sample *sp);
42 static int remove_info(struct snd_sf_list *sflist, struct snd_soundfont *sf,
46 static struct snd_sf_sample *set_sample(struct snd_soundfont *sf,
48 static struct snd_sf_sample *find_sample(struct snd_soundfont *sf, int sample_id);
223 struct snd_soundfont *sf; in open_patch() local
238 sf = newsf(sflist, parm.type, NULL); in open_patch()
240 sf = newsf(sflist, parm.type, parm.name); in open_patch()
241 if (sf == NULL) { in open_patch()
247 sflist->currsf = sf; in open_patch()
259 struct snd_soundfont *sf; in newsf() local
263 for (sf = sflist->fonts; sf; sf = sf->next) { in newsf()
264 if (is_identical_font(sf, type, name)) { in newsf()
265 return sf; in newsf()
271 sf = kzalloc(sizeof(*sf), GFP_KERNEL); in newsf()
272 if (sf == NULL) in newsf()
274 sf->id = sflist->fonts_size; in newsf()
278 sf->next = sflist->fonts; in newsf()
279 sflist->fonts = sf; in newsf()
281 sf->type = type; in newsf()
282 sf->zones = NULL; in newsf()
283 sf->samples = NULL; in newsf()
285 memcpy(sf->name, name, SNDRV_SFNT_PATCH_NAME_LEN); in newsf()
287 return sf; in newsf()
292 is_identical_font(struct snd_soundfont *sf, int type, unsigned char *name) in is_identical_font() argument
294 return ((sf->type & SNDRV_SFNT_PAT_SHARED) && in is_identical_font()
295 (sf->type & 0x0f) == (type & 0x0f) && in is_identical_font()
297 memcmp(sf->name, name, SNDRV_SFNT_PATCH_NAME_LEN) == 0)); in is_identical_font()
336 set_zone_counter(struct snd_sf_list *sflist, struct snd_soundfont *sf, in set_zone_counter() argument
340 if (sf->type & SNDRV_SFNT_PAT_LOCKED) in set_zone_counter()
348 sf_zone_new(struct snd_sf_list *sflist, struct snd_soundfont *sf) in sf_zone_new() argument
355 zp->next = sf->zones; in sf_zone_new()
356 sf->zones = zp; in sf_zone_new()
360 set_zone_counter(sflist, sf, zp); in sf_zone_new()
369 set_sample_counter(struct snd_sf_list *sflist, struct snd_soundfont *sf, in set_sample_counter() argument
373 if (sf->type & SNDRV_SFNT_PAT_LOCKED) in set_sample_counter()
381 sf_sample_new(struct snd_sf_list *sflist, struct snd_soundfont *sf) in sf_sample_new() argument
389 sp->next = sf->samples; in sf_sample_new()
390 sf->samples = sp; in sf_sample_new()
392 set_sample_counter(sflist, sf, sp); in sf_sample_new()
401 sf_sample_delete(struct snd_sf_list *sflist, struct snd_soundfont *sf, in sf_sample_delete() argument
405 if (sp == sf->samples) { in sf_sample_delete()
406 sf->samples = sp->next; in sf_sample_delete()
417 struct snd_soundfont *sf; in load_map() local
429 sf = newsf(sflist, SNDRV_SFNT_PAT_TYPE_MAP|SNDRV_SFNT_PAT_SHARED, NULL); in load_map()
430 if (sf == NULL) in load_map()
434 for (zp = sf->zones; zp; prevp = zp, zp = zp->next) { in load_map()
446 zp->next = sf->zones; in load_map()
447 sf->zones = zp; in load_map()
450 set_zone_counter(sflist, sf, zp); in load_map()
456 zp = sf_zone_new(sflist, sf); in load_map()
470 zp->v.sf_id = sf->id; in load_map()
480 remove_info(struct snd_sf_list *sflist, struct snd_soundfont *sf, in remove_info() argument
487 for (p = sf->zones; p; p = next) { in remove_info()
495 sf->zones = next; in remove_info()
514 struct snd_soundfont *sf; in load_info() local
520 sf = sflist->currsf; in load_info()
521 if (!sf) in load_info()
524 if (is_special_type(sf->type)) in load_info()
554 for (zone = sf->zones; zone; zone = zone->next) { in load_info()
563 remove_info(sflist, sf, hdr.bank, hdr.instr); in load_info()
581 tmpzone.v.sf_id = sf->id; in load_info()
586 zone = sf_zone_new(sflist, sf); in load_info()
596 zone->sample = set_sample(sf, &zone->v); in load_info()
651 set_sample(struct snd_soundfont *sf, struct soundfont_voice_info *avp) in set_sample() argument
655 sample = find_sample(sf, avp->sample); in set_sample()
677 find_sample(struct snd_soundfont *sf, int sample_id) in find_sample() argument
681 if (sf == NULL) in find_sample()
684 for (p = sf->samples; p; p = p->next) { in find_sample()
701 struct snd_soundfont *sf; in load_data() local
707 sf = sflist->currsf; in load_data()
708 if (!sf) in load_data()
711 if (is_special_type(sf->type)) in load_data()
723 if (find_sample(sf, sample_info.sample)) { in load_data()
725 if (sf->type & SNDRV_SFNT_PAT_SHARED) in load_data()
731 sp = sf_sample_new(sflist, sf); in load_data()
736 sp->v.sf_id = sf->id; in load_data()
749 sf_sample_delete(sflist, sf, sp); in load_data()
948 struct snd_soundfont *sf; in load_guspatch() local
964 sf = newsf(sflist, SNDRV_SFNT_PAT_TYPE_GUS|SNDRV_SFNT_PAT_SHARED, NULL); in load_guspatch()
965 if (sf == NULL) in load_guspatch()
967 smp = sf_sample_new(sflist, sf); in load_guspatch()
1003 smp->v.sf_id = sf->id; in load_guspatch()
1006 zone = sf_zone_new(sflist, sf); in load_guspatch()
1008 sf_sample_delete(sflist, sf, smp); in load_guspatch()
1020 sf_sample_delete(sflist, sf, smp); in load_guspatch()
1112 zone->v.sf_id = sf->id; in load_guspatch()
1114 zone->sample = set_sample(sf, &zone->v); in load_guspatch()
1145 struct snd_soundfont *sf; in rebuild_presets() local
1152 for (sf = sflist->fonts; sf; sf = sf->next) { in rebuild_presets()
1153 for (cur = sf->zones; cur; cur = cur->next) { in rebuild_presets()
1156 cur->sample = set_sample(sf, &cur->v); in rebuild_presets()
1368 struct snd_soundfont *sf, *nextsf; in snd_sf_clear() local
1372 for (sf = sflist->fonts; sf; sf = nextsf) { in snd_sf_clear()
1373 nextsf = sf->next; in snd_sf_clear()
1374 for (zp = sf->zones; zp; zp = nextzp) { in snd_sf_clear()
1378 for (sp = sf->samples; sp; sp = nextsp) { in snd_sf_clear()
1385 kfree(sf); in snd_sf_clear()
1457 struct snd_soundfont *sf; in snd_soundfont_remove_unlocked() local
1469 for (sf = sflist->fonts; sf; sf = sf->next) { in snd_soundfont_remove_unlocked()
1470 for (zp = sf->zones; zp; zp = nextzp) { in snd_soundfont_remove_unlocked()
1474 sf->zones = nextzp; in snd_soundfont_remove_unlocked()
1478 for (sp = sf->samples; sp; sp = nextsp) { in snd_soundfont_remove_unlocked()
1482 sf->samples = nextsp; in snd_soundfont_remove_unlocked()