From b1269eefdd13b47eb27cd89ef60666ee86012821 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Tue, 9 Jul 2024 07:46:09 +0200 Subject: [PATCH] aplaymidi2: Add --silent option For suppressing the messages, add -s / --silent option. Signed-off-by: Takashi Iwai --- seq/aplaymidi2/aplaymidi2.1 | 9 +++++++-- seq/aplaymidi2/aplaymidi2.c | 13 ++++++++++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/seq/aplaymidi2/aplaymidi2.1 b/seq/aplaymidi2/aplaymidi2.1 index 99be608..fc85943 100644 --- a/seq/aplaymidi2/aplaymidi2.1 +++ b/seq/aplaymidi2/aplaymidi2.1 @@ -44,8 +44,9 @@ environment variable if none is given on the command line. .B aplaymidi2 supports only basic UMP events: in addition to the standard MIDI1 and MIDI2 CVMs and 7bit SysEx, only the following are supported: -DCTPQ, DC, Set Tempo, Start Clip and End Clip. -Lyrics and other meta data in Flex Data are skipped, so far. +DCTPQ, DC, Set Tempo, Start Clip, End Clip. +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 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. Default is 2 seconds. +.TP +.I \-s, \-\-silent +Don't show message texts. + .SH SEE ALSO pmidi(1) .br diff --git a/seq/aplaymidi2/aplaymidi2.c b/seq/aplaymidi2/aplaymidi2.c index 64e8aaa..cd500bf 100644 --- a/seq/aplaymidi2/aplaymidi2.c +++ b/seq/aplaymidi2/aplaymidi2.c @@ -20,6 +20,7 @@ static int port_count; static snd_seq_addr_t ports[16]; static int queue; static int end_delay = 2; +static int silent; static unsigned int _current_tempo = 50000000; /* default 120 bpm */ static unsigned int tempo_base = 10; @@ -432,7 +433,8 @@ static void play_midi(FILE *file) if (fh->meta.status_bank == SND_UMP_FLEX_DATA_MSG_BANK_METADATA || fh->meta.status_bank == SND_UMP_FLEX_DATA_MSG_BANK_PERF_TEXT) { - show_text(ump); + if (!silent) + show_text(ump); continue; } } else if (h->type == SND_UMP_MSG_TYPE_STREAM) { @@ -493,7 +495,8 @@ static void usage(const char *argv0) "-h, --help this help\n" "-V, --version print current version\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); } @@ -509,13 +512,14 @@ int main(int argc, char *argv[]) {"version", 0, NULL, 'V'}, {"port", 1, NULL, 'p'}, {"delay", 1, NULL, 'd'}, + {"silent", 1, NULL, 's'}, {0} }; int c; init_seq(); - while ((c = getopt_long(argc, argv, "hVp:d:", + while ((c = getopt_long(argc, argv, "hVp:d:s", long_options, NULL)) != -1) { switch (c) { case 'h': @@ -530,6 +534,9 @@ int main(int argc, char *argv[]) case 'd': end_delay = atoi(optarg); break; + case 's': + silent = 1; + break; default: usage(argv[0]); return 1;