• Home
  • Raw
  • Download

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
354 zp->next = sf->zones; in sf_zone_new()
355 sf->zones = zp; in sf_zone_new()
359 set_zone_counter(sflist, sf, zp); in sf_zone_new()
368 set_sample_counter(struct snd_sf_list *sflist, struct snd_soundfont *sf, in set_sample_counter() argument
372 if (sf->type & SNDRV_SFNT_PAT_LOCKED) in set_sample_counter()
380 sf_sample_new(struct snd_sf_list *sflist, struct snd_soundfont *sf) in sf_sample_new() argument
387 sp->next = sf->samples; in sf_sample_new()
388 sf->samples = sp; in sf_sample_new()
390 set_sample_counter(sflist, sf, sp); in sf_sample_new()
399 sf_sample_delete(struct snd_sf_list *sflist, struct snd_soundfont *sf, in sf_sample_delete() argument
403 if (sp == sf->samples) { in sf_sample_delete()
404 sf->samples = sp->next; in sf_sample_delete()
415 struct snd_soundfont *sf; in load_map() local
427 sf = newsf(sflist, SNDRV_SFNT_PAT_TYPE_MAP|SNDRV_SFNT_PAT_SHARED, NULL); in load_map()
428 if (sf == NULL) in load_map()
432 for (zp = sf->zones; zp; prevp = zp, zp = zp->next) { in load_map()
444 zp->next = sf->zones; in load_map()
445 sf->zones = zp; in load_map()
448 set_zone_counter(sflist, sf, zp); in load_map()
454 if ((zp = sf_zone_new(sflist, sf)) == NULL) in load_map()
467 zp->v.sf_id = sf->id; in load_map()
477 remove_info(struct snd_sf_list *sflist, struct snd_soundfont *sf, in remove_info() argument
484 for (p = sf->zones; p; p = next) { in remove_info()
492 sf->zones = next; in remove_info()
511 struct snd_soundfont *sf; in load_info() local
517 if ((sf = sflist->currsf) == NULL) in load_info()
520 if (is_special_type(sf->type)) in load_info()
550 for (zone = sf->zones; zone; zone = zone->next) { in load_info()
559 remove_info(sflist, sf, hdr.bank, hdr.instr); in load_info()
577 tmpzone.v.sf_id = sf->id; in load_info()
582 if ((zone = sf_zone_new(sflist, sf)) == NULL) { in load_info()
592 zone->sample = set_sample(sf, &zone->v); in load_info()
647 set_sample(struct snd_soundfont *sf, struct soundfont_voice_info *avp) in set_sample() argument
651 sample = find_sample(sf, avp->sample); in set_sample()
673 find_sample(struct snd_soundfont *sf, int sample_id) in find_sample() argument
677 if (sf == NULL) in find_sample()
680 for (p = sf->samples; p; p = p->next) { in find_sample()
697 struct snd_soundfont *sf; in load_data() local
703 if ((sf = sflist->currsf) == NULL) in load_data()
706 if (is_special_type(sf->type)) in load_data()
718 if (find_sample(sf, sample_info.sample)) { in load_data()
720 if (sf->type & SNDRV_SFNT_PAT_SHARED) in load_data()
726 if ((sp = sf_sample_new(sflist, sf)) == NULL) in load_data()
730 sp->v.sf_id = sf->id; in load_data()
743 sf_sample_delete(sflist, sf, sp); in load_data()
942 struct snd_soundfont *sf; in load_guspatch() local
958 sf = newsf(sflist, SNDRV_SFNT_PAT_TYPE_GUS|SNDRV_SFNT_PAT_SHARED, NULL); in load_guspatch()
959 if (sf == NULL) in load_guspatch()
961 if ((smp = sf_sample_new(sflist, sf)) == NULL) in load_guspatch()
996 smp->v.sf_id = sf->id; in load_guspatch()
999 if ((zone = sf_zone_new(sflist, sf)) == NULL) { in load_guspatch()
1000 sf_sample_delete(sflist, sf, smp); in load_guspatch()
1012 sf_sample_delete(sflist, sf, smp); in load_guspatch()
1104 zone->v.sf_id = sf->id; in load_guspatch()
1106 zone->sample = set_sample(sf, &zone->v); in load_guspatch()
1137 struct snd_soundfont *sf; in rebuild_presets() local
1144 for (sf = sflist->fonts; sf; sf = sf->next) { in rebuild_presets()
1145 for (cur = sf->zones; cur; cur = cur->next) { in rebuild_presets()
1148 cur->sample = set_sample(sf, &cur->v); in rebuild_presets()
1357 struct snd_soundfont *sf, *nextsf; in snd_sf_clear() local
1361 for (sf = sflist->fonts; sf; sf = nextsf) { in snd_sf_clear()
1362 nextsf = sf->next; in snd_sf_clear()
1363 for (zp = sf->zones; zp; zp = nextzp) { in snd_sf_clear()
1367 for (sp = sf->samples; sp; sp = nextsp) { in snd_sf_clear()
1374 kfree(sf); in snd_sf_clear()
1445 struct snd_soundfont *sf; in snd_soundfont_remove_unlocked() local
1457 for (sf = sflist->fonts; sf; sf = sf->next) { in snd_soundfont_remove_unlocked()
1458 for (zp = sf->zones; zp; zp = nextzp) { in snd_soundfont_remove_unlocked()
1462 sf->zones = nextzp; in snd_soundfont_remove_unlocked()
1466 for (sp = sf->samples; sp; sp = nextsp) { in snd_soundfont_remove_unlocked()
1470 sf->samples = nextsp; in snd_soundfont_remove_unlocked()