mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-11-14 04:55:41 +01:00
Clemens Ladisch <clemens@ladisch.de>:
- This adds an option to amidi not to ignore active sensing bytes.
This commit is contained in:
parent
2ac2af4dfb
commit
e24a1cb4f9
2 changed files with 21 additions and 6 deletions
|
@ -1,4 +1,4 @@
|
||||||
.TH AMIDI 1 "27 Oct 2003"
|
.TH AMIDI 1 "18 Jan 2004"
|
||||||
|
|
||||||
.SH NAME
|
.SH NAME
|
||||||
amidi \- read from and write to ALSA RawMIDI ports
|
amidi \- read from and write to ALSA RawMIDI ports
|
||||||
|
@ -81,7 +81,9 @@ this will
|
||||||
create a Standard MIDI (.mid) file.
|
create a Standard MIDI (.mid) file.
|
||||||
|
|
||||||
.B amidi
|
.B amidi
|
||||||
will filter out any Active Sensing bytes (FEh).
|
will filter out any Active Sensing bytes (FEh), unless the
|
||||||
|
.I -a
|
||||||
|
option has been given.
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.I -S, --send-hex="..."
|
.I -S, --send-hex="..."
|
||||||
|
@ -90,7 +92,9 @@ Sends the bytes specified as hexadecimal numbers to the MIDI port.
|
||||||
.TP
|
.TP
|
||||||
.I -d, --dump
|
.I -d, --dump
|
||||||
Prints data received from the MIDI port as hexadecimal bytes.
|
Prints data received from the MIDI port as hexadecimal bytes.
|
||||||
Active Sensing bytes (FEh) will not be shown.
|
Active Sensing bytes (FEh) will not be shown, unless the
|
||||||
|
.I -a
|
||||||
|
option has been given.
|
||||||
|
|
||||||
This option is useful for debugging.
|
This option is useful for debugging.
|
||||||
|
|
||||||
|
@ -103,6 +107,11 @@ If this option has not been given, you must press Ctrl+C (or kill
|
||||||
.B amidi\fR)
|
.B amidi\fR)
|
||||||
to stop receiving data.
|
to stop receiving data.
|
||||||
|
|
||||||
|
.TP
|
||||||
|
.I -a, --active-sensing
|
||||||
|
Does not ignore Active Sensing bytes (FEh) when saving or printing
|
||||||
|
received MIDI commands.
|
||||||
|
|
||||||
.SH EXAMPLES
|
.SH EXAMPLES
|
||||||
|
|
||||||
.SS
|
.SS
|
||||||
|
|
|
@ -76,7 +76,8 @@ static void usage(void)
|
||||||
"-S, --send-hex=\"...\" send hexadecimal bytes\n"
|
"-S, --send-hex=\"...\" send hexadecimal bytes\n"
|
||||||
"-d, --dump print received data as hexadecimal bytes\n"
|
"-d, --dump print received data as hexadecimal bytes\n"
|
||||||
"-t, --timeout=seconds exits when no data has been received\n"
|
"-t, --timeout=seconds exits when no data has been received\n"
|
||||||
" for the specified duration\n");
|
" for the specified duration\n"
|
||||||
|
"-a, --active-sensing don't ignore active sensing bytes\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void version(void)
|
static void version(void)
|
||||||
|
@ -371,7 +372,7 @@ static void sig_handler(int dummy)
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
static char short_options[] = "hVlLp:s:r:S:dt:";
|
static char short_options[] = "hVlLp:s:r:S:dt:a";
|
||||||
static struct option long_options[] = {
|
static struct option long_options[] = {
|
||||||
{"help", 0, NULL, 'h'},
|
{"help", 0, NULL, 'h'},
|
||||||
{"version", 0, NULL, 'V'},
|
{"version", 0, NULL, 'V'},
|
||||||
|
@ -383,9 +384,11 @@ int main(int argc, char *argv[])
|
||||||
{"send-hex", 1, NULL, 'S'},
|
{"send-hex", 1, NULL, 'S'},
|
||||||
{"dump", 0, NULL, 'd'},
|
{"dump", 0, NULL, 'd'},
|
||||||
{"timeout", 1, NULL, 't'},
|
{"timeout", 1, NULL, 't'},
|
||||||
|
{"active-sensing", 0, NULL, 'a'},
|
||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
int c, err, ok = 0;
|
int c, err, ok = 0;
|
||||||
|
int ignore_active_sensing = 1;
|
||||||
|
|
||||||
while ((c = getopt_long(argc, argv, short_options,
|
while ((c = getopt_long(argc, argv, short_options,
|
||||||
long_options, NULL)) != -1) {
|
long_options, NULL)) != -1) {
|
||||||
|
@ -420,6 +423,9 @@ int main(int argc, char *argv[])
|
||||||
case 't':
|
case 't':
|
||||||
timeout = atoi(optarg);
|
timeout = atoi(optarg);
|
||||||
break;
|
break;
|
||||||
|
case 'a':
|
||||||
|
ignore_active_sensing = 0;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
error("Try `amidi --help' for more information.");
|
error("Try `amidi --help' for more information.");
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -528,7 +534,7 @@ int main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
length = 0;
|
length = 0;
|
||||||
for (i = 0; i < err; ++i)
|
for (i = 0; i < err; ++i)
|
||||||
if (buf[i] != 0xfe) /* drop any active sensing bytes */
|
if (!ignore_active_sensing || buf[i] != 0xfe)
|
||||||
buf[length++] = buf[i];
|
buf[length++] = buf[i];
|
||||||
if (length == 0)
|
if (length == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in a new issue