]> git.alsa-project.org Git - alsa-utils.git/commitdiff
aplaymidi2: Add --silent option
authorTakashi Iwai <tiwai@suse.de>
Tue, 9 Jul 2024 05:46:09 +0000 (07:46 +0200)
committerTakashi Iwai <tiwai@suse.de>
Tue, 9 Jul 2024 05:48:05 +0000 (07:48 +0200)
For suppressing the messages, add -s / --silent option.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
seq/aplaymidi2/aplaymidi2.1
seq/aplaymidi2/aplaymidi2.c

index 99be608f107de2dfbf1980af8d57b069ac97c7b5..fc85943c0d389a5b3870007a4e2ebc195f038da8 100644 (file)
@@ -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
index 64e8aaa5922475c492381d2a857aa11c8f39effb..cd500bf74099ee5736bcefb7b910bc7a5500b188 100644 (file)
@@ -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;