|
|
@ -12,7 +12,7 @@ callback(snd_seq_t *handle)
|
|
|
|
do {
|
|
|
|
do {
|
|
|
|
if (snd_seq_event_input(handle, &ev) > 0) {
|
|
|
|
if (snd_seq_event_input(handle, &ev) > 0) {
|
|
|
|
|
|
|
|
|
|
|
|
if (ev->type == SND_SETQ_EVENT_NOTEON) {
|
|
|
|
if (ev->type == SND_SEQ_EVENT_NOTEON) {
|
|
|
|
|
|
|
|
|
|
|
|
struct timeval tv;
|
|
|
|
struct timeval tv;
|
|
|
|
static long last_usec = 0;
|
|
|
|
static long last_usec = 0;
|
|
|
@ -40,7 +40,7 @@ main(int argc, char **argv)
|
|
|
|
struct pollfd *pfd;
|
|
|
|
struct pollfd *pfd;
|
|
|
|
struct sched_param param;
|
|
|
|
struct sched_param param;
|
|
|
|
|
|
|
|
|
|
|
|
if (snd_seq_open(&handle, "hw", SND_SETQ_OPEN_DUPLEX, 0) < 0) {
|
|
|
|
if (snd_seq_open(&handle, "hw", SND_SEQ_OPEN_DUPLEX, 0) < 0) {
|
|
|
|
fprintf(stderr, "failed to open ALSA sequencer interface\n");
|
|
|
|
fprintf(stderr, "failed to open ALSA sequencer interface\n");
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -49,7 +49,7 @@ main(int argc, char **argv)
|
|
|
|
|
|
|
|
|
|
|
|
if ((portid = snd_seq_create_simple_port
|
|
|
|
if ((portid = snd_seq_create_simple_port
|
|
|
|
(handle, "complainer",
|
|
|
|
(handle, "complainer",
|
|
|
|
SND_SETQ_PORT_CAP_WRITE | SND_SETQ_PORT_CAP_SUBS_WRITE, 0)) < 0) {
|
|
|
|
SND_SEQ_PORT_CAP_WRITE | SND_SEQ_PORT_CAP_SUBS_WRITE, 0)) < 0) {
|
|
|
|
fprintf(stderr, "failed to create ALSA sequencer port\n");
|
|
|
|
fprintf(stderr, "failed to create ALSA sequencer port\n");
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|