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);
43 static int remove_info(struct snd_sf_list *sflist, struct snd_soundfont *sf,
47 static struct snd_sf_sample *set_sample(struct snd_soundfont *sf,
49 static struct snd_sf_sample *find_sample(struct snd_soundfont *sf, int sample_id);
225 struct snd_soundfont *sf; in open_patch() local
240 sf = newsf(sflist, parm.type, NULL); in open_patch()
242 sf = newsf(sflist, parm.type, parm.name); in open_patch()
243 if (sf == NULL) { in open_patch()
249 sflist->currsf = sf; in open_patch()
261 struct snd_soundfont *sf; in newsf() local
265 for (sf = sflist->fonts; sf; sf = sf->next) { in newsf()
266 if (is_identical_font(sf, type, name)) { in newsf()
267 return sf; in newsf()
273 sf = kzalloc(sizeof(*sf), GFP_KERNEL); in newsf()
274 if (sf == NULL) in newsf()
276 sf->id = sflist->fonts_size; in newsf()
280 sf->next = sflist->fonts; in newsf()
281 sflist->fonts = sf; in newsf()
283 sf->type = type; in newsf()
284 sf->zones = NULL; in newsf()
285 sf->samples = NULL; in newsf()
287 memcpy(sf->name, name, SNDRV_SFNT_PATCH_NAME_LEN); in newsf()
289 return sf; in newsf()
294 is_identical_font(struct snd_soundfont *sf, int type, unsigned char *name) in is_identical_font() argument
296 return ((sf->type & SNDRV_SFNT_PAT_SHARED) && in is_identical_font()
297 (sf->type & 0x0f) == (type & 0x0f) && in is_identical_font()
299 memcmp(sf->name, name, SNDRV_SFNT_PATCH_NAME_LEN) == 0)); in is_identical_font()
338 set_zone_counter(struct snd_sf_list *sflist, struct snd_soundfont *sf, in set_zone_counter() argument
342 if (sf->type & SNDRV_SFNT_PAT_LOCKED) in set_zone_counter()
350 sf_zone_new(struct snd_sf_list *sflist, struct snd_soundfont *sf) in sf_zone_new() argument
357 zp->next = sf->zones; in sf_zone_new()
358 sf->zones = zp; in sf_zone_new()
362 set_zone_counter(sflist, sf, zp); in sf_zone_new()
371 set_sample_counter(struct snd_sf_list *sflist, struct snd_soundfont *sf, in set_sample_counter() argument
375 if (sf->type & SNDRV_SFNT_PAT_LOCKED) in set_sample_counter()
383 sf_sample_new(struct snd_sf_list *sflist, struct snd_soundfont *sf) in sf_sample_new() argument
391 sp->next = sf->samples; in sf_sample_new()
392 sf->samples = sp; in sf_sample_new()
394 set_sample_counter(sflist, sf, sp); in sf_sample_new()
403 sf_sample_delete(struct snd_sf_list *sflist, struct snd_soundfont *sf, in sf_sample_delete() argument
407 if (sp == sf->samples) { in sf_sample_delete()
408 sf->samples = sp->next; in sf_sample_delete()
419 struct snd_soundfont *sf; in load_map() local
431 sf = newsf(sflist, SNDRV_SFNT_PAT_TYPE_MAP|SNDRV_SFNT_PAT_SHARED, NULL); in load_map()
432 if (sf == NULL) in load_map()
436 for (zp = sf->zones; zp; prevp = zp, zp = zp->next) { in load_map()
448 zp->next = sf->zones; in load_map()
449 sf->zones = zp; in load_map()
452 set_zone_counter(sflist, sf, zp); in load_map()
458 zp = sf_zone_new(sflist, sf); in load_map()
472 zp->v.sf_id = sf->id; in load_map()
482 remove_info(struct snd_sf_list *sflist, struct snd_soundfont *sf, in remove_info() argument
489 for (p = sf->zones; p; p = next) { in remove_info()
497 sf->zones = next; in remove_info()
517 struct snd_soundfont *sf; in load_info() local
523 sf = sflist->currsf; in load_info()
524 if (!sf) in load_info()
527 if (is_special_type(sf->type)) in load_info()
557 for (zone = sf->zones; zone; zone = zone->next) { in load_info()
566 remove_info(sflist, sf, hdr.bank, hdr.instr); in load_info()
584 tmpzone.v.sf_id = sf->id; in load_info()
589 zone = sf_zone_new(sflist, sf); in load_info()
599 zone->sample = set_sample(sf, &zone->v); in load_info()
654 set_sample(struct snd_soundfont *sf, struct soundfont_voice_info *avp) in set_sample() argument
658 sample = find_sample(sf, avp->sample); in set_sample()
680 find_sample(struct snd_soundfont *sf, int sample_id) in find_sample() argument
684 if (sf == NULL) in find_sample()
687 for (p = sf->samples; p; p = p->next) { in find_sample()
719 struct snd_soundfont *sf; in load_data() local
724 sf = sflist->currsf; in load_data()
725 if (!sf) in load_data()
728 if (is_special_type(sf->type)) in load_data()
744 if (find_sample(sf, sample_info.sample)) { in load_data()
746 if (sf->type & SNDRV_SFNT_PAT_SHARED) in load_data()
767 sp = sf_sample_new(sflist, sf); in load_data()
772 sp->v.sf_id = sf->id; in load_data()
785 sf_sample_delete(sflist, sf, sp); in load_data()
984 struct snd_soundfont *sf; in load_guspatch() local
1002 sf = newsf(sflist, SNDRV_SFNT_PAT_TYPE_GUS|SNDRV_SFNT_PAT_SHARED, NULL); in load_guspatch()
1003 if (sf == NULL) in load_guspatch()
1005 smp = sf_sample_new(sflist, sf); in load_guspatch()
1017 sf_sample_delete(sflist, sf, smp); in load_guspatch()
1046 smp->v.sf_id = sf->id; in load_guspatch()
1049 zone = sf_zone_new(sflist, sf); in load_guspatch()
1051 sf_sample_delete(sflist, sf, smp); in load_guspatch()
1063 sf_sample_delete(sflist, sf, smp); in load_guspatch()
1155 zone->v.sf_id = sf->id; in load_guspatch()
1157 zone->sample = set_sample(sf, &zone->v); in load_guspatch()
1189 struct snd_soundfont *sf; in rebuild_presets() local
1196 for (sf = sflist->fonts; sf; sf = sf->next) { in rebuild_presets()
1197 for (cur = sf->zones; cur; cur = cur->next) { in rebuild_presets()
1200 cur->sample = set_sample(sf, &cur->v); in rebuild_presets()
1412 struct snd_soundfont *sf, *nextsf; in snd_sf_clear() local
1416 for (sf = sflist->fonts; sf; sf = nextsf) { in snd_sf_clear()
1417 nextsf = sf->next; in snd_sf_clear()
1418 for (zp = sf->zones; zp; zp = nextzp) { in snd_sf_clear()
1422 for (sp = sf->samples; sp; sp = nextsp) { in snd_sf_clear()
1428 kfree(sf); in snd_sf_clear()
1500 struct snd_soundfont *sf; in snd_soundfont_remove_unlocked() local
1512 for (sf = sflist->fonts; sf; sf = sf->next) { in snd_soundfont_remove_unlocked()
1513 for (zp = sf->zones; zp; zp = nextzp) { in snd_soundfont_remove_unlocked()
1517 sf->zones = nextzp; in snd_soundfont_remove_unlocked()
1521 for (sp = sf->samples; sp; sp = nextsp) { in snd_soundfont_remove_unlocked()
1525 sf->samples = nextsp; in snd_soundfont_remove_unlocked()