Cleanup from Yamahata Isaku...

This commit is contained in:
Jaroslav Kysela 1999-01-25 20:49:14 +00:00
parent 74ba33d92a
commit 9225699798

View file

@ -33,6 +33,8 @@
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>
#include <sched.h>
#include <string.h>
#include "midifile.h" /* SMF library header */ #include "midifile.h" /* SMF library header */
#include "midifile.c" /* SMF library code */ #include "midifile.c" /* SMF library code */
@ -119,7 +121,7 @@ void write_ev_im(snd_seq_event_t * ev)
while (written<0) { while (written<0) {
written = snd_seq_event_output (seq_handle, ev); written = snd_seq_event_output (seq_handle, ev);
if (written<0) { if (written<0) {
printf("written = %i (%s)\n", written, strerror(-written)); printf("written = %i (%s)\n", written, snd_strerror(written));
sleep(1); sleep(1);
} }
} }
@ -135,9 +137,7 @@ void write_ev(snd_seq_event_t * ev)
/* write variable length event to ALSA sequencer */ /* write variable length event to ALSA sequencer */
void write_ev_var(snd_seq_event_t * ev, int len, void *ptr) void write_ev_var(snd_seq_event_t * ev, int len, void *ptr)
{ {
int bytes;
int written; int written;
unsigned char *buf;
sleep_seq(ev->time.tick+ppq); sleep_seq(ev->time.tick+ppq);
@ -146,11 +146,13 @@ void write_ev_var(snd_seq_event_t * ev, int len, void *ptr)
ev->data.ext.len = len; ev->data.ext.len = len;
ev->data.ext.ptr = ptr; ev->data.ext.ptr = ptr;
written = 0; written = -ENOMEM;
while (!written) { while (written<0) {
written = snd_seq_event_output (seq_handle, ev); written = snd_seq_event_output (seq_handle, ev);
if (!written) if (written<0) {
sleep(1); printf("written = %i (%s)\n", written, snd_strerror(written));
sleep(1);
}
} }
} }
@ -559,7 +561,6 @@ void alsa_stop_timer(void)
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
char *name;
snd_seq_client_info_t inf; snd_seq_client_info_t inf;
snd_seq_port_info_t src_port_info; snd_seq_port_info_t src_port_info;
snd_seq_queue_client_t queue_info; snd_seq_queue_client_t queue_info;
@ -705,7 +706,9 @@ int main(int argc, char *argv[])
snd_seq_close (seq_handle); snd_seq_close (seq_handle);
printf("Stopping at %lf s, tick %d\n", tick2time_dbl(Mf_currtime + 1), Mf_currtime + 1); printf("Stopping at %f s, tick %f\n",
tick2time_dbl(Mf_currtime + 1), (double) (Mf_currtime + 1));
exit(0); exit(0);
} }