コード例 #1
0
ファイル: ksound-core.c プロジェクト: Audioniek/Fortis-4G
snd_kcontrol_t *ksnd_substream_find_elem(snd_pcm_substream_t *substream, snd_ctl_elem_id_t *id)
{
	snd_kcontrol_t *ret;
	down_read(&substream->pcm->card->controls_rwsem);
	ret = snd_ctl_find_id(substream->pcm->card, id);
	up_read(&substream->pcm->card->controls_rwsem);
	return ret;
}
コード例 #2
0
ファイル: emumixer.c プロジェクト: FatSunHYS/OSCourseDesign
static struct snd_kcontrol *ctl_find(struct snd_card *card, const char *name)
{
	struct snd_ctl_elem_id sid;
	memset(&sid, 0, sizeof(sid));
	strcpy(sid.name, name);
	sid.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
	return snd_ctl_find_id(card, &sid);
}
コード例 #3
0
ファイル: ctljack.c プロジェクト: akuster/linux-meson
static int get_available_index(struct snd_card *card, const char *name)
{
	struct snd_ctl_elem_id sid;

	memset(&sid, 0, sizeof(sid));

	sid.index = 0;
	sid.iface = SNDRV_CTL_ELEM_IFACE_CARD;
	strlcpy(sid.name, name, sizeof(sid.name));

	while (snd_ctl_find_id(card, &sid))
		sid.index++;

	return sid.index;
}
コード例 #4
0
ファイル: ioctl32_old.c プロジェクト: canalplus/r7oss
/* hmm, it's so hard to retrieve the value type from the control id.. */
static int get_ctl_type(struct file *file, struct snd_ctl_elem_id *id)
{
	struct snd_ctl_file *ctl;
	struct snd_kcontrol *kctl;
	struct snd_ctl_elem_info info;
	int err;

	ctl = file->private_data;

	down_read(&ctl->card->controls_rwsem);
	kctl = snd_ctl_find_id(ctl->card, id);
	if (! kctl) {
		up_read(&ctl->card->controls_rwsem);
		return -ENXIO;
	}
	info.id = *id;
	err = kctl->info(kctl, &info);
	up_read(&ctl->card->controls_rwsem);
	if (err >= 0)
		err = info.type;
	return err;
}