mirror of
				https://github.com/alsa-project/alsa-lib.git
				synced 2025-11-03 09:01:52 -05:00 
			
		
		
		
	Another API cleanups.
Added setup functions for rawmidi and timer interfaces.
This commit is contained in:
		
							parent
							
								
									40fd003a4d
								
							
						
					
					
						commit
						986c1500d2
					
				
					 4 changed files with 25 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -133,6 +133,17 @@ int snd_rawmidi_channel_params(snd_rawmidi_t *rmidi, snd_rawmidi_params_t * para
 | 
			
		|||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int snd_rawmidi_channel_setup(snd_rawmidi_t *rmidi, snd_rawmidi_setup_t * setup)
 | 
			
		||||
{
 | 
			
		||||
	if (!rmidi || !setup)
 | 
			
		||||
		return -EINVAL;
 | 
			
		||||
	if (setup->channel < 0 || setup->channel > 1)
 | 
			
		||||
		return -EINVAL;
 | 
			
		||||
	if (ioctl(rmidi->fd, SND_RAWMIDI_IOCTL_CHANNEL_SETUP, setup) < 0)
 | 
			
		||||
		return -errno;
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int snd_rawmidi_channel_status(snd_rawmidi_t *rmidi, snd_rawmidi_status_t * status)
 | 
			
		||||
{
 | 
			
		||||
	if (!rmidi || !status)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -136,6 +136,18 @@ int snd_timer_params(snd_timer_t *handle, snd_timer_params_t * params)
 | 
			
		|||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int snd_timer_setup(snd_timer_t *handle, snd_timer_setup_t * setup)
 | 
			
		||||
{
 | 
			
		||||
	snd_timer_t *tmr;
 | 
			
		||||
 | 
			
		||||
	tmr = handle;
 | 
			
		||||
	if (!tmr || !setup)
 | 
			
		||||
		return -EINVAL;
 | 
			
		||||
	if (ioctl(tmr->fd, SND_TIMER_IOCTL_SETUP, setup) < 0)
 | 
			
		||||
		return -errno;
 | 
			
		||||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int snd_timer_status(snd_timer_t *handle, snd_timer_status_t * status)
 | 
			
		||||
{
 | 
			
		||||
	snd_timer_t *tmr;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue