From c44e320aa415211603bc7cce036cd52d12ecb47a Mon Sep 17 00:00:00 2001 From: Erik de Castro Lopo Date: Wed, 17 Feb 2016 17:45:00 +1100 Subject: [PATCH 1/5] metro.c: Whitespace only --- metro.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/metro.c b/metro.c index 56578b6..dadc8a7 100644 --- a/metro.c +++ b/metro.c @@ -1,6 +1,6 @@ /* Copyright (C) 2002 Anthony Van Groningen - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or @@ -60,19 +60,19 @@ usage () } void -process_silence (jack_nframes_t nframes) +process_silence (jack_nframes_t nframes) { sample_t *buffer = (sample_t *) jack_port_get_buffer (output_port, nframes); memset (buffer, 0, sizeof (jack_default_audio_sample_t) * nframes); } void -process_audio (jack_nframes_t nframes) +process_audio (jack_nframes_t nframes) { sample_t *buffer = (sample_t *) jack_port_get_buffer (output_port, nframes); jack_nframes_t frames_left = nframes; - + while (wave_length - offset < frames_left) { memcpy (buffer + (nframes - frames_left), wave + offset, sizeof (sample_t) * (wave_length - offset)); frames_left -= wave_length - offset; @@ -111,7 +111,7 @@ sample_rate_change () { int main (int argc, char *argv[]) { - + sample_t scale; int i, attack_length, decay_length; double *amp; @@ -140,7 +140,7 @@ main (int argc, char *argv[]) {"verbose", 0, 0, 'v'}, {0, 0, 0, 0} }; - + while ((opt = getopt_long (argc, argv, options, long_options, &option_index)) != EOF) { switch (opt) { case 'f': @@ -192,7 +192,7 @@ main (int argc, char *argv[]) transport_aware = 1; break; default: - fprintf (stderr, "unknown option %c\n", opt); + fprintf (stderr, "unknown option %c\n", opt); case 'h': usage (); return -1; @@ -264,5 +264,5 @@ main (int argc, char *argv[]) while (1) { sleep(1); }; - + } From 1d02807267400e3f62457bf5a4e5762bc5d981d5 Mon Sep 17 00:00:00 2001 From: Erik de Castro Lopo Date: Wed, 17 Feb 2016 17:45:34 +1100 Subject: [PATCH 2/5] metro.c: Remove unused variable --- metro.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/metro.c b/metro.c index dadc8a7..74ae63d 100644 --- a/metro.c +++ b/metro.c @@ -122,7 +122,6 @@ main (int argc, char *argv[]) int attack_percent = 1, decay_percent = 10, dur_arg = 100; char *client_name = 0; char *bpm_string = "bpm"; - int verbose = 0; jack_status_t status; const char *options = "f:A:D:a:d:b:n:thv"; @@ -186,7 +185,6 @@ main (int argc, char *argv[]) strcpy (client_name, optarg); break; case 'v': - verbose = 1; break; case 't': transport_aware = 1; From 6fa59d35b813e9c916e2c7cdd67f93c44d6caa38 Mon Sep 17 00:00:00 2001 From: Erik de Castro Lopo Date: Fri, 19 Feb 2016 17:51:26 +1100 Subject: [PATCH 3/5] midiseq.c: Whitespace only --- midiseq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/midiseq.c b/midiseq.c index 4ebdfda..4e2deb6 100644 --- a/midiseq.c +++ b/midiseq.c @@ -1,6 +1,6 @@ /* Copyright (C) 2004 Ian Esten - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or From d2ac85ffd10d5aff164e18a94a8bf0a609124791 Mon Sep 17 00:00:00 2001 From: Erik de Castro Lopo Date: Fri, 19 Feb 2016 17:52:25 +1100 Subject: [PATCH 4/5] midiseq.c: Remove unused variable --- midiseq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/midiseq.c b/midiseq.c index 4e2deb6..e1c2c2b 100644 --- a/midiseq.c +++ b/midiseq.c @@ -85,7 +85,7 @@ static int process(jack_nframes_t nframes, void *arg) int main(int narg, char **args) { int i; - jack_nframes_t nframes; + if((narg<6) || ((narg-3)%3 !=0)) { usage(); @@ -98,7 +98,7 @@ int main(int narg, char **args) } jack_set_process_callback (client, process, 0); output_port = jack_port_register (client, "out", JACK_DEFAULT_MIDI_TYPE, JackPortIsOutput, 0); - nframes = jack_get_buffer_size(client); + loop_index = 0; num_notes = (narg - 3)/3; note_frqs = malloc(num_notes*sizeof(unsigned char)); From d7c4cab48e38448ff2747c8d360884ce47772ed2 Mon Sep 17 00:00:00 2001 From: Erik de Castro Lopo Date: Fri, 19 Feb 2016 17:58:31 +1100 Subject: [PATCH 5/5] simple_client.c: Exit on error --- simple_client.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/simple_client.c b/simple_client.c index 79ca4fa..e40356a 100644 --- a/simple_client.c +++ b/simple_client.c @@ -133,6 +133,7 @@ main (int argc, char *argv[]) if (jack_connect (client, ports[0], jack_port_name (input_port))) { fprintf (stderr, "cannot connect input ports\n"); + exit (1); } free (ports); @@ -160,5 +161,5 @@ main (int argc, char *argv[]) */ jack_client_close (client); - exit (0); + return 0; }