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