Added snd_timer_async() function.

More updates to pcm_dmix.c .
This commit is contained in:
Jaroslav Kysela 2003-02-06 19:15:53 +00:00
parent 7c5e5f5728
commit 757785fece
5 changed files with 125 additions and 32 deletions

View file

@ -73,6 +73,7 @@ This example shows opening a timer device and reading of timer events.
#include <string.h>
#include <fcntl.h>
#include <dlfcn.h>
#include <signal.h>
#include <sys/ioctl.h>
#include "timer_local.h"
@ -350,6 +351,27 @@ int snd_timer_nonblock(snd_timer_t *timer, int nonblock)
return 0;
}
#ifndef DOC_HIDDEN
/**
* \brief set async mode
* \param timer timer handle
* \param sig Signal to raise: < 0 disable, 0 default (SIGIO)
* \param pid Process ID to signal: 0 current
* \return 0 on success otherwise a negative error code
*
* A signal is raised every period.
*/
int snd_timer(snd_timer_t *timer, int sig, pid_t pid)
{
assert(timer);
if (sig == 0)
sig = SIGIO;
if (pid == 0)
pid = getpid();
return timer->ops->async(timer, sig, pid);
}
#endif
/**
* \brief get size of the snd_timer_info_t structure in bytes
* \return size of the snd_timer_info_t structure in bytes