Lines Matching full: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);
182 /* open patch; create sf list */
188 struct snd_soundfont *sf;
200 sf = newsf(sflist, parm.type, NULL);
202 sf = newsf(sflist, parm.type, parm.name);
203 if (sf == NULL) {
209 sflist->currsf = sf;
221 struct snd_soundfont *sf;
225 for (sf = sflist->fonts; sf; sf = sf->next) {
226 if (is_identical_font(sf, type, name)) {
227 return sf;
233 sf = kzalloc(sizeof(*sf), GFP_KERNEL);
234 if (sf == NULL)
236 sf->id = sflist->fonts_size;
240 sf->next = sflist->fonts;
241 sflist->fonts = sf;
243 sf->type = type;
244 sf->zones = NULL;
245 sf->samples = NULL;
247 memcpy(sf->name, name, SNDRV_SFNT_PATCH_NAME_LEN);
249 return sf;
254 is_identical_font(struct snd_soundfont *sf, int type, unsigned char *name)
256 return ((sf->type & SNDRV_SFNT_PAT_SHARED) &&
257 (sf->type & 0x0f) == (type & 0x0f) &&
259 memcmp(sf->name, name, SNDRV_SFNT_PATCH_NAME_LEN) == 0));
296 set_zone_counter(struct snd_sf_list *sflist, struct snd_soundfont *sf,
300 if (sf->type & SNDRV_SFNT_PAT_LOCKED)
308 sf_zone_new(struct snd_sf_list *sflist, struct snd_soundfont *sf)
315 zp->next = sf->zones;
316 sf->zones = zp;
320 set_zone_counter(sflist, sf, zp);
329 set_sample_counter(struct snd_sf_list *sflist, struct snd_soundfont *sf,
333 if (sf->type & SNDRV_SFNT_PAT_LOCKED)
341 sf_sample_new(struct snd_sf_list *sflist, struct snd_soundfont *sf)
349 sp->next = sf->samples;
350 sf->samples = sp;
352 set_sample_counter(sflist, sf, sp);
361 sf_sample_delete(struct snd_sf_list *sflist, struct snd_soundfont *sf,
365 if (sp == sf->samples) {
366 sf->samples = sp->next;
377 struct snd_soundfont *sf;
389 sf = newsf(sflist, SNDRV_SFNT_PAT_TYPE_MAP|SNDRV_SFNT_PAT_SHARED, NULL);
390 if (sf == NULL)
394 for (zp = sf->zones; zp; prevp = zp, zp = zp->next) {
406 zp->next = sf->zones;
407 sf->zones = zp;
410 set_zone_counter(sflist, sf, zp);
416 zp = sf_zone_new(sflist, sf);
430 zp->v.sf_id = sf->id;
440 remove_info(struct snd_sf_list *sflist, struct snd_soundfont *sf,
447 for (p = sf->zones; p; p = next) {
455 sf->zones = next;
475 struct snd_soundfont *sf;
481 sf = sflist->currsf;
482 if (!sf)
485 if (is_special_type(sf->type))
515 for (zone = sf->zones; zone; zone = zone->next) {
524 remove_info(sflist, sf, hdr.bank, hdr.instr);
542 tmpzone.v.sf_id = sf->id;
547 zone = sf_zone_new(sflist, sf);
557 zone->sample = set_sample(sf, &zone->v);
612 set_sample(struct snd_soundfont *sf, struct soundfont_voice_info *avp)
616 sample = find_sample(sf, avp->sample);
638 find_sample(struct snd_soundfont *sf, int sample_id)
642 if (sf == NULL)
645 for (p = sf->samples; p; p = p->next) {
677 struct snd_soundfont *sf;
682 sf = sflist->currsf;
683 if (!sf)
686 if (is_special_type(sf->type))
702 if (find_sample(sf, sample_info.sample)) {
704 if (sf->type & SNDRV_SFNT_PAT_SHARED)
725 sp = sf_sample_new(sflist, sf);
730 sp->v.sf_id = sf->id;
743 sf_sample_delete(sflist, sf, sp);
942 struct snd_soundfont *sf;
960 sf = newsf(sflist, SNDRV_SFNT_PAT_TYPE_GUS|SNDRV_SFNT_PAT_SHARED, NULL);
961 if (sf == NULL)
963 smp = sf_sample_new(sflist, sf);
975 sf_sample_delete(sflist, sf, smp);
1004 smp->v.sf_id = sf->id;
1007 zone = sf_zone_new(sflist, sf);
1009 sf_sample_delete(sflist, sf, smp);
1021 sf_sample_delete(sflist, sf, smp);
1113 zone->v.sf_id = sf->id;
1115 zone->sample = set_sample(sf, &zone->v);
1144 struct snd_soundfont *sf;
1151 for (sf = sflist->fonts; sf; sf = sf->next) {
1152 for (cur = sf->zones; cur; cur = cur->next) {
1155 cur->sample = set_sample(sf, &cur->v);
1363 struct snd_soundfont *sf, *nextsf;
1367 for (sf = sflist->fonts; sf; sf = nextsf) {
1368 nextsf = sf->next;
1369 for (zp = sf->zones; zp; zp = nextzp) {
1373 for (sp = sf->samples; sp; sp = nextsp) {
1379 kfree(sf);
1450 struct snd_soundfont *sf;
1462 for (sf = sflist->fonts; sf; sf = sf->next) {
1463 for (zp = sf->zones; zp; zp = nextzp) {
1467 sf->zones = nextzp;
1471 for (sp = sf->samples; sp; sp = nextsp) {
1475 sf->samples = nextsp;