summaryrefslogtreecommitdiff
path: root/example-clients
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2013-12-31 13:56:46 +0100
committerAdrian Knoth <adi@drcomp.erfurt.thur.de>2014-01-02 23:17:37 +0100
commitae6412a8816bd56083dc8b9b5edda2d95615b67a (patch)
tree434223de04122adfba50f838c8cfe806265f51f8 /example-clients
parent0e23c197bf4756b26a1b8853dbcf7a365405dc8f (diff)
downloadjack2-ae6412a8816bd56083dc8b9b5edda2d95615b67a.tar.gz
add usage() to jack_midi_dump
Signed-off-by: Robin Gareus <robin@gareus.org>
Diffstat (limited to 'example-clients')
-rw-r--r--example-clients/midi_dump.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/example-clients/midi_dump.c b/example-clients/midi_dump.c
index 092af99d..451c8262 100644
--- a/example-clients/midi_dump.c
+++ b/example-clients/midi_dump.c
@@ -101,6 +101,28 @@ static void wearedone(int sig) {
keeprunning = 0;
}
+static void usage (int status) {
+ printf ("jack_midi_dump - JACK MIDI Monitor.\n\n");
+ printf ("Usage: jack_midi_dump [ OPTIONS ] [CLIENT-NAME]\n\n");
+ printf ("Options:\n\
+ -a use absoute timestamps relative to application start\n\
+ -h display this help and exit\n\
+ -r use relative timestamps to previous MIDI event\n\
+\n");
+ printf ("\n\
+This tool listens for MIDI events on a JACK MIDI port and prints\n\
+the message to stdout.\n\
+\n\
+Note that this tool is not realtime-safe. The events are printed\n\
+directly from the process() callback!\n\
+\n\
+If no client name is given it defaults to 'midi-monitor'.\n\
+\n\
+See also: jackd(1)\n\
+\n");
+ exit (status);
+}
+
int
main (int argc, char* argv[])
{
@@ -112,8 +134,10 @@ main (int argc, char* argv[])
int cn = 1;
if (argc > 1) {
- if (!strcmp(argv[1], "-a")) { time_format = 1; cn = 2; }
- if (!strcmp(argv[1], "-r")) { time_format = 2; cn = 2; }
+ if (!strcmp (argv[1], "-a")) { time_format = 1; cn = 2; }
+ else if (!strcmp (argv[1], "-r")) { time_format = 2; cn = 2; }
+ else if (!strcmp (argv[1], "-h")) { usage (EXIT_SUCCESS); }
+ else if (argv[1][0] == '-') { usage (EXIT_FAILURE); }
}
if (argc > cn) {