mirror of
				https://github.com/alsa-project/alsa-lib.git
				synced 2025-11-03 09:01:52 -05:00 
			
		
		
		
	Added snd_*_card() functions.
This commit is contained in:
		
							parent
							
								
									c268a4bf56
								
							
						
					
					
						commit
						9acdef38c9
					
				
					 31 changed files with 140 additions and 12 deletions
				
			
		| 
						 | 
				
			
			@ -45,6 +45,12 @@ int snd_ctl_close(snd_ctl_t *ctl)
 | 
			
		|||
	return res;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int snd_ctl_card(snd_ctl_t *ctl)
 | 
			
		||||
{
 | 
			
		||||
	assert(ctl);
 | 
			
		||||
	return ctl->ops->card(ctl);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int snd_ctl_poll_descriptor(snd_ctl_t *ctl)
 | 
			
		||||
{
 | 
			
		||||
	assert(ctl);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -48,6 +48,12 @@ static int snd_ctl_hw_close(snd_ctl_t *handle)
 | 
			
		|||
	return res;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int snd_ctl_hw_card(snd_ctl_t *handle)
 | 
			
		||||
{
 | 
			
		||||
	snd_ctl_hw_t *hw = handle->private;
 | 
			
		||||
	return hw->card;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int snd_ctl_hw_poll_descriptor(snd_ctl_t *handle)
 | 
			
		||||
{
 | 
			
		||||
	snd_ctl_hw_t *hw = handle->private;
 | 
			
		||||
| 
						 | 
				
			
			@ -166,6 +172,7 @@ static int snd_ctl_hw_read(snd_ctl_t *handle, snd_ctl_event_t *event)
 | 
			
		|||
 | 
			
		||||
snd_ctl_ops_t snd_ctl_hw_ops = {
 | 
			
		||||
	close: snd_ctl_hw_close,
 | 
			
		||||
	card: snd_ctl_hw_card,
 | 
			
		||||
	poll_descriptor: snd_ctl_hw_poll_descriptor,
 | 
			
		||||
	hw_info: snd_ctl_hw_hw_info,
 | 
			
		||||
	clist: snd_ctl_hw_clist,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -33,6 +33,7 @@
 | 
			
		|||
 | 
			
		||||
typedef struct {
 | 
			
		||||
	int (*close)(snd_ctl_t *handle);
 | 
			
		||||
	int (*card)(snd_ctl_t *handle);
 | 
			
		||||
	int (*poll_descriptor)(snd_ctl_t *handle);
 | 
			
		||||
	int (*hw_info)(snd_ctl_t *handle, snd_ctl_hw_info_t *info);
 | 
			
		||||
	int (*clist)(snd_ctl_t *handle, snd_control_list_t *list);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -95,6 +95,18 @@ static int snd_ctl_shm_close(snd_ctl_t *ctl)
 | 
			
		|||
	return result;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int snd_ctl_shm_card(snd_ctl_t *ctl)
 | 
			
		||||
{
 | 
			
		||||
	snd_ctl_shm_t *shm = ctl->private;
 | 
			
		||||
	snd_ctl_shm_ctrl_t *ctrl = shm->ctrl;
 | 
			
		||||
	int card, err;
 | 
			
		||||
	ctrl->cmd = SND_CTL_IOCTL_CARD;
 | 
			
		||||
	err = snd_ctl_shm_action_fd(ctl, &card);
 | 
			
		||||
	if (err < 0)
 | 
			
		||||
		return err;
 | 
			
		||||
	return card;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static int snd_ctl_shm_poll_descriptor(snd_ctl_t *ctl)
 | 
			
		||||
{
 | 
			
		||||
	snd_ctl_shm_t *shm = ctl->private;
 | 
			
		||||
| 
						 | 
				
			
			@ -310,6 +322,7 @@ static int snd_ctl_shm_read(snd_ctl_t *ctl, snd_ctl_event_t *event)
 | 
			
		|||
 | 
			
		||||
snd_ctl_ops_t snd_ctl_shm_ops = {
 | 
			
		||||
	close: snd_ctl_shm_close,
 | 
			
		||||
	card: snd_ctl_shm_card,
 | 
			
		||||
	poll_descriptor: snd_ctl_shm_poll_descriptor,
 | 
			
		||||
	hw_info: snd_ctl_shm_hw_info,
 | 
			
		||||
	clist: snd_ctl_shm_clist,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue