mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-11-12 23:35:41 +01:00
aplaymidi2: Add --silent option
For suppressing the messages, add -s / --silent option. Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
99ce4b1d8a
commit
b1269eefdd
2 changed files with 17 additions and 5 deletions
|
@ -44,8 +44,9 @@ environment variable if none is given on the command line.
|
||||||
.B aplaymidi2
|
.B aplaymidi2
|
||||||
supports only basic UMP events: in addition to the standard MIDI1 and
|
supports only basic UMP events: in addition to the standard MIDI1 and
|
||||||
MIDI2 CVMs and 7bit SysEx, only the following are supported:
|
MIDI2 CVMs and 7bit SysEx, only the following are supported:
|
||||||
DCTPQ, DC, Set Tempo, Start Clip and End Clip.
|
DCTPQ, DC, Set Tempo, Start Clip, End Clip.
|
||||||
Lyrics and other meta data in Flex Data are skipped, so far.
|
Lyrics and other meta data in Flex Data are printed, too, unless
|
||||||
|
\fI\-s\fP option is given.
|
||||||
|
|
||||||
The multiple output ports are useful when the given MIDI Clip file
|
The multiple output ports are useful when the given MIDI Clip file
|
||||||
contains the UMP packets for multiple Groups.
|
contains the UMP packets for multiple Groups.
|
||||||
|
@ -62,6 +63,10 @@ Specifies how long to wait after the end of each MIDI Clip file,
|
||||||
to allow the last notes to die away.
|
to allow the last notes to die away.
|
||||||
Default is 2 seconds.
|
Default is 2 seconds.
|
||||||
|
|
||||||
|
.TP
|
||||||
|
.I \-s, \-\-silent
|
||||||
|
Don't show message texts.
|
||||||
|
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
pmidi(1)
|
pmidi(1)
|
||||||
.br
|
.br
|
||||||
|
|
|
@ -20,6 +20,7 @@ static int port_count;
|
||||||
static snd_seq_addr_t ports[16];
|
static snd_seq_addr_t ports[16];
|
||||||
static int queue;
|
static int queue;
|
||||||
static int end_delay = 2;
|
static int end_delay = 2;
|
||||||
|
static int silent;
|
||||||
|
|
||||||
static unsigned int _current_tempo = 50000000; /* default 120 bpm */
|
static unsigned int _current_tempo = 50000000; /* default 120 bpm */
|
||||||
static unsigned int tempo_base = 10;
|
static unsigned int tempo_base = 10;
|
||||||
|
@ -432,6 +433,7 @@ static void play_midi(FILE *file)
|
||||||
|
|
||||||
if (fh->meta.status_bank == SND_UMP_FLEX_DATA_MSG_BANK_METADATA ||
|
if (fh->meta.status_bank == SND_UMP_FLEX_DATA_MSG_BANK_METADATA ||
|
||||||
fh->meta.status_bank == SND_UMP_FLEX_DATA_MSG_BANK_PERF_TEXT) {
|
fh->meta.status_bank == SND_UMP_FLEX_DATA_MSG_BANK_PERF_TEXT) {
|
||||||
|
if (!silent)
|
||||||
show_text(ump);
|
show_text(ump);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -493,7 +495,8 @@ static void usage(const char *argv0)
|
||||||
"-h, --help this help\n"
|
"-h, --help this help\n"
|
||||||
"-V, --version print current version\n"
|
"-V, --version print current version\n"
|
||||||
"-p, --port=client:port,... set port(s) to play to\n"
|
"-p, --port=client:port,... set port(s) to play to\n"
|
||||||
"-d, --delay=seconds delay after song ends\n",
|
"-d, --delay=seconds delay after song ends\n"
|
||||||
|
"-s, --silent don't show texts\n",
|
||||||
argv0);
|
argv0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -509,13 +512,14 @@ int main(int argc, char *argv[])
|
||||||
{"version", 0, NULL, 'V'},
|
{"version", 0, NULL, 'V'},
|
||||||
{"port", 1, NULL, 'p'},
|
{"port", 1, NULL, 'p'},
|
||||||
{"delay", 1, NULL, 'd'},
|
{"delay", 1, NULL, 'd'},
|
||||||
|
{"silent", 1, NULL, 's'},
|
||||||
{0}
|
{0}
|
||||||
};
|
};
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
init_seq();
|
init_seq();
|
||||||
|
|
||||||
while ((c = getopt_long(argc, argv, "hVp:d:",
|
while ((c = getopt_long(argc, argv, "hVp:d:s",
|
||||||
long_options, NULL)) != -1) {
|
long_options, NULL)) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'h':
|
case 'h':
|
||||||
|
@ -530,6 +534,9 @@ int main(int argc, char *argv[])
|
||||||
case 'd':
|
case 'd':
|
||||||
end_delay = atoi(optarg);
|
end_delay = atoi(optarg);
|
||||||
break;
|
break;
|
||||||
|
case 's':
|
||||||
|
silent = 1;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
usage(argv[0]);
|
usage(argv[0]);
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Loading…
Reference in a new issue