version 1.148, 2015/05/16 19:27:53 |
version 1.149, 2015/08/27 07:25:56 |
|
|
#define DEFAULT_BUFSZ_MS 200 |
#define DEFAULT_BUFSZ_MS 200 |
|
|
struct slot { |
struct slot { |
struct slot *next; /* next on the play list */ |
struct slot *next; /* next on the play/rec list */ |
int vol; /* dynamic range */ |
int vol; /* dynamic range */ |
int volctl; /* volume in the 0..127 range */ |
int volctl; /* volume in the 0..127 range */ |
struct abuf buf; /* file i/o buffer */ |
struct abuf buf; /* file i/o buffer */ |
|
|
#define SLOT_RUN 2 /* playing/recording */ |
#define SLOT_RUN 2 /* playing/recording */ |
#define SLOT_STOP 3 /* draining (play only) */ |
#define SLOT_STOP 3 /* draining (play only) */ |
int pstate; /* one of above */ |
int pstate; /* one of above */ |
struct afile afile; /* file desc & friends */ |
struct afile afile; /* file desc & friends */ |
}; |
}; |
|
|
/* |
/* |
|
|
} |
} |
|
|
/* |
/* |
* parse then given data chunk, and calling imsg() for each message |
* parse the given data chunk and call imsg() for each message |
*/ |
*/ |
static void |
static void |
midi_in(unsigned char *idata, int icount) |
midi_in(unsigned char *idata, int icount) |
|
|
for (i = 0; i < icount; i++) { |
for (i = 0; i < icount; i++) { |
c = *idata++; |
c = *idata++; |
if (c >= 0xf8) { |
if (c >= 0xf8) { |
/* we don't use reat-time events */ |
/* we don't use real-time events */ |
} else if (c == SYSEX_END) { |
} else if (c == SYSEX_END) { |
if (dev_mst == SYSEX_START) { |
if (dev_mst == SYSEX_START) { |
dev_msg[dev_midx++] = c; |
dev_msg[dev_midx++] = c; |
|
|
if (dev == NULL) |
if (dev == NULL) |
dev = SIO_DEVANY; |
dev = SIO_DEVANY; |
if (mode == 0) { |
if (mode == 0) { |
log_puts("at least of -i and -o required\n"); |
log_puts("at least -i or -o required\n"); |
return 1; |
return 1; |
} |
} |
if (!playrec(dev, mode, bufsz, port)) |
if (!playrec(dev, mode, bufsz, port)) |