Lines Matching refs:sf
40 static int is_identical_font(struct snd_soundfont *sf, int type, unsigned char *name);
44 struct snd_soundfont *sf, struct snd_sf_zone *zp);
46 struct snd_soundfont *sf);
48 struct snd_soundfont *sf, struct snd_sf_sample *sp);
50 struct snd_soundfont *sf);
52 struct snd_soundfont *sf, struct snd_sf_sample *sp);
55 static int remove_info(struct snd_sf_list *sflist, struct snd_soundfont *sf,
59 static struct snd_sf_sample *set_sample(struct snd_soundfont *sf,
61 static struct snd_sf_sample *find_sample(struct snd_soundfont *sf, int sample_id);
236 struct snd_soundfont *sf; in open_patch() local
251 sf = newsf(sflist, parm.type, NULL); in open_patch()
253 sf = newsf(sflist, parm.type, parm.name); in open_patch()
254 if (sf == NULL) { in open_patch()
260 sflist->currsf = sf; in open_patch()
272 struct snd_soundfont *sf; in newsf() local
276 for (sf = sflist->fonts; sf; sf = sf->next) { in newsf()
277 if (is_identical_font(sf, type, name)) { in newsf()
278 return sf; in newsf()
284 sf = kzalloc(sizeof(*sf), GFP_KERNEL); in newsf()
285 if (sf == NULL) in newsf()
287 sf->id = sflist->fonts_size; in newsf()
291 sf->next = sflist->fonts; in newsf()
292 sflist->fonts = sf; in newsf()
294 sf->type = type; in newsf()
295 sf->zones = NULL; in newsf()
296 sf->samples = NULL; in newsf()
298 memcpy(sf->name, name, SNDRV_SFNT_PATCH_NAME_LEN); in newsf()
300 return sf; in newsf()
305 is_identical_font(struct snd_soundfont *sf, int type, unsigned char *name) in is_identical_font() argument
307 return ((sf->type & SNDRV_SFNT_PAT_SHARED) && in is_identical_font()
308 (sf->type & 0x0f) == (type & 0x0f) && in is_identical_font()
310 memcmp(sf->name, name, SNDRV_SFNT_PATCH_NAME_LEN) == 0)); in is_identical_font()
349 set_zone_counter(struct snd_sf_list *sflist, struct snd_soundfont *sf, in set_zone_counter() argument
353 if (sf->type & SNDRV_SFNT_PAT_LOCKED) in set_zone_counter()
361 sf_zone_new(struct snd_sf_list *sflist, struct snd_soundfont *sf) in sf_zone_new() argument
367 zp->next = sf->zones; in sf_zone_new()
368 sf->zones = zp; in sf_zone_new()
372 set_zone_counter(sflist, sf, zp); in sf_zone_new()
381 set_sample_counter(struct snd_sf_list *sflist, struct snd_soundfont *sf, in set_sample_counter() argument
385 if (sf->type & SNDRV_SFNT_PAT_LOCKED) in set_sample_counter()
393 sf_sample_new(struct snd_sf_list *sflist, struct snd_soundfont *sf) in sf_sample_new() argument
400 sp->next = sf->samples; in sf_sample_new()
401 sf->samples = sp; in sf_sample_new()
403 set_sample_counter(sflist, sf, sp); in sf_sample_new()
412 sf_sample_delete(struct snd_sf_list *sflist, struct snd_soundfont *sf, in sf_sample_delete() argument
416 if (sp == sf->samples) { in sf_sample_delete()
417 sf->samples = sp->next; in sf_sample_delete()
428 struct snd_soundfont *sf; in load_map() local
440 sf = newsf(sflist, SNDRV_SFNT_PAT_TYPE_MAP|SNDRV_SFNT_PAT_SHARED, NULL); in load_map()
441 if (sf == NULL) in load_map()
445 for (zp = sf->zones; zp; prevp = zp, zp = zp->next) { in load_map()
457 zp->next = sf->zones; in load_map()
458 sf->zones = zp; in load_map()
461 set_zone_counter(sflist, sf, zp); in load_map()
467 if ((zp = sf_zone_new(sflist, sf)) == NULL) in load_map()
480 zp->v.sf_id = sf->id; in load_map()
490 remove_info(struct snd_sf_list *sflist, struct snd_soundfont *sf, in remove_info() argument
497 for (p = sf->zones; p; p = next) { in remove_info()
505 sf->zones = next; in remove_info()
524 struct snd_soundfont *sf; in load_info() local
530 if ((sf = sflist->currsf) == NULL) in load_info()
533 if (is_special_type(sf->type)) in load_info()
563 for (zone = sf->zones; zone; zone = zone->next) { in load_info()
572 remove_info(sflist, sf, hdr.bank, hdr.instr); in load_info()
590 tmpzone.v.sf_id = sf->id; in load_info()
595 if ((zone = sf_zone_new(sflist, sf)) == NULL) { in load_info()
605 zone->sample = set_sample(sf, &zone->v); in load_info()
660 set_sample(struct snd_soundfont *sf, struct soundfont_voice_info *avp) in set_sample() argument
664 sample = find_sample(sf, avp->sample); in set_sample()
686 find_sample(struct snd_soundfont *sf, int sample_id) in find_sample() argument
690 if (sf == NULL) in find_sample()
693 for (p = sf->samples; p; p = p->next) { in find_sample()
710 struct snd_soundfont *sf; in load_data() local
716 if ((sf = sflist->currsf) == NULL) in load_data()
719 if (is_special_type(sf->type)) in load_data()
731 if (find_sample(sf, sample_info.sample)) { in load_data()
733 if (sf->type & SNDRV_SFNT_PAT_SHARED) in load_data()
739 if ((sp = sf_sample_new(sflist, sf)) == NULL) in load_data()
743 sp->v.sf_id = sf->id; in load_data()
756 sf_sample_delete(sflist, sf, sp); in load_data()
953 struct snd_soundfont *sf; in load_guspatch() local
969 sf = newsf(sflist, SNDRV_SFNT_PAT_TYPE_GUS|SNDRV_SFNT_PAT_SHARED, NULL); in load_guspatch()
970 if (sf == NULL) in load_guspatch()
972 if ((smp = sf_sample_new(sflist, sf)) == NULL) in load_guspatch()
1007 smp->v.sf_id = sf->id; in load_guspatch()
1010 if ((zone = sf_zone_new(sflist, sf)) == NULL) { in load_guspatch()
1011 sf_sample_delete(sflist, sf, smp); in load_guspatch()
1023 sf_sample_delete(sflist, sf, smp); in load_guspatch()
1115 zone->v.sf_id = sf->id; in load_guspatch()
1117 zone->sample = set_sample(sf, &zone->v); in load_guspatch()
1148 struct snd_soundfont *sf; in rebuild_presets() local
1155 for (sf = sflist->fonts; sf; sf = sf->next) { in rebuild_presets()
1156 for (cur = sf->zones; cur; cur = cur->next) { in rebuild_presets()
1159 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()
1456 struct snd_soundfont *sf; in snd_soundfont_remove_unlocked() local
1468 for (sf = sflist->fonts; sf; sf = sf->next) { in snd_soundfont_remove_unlocked()
1469 for (zp = sf->zones; zp; zp = nextzp) { in snd_soundfont_remove_unlocked()
1473 sf->zones = nextzp; in snd_soundfont_remove_unlocked()
1477 for (sp = sf->samples; sp; sp = nextsp) { in snd_soundfont_remove_unlocked()
1481 sf->samples = nextsp; in snd_soundfont_remove_unlocked()