mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-10-06 06:18:00 +02:00
Compare commits
4 commits
79da1551f6
...
ff8e339505
Author | SHA1 | Date | |
---|---|---|---|
|
ff8e339505 | ||
|
02b0c3af56 | ||
|
df736ad67a | ||
|
2185bc70a9 |
2 changed files with 41 additions and 9 deletions
|
@ -1618,6 +1618,8 @@ static void do_pause(void)
|
|||
error(_("pause push error: %s"), snd_strerror(err));
|
||||
return;
|
||||
}
|
||||
fprintf(stderr, _("\r=== PAUSE === "));
|
||||
fflush(stderr);
|
||||
while (1) {
|
||||
b = wait_for_input();
|
||||
if (b == ' ' || b == '\r') {
|
||||
|
@ -1642,8 +1644,6 @@ static void check_stdin(void)
|
|||
while (read(fileno(stdin), &b, 1) == 1) {
|
||||
if (b == ' ' || b == '\r') {
|
||||
while (read(fileno(stdin), &b, 1) == 1);
|
||||
fprintf(stderr, _("\r=== PAUSE === "));
|
||||
fflush(stderr);
|
||||
do_pause();
|
||||
fprintf(stderr, " \r");
|
||||
fflush(stderr);
|
||||
|
|
|
@ -668,13 +668,10 @@ static unsigned char ump_sysex7_data(const unsigned int *ump,
|
|||
return (ump[offset / 4] >> ((3 - (offset & 3)) * 8)) & 0xff;
|
||||
}
|
||||
|
||||
static void dump_ump_sysex_event(const unsigned int *ump)
|
||||
static void dump_ump_sysex_status(const char *prefix, unsigned int status)
|
||||
{
|
||||
int i, length;
|
||||
|
||||
printf("Group %2d, ", group_number(snd_ump_msg_group(ump)));
|
||||
printf("SysEx ");
|
||||
switch (snd_ump_sysex_msg_status(ump)) {
|
||||
printf("%s ", prefix);
|
||||
switch (status) {
|
||||
case SND_UMP_SYSEX_STATUS_SINGLE:
|
||||
printf("Single ");
|
||||
break;
|
||||
|
@ -688,17 +685,49 @@ static void dump_ump_sysex_event(const unsigned int *ump)
|
|||
printf("End ");
|
||||
break;
|
||||
default:
|
||||
printf("Unknown(0x%x)", snd_ump_sysex_msg_status(ump));
|
||||
printf("(0x%04x)", status);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void dump_ump_sysex_event(const unsigned int *ump)
|
||||
{
|
||||
int i, length;
|
||||
|
||||
printf("Group %2d, ", group_number(snd_ump_msg_group(ump)));
|
||||
dump_ump_sysex_status("SysEx", snd_ump_sysex_msg_status(ump));
|
||||
length = snd_ump_sysex_msg_length(ump);
|
||||
printf(" length %d ", length);
|
||||
if (length > 14)
|
||||
length = 14;
|
||||
for (i = 0; i < length; i++)
|
||||
printf("%s%02x", i ? ":" : "", ump_sysex7_data(ump, i));
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
static unsigned char ump_sysex8_data(const unsigned int *ump,
|
||||
unsigned int offset)
|
||||
{
|
||||
offset += 3;
|
||||
return (ump[offset / 4] >> ((3 - (offset & 3)) * 8)) & 0xff;
|
||||
}
|
||||
|
||||
static void dump_ump_sysex8_event(const unsigned int *ump)
|
||||
{
|
||||
int i, length;
|
||||
|
||||
printf("Group %2d, ", group_number(snd_ump_msg_group(ump)));
|
||||
dump_ump_sysex_status("SysEx8", snd_ump_sysex_msg_status(ump));
|
||||
length = snd_ump_sysex_msg_length(ump);
|
||||
printf(" length %d ", length);
|
||||
printf(" stream %d ", (ump[0] >> 8) & 0xff);
|
||||
if (length > 13)
|
||||
length = 13;
|
||||
for (i = 0; i < length; i++)
|
||||
printf("%s%02x", i ? ":" : "", ump_sysex8_data(ump, i));
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
static void print_ump_string(const unsigned int *ump, unsigned int fmt,
|
||||
unsigned int offset, int maxlen)
|
||||
{
|
||||
|
@ -965,6 +994,9 @@ static void dump_ump_event(const snd_seq_ump_event_t *ev)
|
|||
case SND_UMP_MSG_TYPE_DATA:
|
||||
dump_ump_sysex_event(ev->ump);
|
||||
break;
|
||||
case SND_UMP_MSG_TYPE_EXTENDED_DATA:
|
||||
dump_ump_sysex8_event(ev->ump);
|
||||
break;
|
||||
case SND_UMP_MSG_TYPE_FLEX_DATA:
|
||||
dump_ump_flex_data_event(ev->ump);
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue