version 1.61, 2009/07/25 08:44:27 |
version 1.62, 2009/07/25 10:52:18 |
|
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
*/ |
*/ |
#include <sys/param.h> |
#include <sys/param.h> |
#include <sys/types.h> |
|
#include <sys/queue.h> |
#include <sys/queue.h> |
#include <sys/stat.h> |
#include <sys/stat.h> |
|
#include <sys/types.h> |
|
|
#include <err.h> |
#include <err.h> |
#include <errno.h> |
#include <errno.h> |
|
|
#include <unistd.h> |
#include <unistd.h> |
#include <varargs.h> |
#include <varargs.h> |
|
|
#include "conf.h" |
#include "abuf.h" |
#include "aparams.h" |
#include "aparams.h" |
#include "aproc.h" |
#include "aproc.h" |
#include "abuf.h" |
#include "conf.h" |
#include "wav.h" |
|
#include "listen.h" |
|
#include "dev.h" |
#include "dev.h" |
|
#include "listen.h" |
#include "midi.h" |
#include "midi.h" |
#include "opt.h" |
|
#include "miofile.h" |
#include "miofile.h" |
|
#include "opt.h" |
|
#include "wav.h" |
|
|
#define MODE_PLAY 1 |
#define MODE_PLAY 1 |
#define MODE_REC 2 |
#define MODE_REC 2 |
|
|
/* |
/* |
* SIGINT handler, it raises the quit flag. If the flag is already set, |
* SIGINT handler, it raises the quit flag. If the flag is already set, |
* that means that the last SIGINT was not handled, because the process |
* that means that the last SIGINT was not handled, because the process |
* is blocked somewhere, so exit |
* is blocked somewhere, so exit. |
*/ |
*/ |
void |
void |
sigint(int s) |
sigint(int s) |
|
|
} |
} |
|
|
/* |
/* |
* increase debug level on SIGUSR1 |
* Increase debug level on SIGUSR1. |
*/ |
*/ |
void |
void |
sigusr1(int s) |
sigusr1(int s) |
|
|
} |
} |
|
|
/* |
/* |
* decrease debug level on SIGUSR2 |
* Decrease debug level on SIGUSR2. |
*/ |
*/ |
void |
void |
sigusr2(int s) |
sigusr2(int s) |
|
|
return XRUN_SYNC; |
return XRUN_SYNC; |
if (strcmp("error", optarg) == 0) |
if (strcmp("error", optarg) == 0) |
return XRUN_ERROR; |
return XRUN_ERROR; |
errx(1, "%s: onderrun/overrun policy", optarg); |
errx(1, "%s: underrun/overrun policy", optarg); |
} |
} |
|
|
int |
int |
|
|
} |
} |
|
|
/* |
/* |
* if there are no sockets paths provided use the default |
* If there are no sockets paths provided use the default. |
*/ |
*/ |
if (l_flag && SLIST_EMPTY(&sfiles)) { |
if (l_flag && SLIST_EMPTY(&sfiles)) { |
farg_add(&sfiles, &dopar, &dipar, |
farg_add(&sfiles, &dopar, &dipar, |
|
|
|
|
/* |
/* |
* Open the device. Give half of the buffer to the device, |
* Open the device. Give half of the buffer to the device, |
* the other half is for the socket/files |
* the other half is for the socket/files. |
*/ |
*/ |
if (n_flag) { |
if (n_flag) { |
dev_loopinit(&dipar, &dopar, bufsz); |
dev_loopinit(&dipar, &dopar, bufsz); |
|
|
} |
} |
|
|
/* |
/* |
* loop, start audio |
* Loop, start audio. |
*/ |
*/ |
for (;;) { |
for (;;) { |
if (quit_flag) { |
if (quit_flag) { |