CVS commit: src/usr.bin/midiplay
Module Name:src Committed By: mrg Date: Fri Feb 1 08:37:21 UTC 2019 Modified Files: src/usr.bin/midiplay: midiplay.c Log Message: make a fallthru comment GCC7 compatible. To generate a diff of this commit: cvs rdiff -u -r1.32 -r1.33 src/usr.bin/midiplay/midiplay.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/midiplay/midiplay.c diff -u src/usr.bin/midiplay/midiplay.c:1.32 src/usr.bin/midiplay/midiplay.c:1.33 --- src/usr.bin/midiplay/midiplay.c:1.32 Thu May 3 05:14:55 2018 +++ src/usr.bin/midiplay/midiplay.c Fri Feb 1 08:37:21 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: midiplay.c,v 1.32 2018/05/03 05:14:55 wiz Exp $ */ +/* $NetBSD: midiplay.c,v 1.33 2019/02/01 08:37:21 mrg Exp $ */ /* * Copyright (c) 1998, 2002 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include #ifndef lint -__RCSID("$NetBSD: midiplay.c,v 1.32 2018/05/03 05:14:55 wiz Exp $"); +__RCSID("$NetBSD: midiplay.c,v 1.33 2019/02/01 08:37:21 mrg Exp $"); #endif @@ -677,7 +677,8 @@ playdata(u_char *buf, u_int tot, const c } break; } -/* Sorry, can't do this yet; FALLTHROUGH */ +/* Sorry, can't do this yet */ +/* FALLTHROUGH */ default: if (verbose) printf("MIDI event 0x%02x ignored\n",
CVS commit: src/usr.bin/midiplay
Module Name:src Committed By: wiz Date: Thu May 3 05:14:55 UTC 2018 Modified Files: src/usr.bin/midiplay: midiplay.c Log Message: Sync usage with manpage. To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 src/usr.bin/midiplay/midiplay.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/midiplay/midiplay.c diff -u src/usr.bin/midiplay/midiplay.c:1.31 src/usr.bin/midiplay/midiplay.c:1.32 --- src/usr.bin/midiplay/midiplay.c:1.31 Thu May 3 01:12:57 2018 +++ src/usr.bin/midiplay/midiplay.c Thu May 3 05:14:55 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: midiplay.c,v 1.31 2018/05/03 01:12:57 mrg Exp $ */ +/* $NetBSD: midiplay.c,v 1.32 2018/05/03 05:14:55 wiz Exp $ */ /* * Copyright (c) 1998, 2002 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include #ifndef lint -__RCSID("$NetBSD: midiplay.c,v 1.31 2018/05/03 01:12:57 mrg Exp $"); +__RCSID("$NetBSD: midiplay.c,v 1.32 2018/05/03 05:14:55 wiz Exp $"); #endif @@ -155,8 +155,8 @@ static u_char silence_sample[] = { static void __attribute__((__noreturn__)) usage(void) { - fprintf(stderr, "usage: %s [-d unit] [-f file] [-l] [-m] [-p pgm] [-q] " - "[-t %%tempo] [-v] [-x] [-s] [file ...]\n", + fprintf(stderr, "usage: %s [-lmqsvx] [-d devno] [-f file] " + "[-p pgm] [-t tempo] [file ...]\n", getprogname()); exit(1); }
CVS commit: src/usr.bin/midiplay
Module Name:src Committed By: wiz Date: Thu May 3 05:13:20 UTC 2018 Modified Files: src/usr.bin/midiplay: midiplay.1 Log Message: Merge options without arguments in synopsis. To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/usr.bin/midiplay/midiplay.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/midiplay/midiplay.1 diff -u src/usr.bin/midiplay/midiplay.1:1.20 src/usr.bin/midiplay/midiplay.1:1.21 --- src/usr.bin/midiplay/midiplay.1:1.20 Thu May 3 01:12:57 2018 +++ src/usr.bin/midiplay/midiplay.1 Thu May 3 05:13:20 2018 @@ -1,4 +1,4 @@ -.\" $NetBSD: midiplay.1,v 1.20 2018/05/03 01:12:57 mrg Exp $ +.\" $NetBSD: midiplay.1,v 1.21 2018/05/03 05:13:20 wiz Exp $ .\" .\" Copyright (c) 1998 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -34,16 +34,11 @@ .Nd play MIDI and RMID files .Sh SYNOPSIS .Nm +.Op Fl lmqsvx .Op Fl d Ar devno .Op Fl f Ar file -.Op Fl l -.Op Fl m .Op Fl p Ar pgm -.Op Fl q -.Op Fl s .Op Fl t Ar tempo -.Op Fl v -.Op Fl x .Op Ar file ... .Sh DESCRIPTION The
CVS commit: src/usr.bin/midiplay
Module Name:src Committed By: mrg Date: Thu May 3 01:12:57 UTC 2018 Modified Files: src/usr.bin/midiplay: midiplay.1 midiplay.c Log Message: if just parsing don't try to read the uninitialised device name, or display the unit number. add a "-s" option that sends an ALL_SOUNDS_OFF midi event. very useful after an interrupted midiplay leaves notes on. To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/usr.bin/midiplay/midiplay.1 cvs rdiff -u -r1.30 -r1.31 src/usr.bin/midiplay/midiplay.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/midiplay/midiplay.1 diff -u src/usr.bin/midiplay/midiplay.1:1.19 src/usr.bin/midiplay/midiplay.1:1.20 --- src/usr.bin/midiplay/midiplay.1:1.19 Sat Jan 16 08:50:29 2010 +++ src/usr.bin/midiplay/midiplay.1 Thu May 3 01:12:57 2018 @@ -1,4 +1,5 @@ -.\" $NetBSD: midiplay.1,v 1.19 2010/01/16 08:50:29 mbalmer Exp $ +.\" $NetBSD: midiplay.1,v 1.20 2018/05/03 01:12:57 mrg Exp $ +.\" .\" Copyright (c) 1998 The NetBSD Foundation, Inc. .\" All rights reserved. .\" @@ -25,7 +26,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd January 16, 2010 +.Dd May 2, 2018 .Dt MIDIPLAY 1 .Os .Sh NAME @@ -39,6 +40,7 @@ .Op Fl m .Op Fl p Ar pgm .Op Fl q +.Op Fl s .Op Fl t Ar tempo .Op Fl v .Op Fl x @@ -86,6 +88,11 @@ There is no way at present to have selectively map channels or instruments. .It Fl q specifies that the MIDI file should not be played, just parsed. +.It Fl s +send an +.Dq ALL SOUNDS OFF +MIDI event. +Useful if an interrupted MIDI file left notes playing. .It Fl t Ar tempo-adjust specifies an adjustment (in percent) to the tempi recorded in the file. The default of 100 plays as specified in the file, 50 halves every tempo, @@ -123,3 +130,8 @@ It may take a long while before playing .Nm is interrupted, as the data already buffered in the sequencer will contain timing events. +Use +.Nm +with the +.Fl s +option to silence any sounds left after an interrupted call. Index: src/usr.bin/midiplay/midiplay.c diff -u src/usr.bin/midiplay/midiplay.c:1.30 src/usr.bin/midiplay/midiplay.c:1.31 --- src/usr.bin/midiplay/midiplay.c:1.30 Sun Mar 22 22:47:43 2015 +++ src/usr.bin/midiplay/midiplay.c Thu May 3 01:12:57 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: midiplay.c,v 1.30 2015/03/22 22:47:43 mrg Exp $ */ +/* $NetBSD: midiplay.c,v 1.31 2018/05/03 01:12:57 mrg Exp $ */ /* * Copyright (c) 1998, 2002 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include #ifndef lint -__RCSID("$NetBSD: midiplay.c,v 1.30 2015/03/22 22:47:43 mrg Exp $"); +__RCSID("$NetBSD: midiplay.c,v 1.31 2018/05/03 01:12:57 mrg Exp $"); #endif @@ -128,6 +128,13 @@ static u_char sample[] = { #undef E #undef F +static u_char silence_sample[] = { + 'M', 'T', 'h', 'd', 0, 0, 0, 6, 0, 1, 0, 1, 0, 8, + 'M', 'T', 'r', 'k', 0, 0, 0, 8, + 0, 0xb0, 0x78, 0x00, + 0, 0xff, 0x2f, 0 +}; + #define MARK_HEADER "MThd" #define MARK_TRACK "MTrk" #define MARK_LEN 4 @@ -149,7 +156,7 @@ static void __attribute__((__noreturn__) usage(void) { fprintf(stderr, "usage: %s [-d unit] [-f file] [-l] [-m] [-p pgm] [-q] " - "[-t %%tempo] [-v] [-x] [file ...]\n", + "[-t %%tempo] [-v] [-x] [-s] [file ...]\n", getprogname()); exit(1); } @@ -408,9 +415,12 @@ playdata(u_char *buf, u_int tot, const c err(1, "ioctl(SEQUENCER_INFO) failed"); end = buf + tot; - if (verbose) - printf("Playing %s (%d bytes) on %s (unit %d)... \n", - name, tot, info.name, info.device); + if (verbose) { + printf("Playing %s (%d bytes)", name, tot); + if (play) + printf(" on %s (unit %d)...", info.name, info.device); + puts("\n"); + } if (tot < MARK_LEN + 4) { warnx("Not a MIDI file, too short"); @@ -716,6 +726,7 @@ main(int argc, char **argv) int ch; int listdevs = 0; int example = 0; + int silence = 0; int nmidi; const char *file = DEVMUSIC; const char *sunit; @@ -725,7 +736,7 @@ main(int argc, char **argv) if ((sunit = getenv("MIDIUNIT"))) unit = parse_unit(sunit); - while ((ch = getopt(argc, argv, "?d:f:lmp:qt:vx")) != -1) { + while ((ch = getopt(argc, argv, "?d:f:lmp:qst:vx")) != -1) { switch(ch) { case 'd': unit = parse_unit(optarg); @@ -745,6 +756,9 @@ main(int argc, char **argv) case 'q': play = 0; break; + case 's': + silence++; + break; case 't': ttempo = atoi(optarg); break; @@ -785,6 +799,10 @@ main(int argc, char **argv) if (example) while (example--) playdata(sample, sizeof sample, ""); + else if (silence) + while (silence--) + playdata(silence_sample, sizeof silence_sample, + ""); else if (argc == 0) playfile(stdin, ""); else
CVS commit: src/usr.bin/midiplay
Module Name:src Committed By: mrg Date: Sun Mar 22 22:47:43 UTC 2015 Modified Files: src/usr.bin/midiplay: midiplay.c Log Message: if not playing (-q mode), don't call ioctl() or try to use the results. now -q mode works. To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.30 src/usr.bin/midiplay/midiplay.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/midiplay/midiplay.c diff -u src/usr.bin/midiplay/midiplay.c:1.29 src/usr.bin/midiplay/midiplay.c:1.30 --- src/usr.bin/midiplay/midiplay.c:1.29 Fri Nov 25 01:39:47 2011 +++ src/usr.bin/midiplay/midiplay.c Sun Mar 22 22:47:43 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: midiplay.c,v 1.29 2011/11/25 01:39:47 jmcneill Exp $ */ +/* $NetBSD: midiplay.c,v 1.30 2015/03/22 22:47:43 mrg Exp $ */ /* * Copyright (c) 1998, 2002 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include sys/cdefs.h #ifndef lint -__RCSID($NetBSD: midiplay.c,v 1.29 2011/11/25 01:39:47 jmcneill Exp $); +__RCSID($NetBSD: midiplay.c,v 1.30 2015/03/22 22:47:43 mrg Exp $); #endif @@ -404,7 +404,7 @@ playdata(u_char *buf, u_int tot, const c /* verify that the requested midi unit exists */ info.device = unit; - if (ioctl(fd, SEQUENCER_INFO, info) 0) + if (play ioctl(fd, SEQUENCER_INFO, info) 0) err(1, ioctl(SEQUENCER_INFO) failed); end = buf + tot; @@ -488,7 +488,9 @@ playdata(u_char *buf, u_int tot, const c * in some cases by frobbing tempo and timebase more obscurely, but this * player is meant to be simple and clear. */ - if ((divfmt 0x80) == 0) { + if (!play) + /* do nothing */; + else if ((divfmt 0x80) == 0) { ticks |= divfmt 8; if (ioctl(fd, SEQUENCER_TMR_TIMEBASE, (int){ticks}) 0) err(1, SEQUENCER_TMR_TIMEBASE); @@ -681,7 +683,7 @@ playdata(u_char *buf, u_int tot, const c tp-delta = getvar(tp); Heapify(tracks, ntrks, 0); } - if (ioctl(fd, SEQUENCER_SYNC, 0) 0) + if (play ioctl(fd, SEQUENCER_SYNC, 0) 0) err(1, SEQUENCER_SYNC); ret:
CVS commit: src/usr.bin/midiplay
Module Name:src Committed By: jmcneill Date: Fri Nov 25 01:39:48 UTC 2011 Modified Files: src/usr.bin/midiplay: midiplay.c Log Message: - accept midi0 as an alias for 0 to the -d flag - verify that the requested unit exists before playing - if the verbose flag is set, print the selected device name and unit # To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/usr.bin/midiplay/midiplay.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/midiplay/midiplay.c diff -u src/usr.bin/midiplay/midiplay.c:1.28 src/usr.bin/midiplay/midiplay.c:1.29 --- src/usr.bin/midiplay/midiplay.c:1.28 Sun Aug 14 13:26:23 2011 +++ src/usr.bin/midiplay/midiplay.c Fri Nov 25 01:39:47 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: midiplay.c,v 1.28 2011/08/14 13:26:23 christos Exp $ */ +/* $NetBSD: midiplay.c,v 1.29 2011/11/25 01:39:47 jmcneill Exp $ */ /* * Copyright (c) 1998, 2002 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include sys/cdefs.h #ifndef lint -__RCSID($NetBSD: midiplay.c,v 1.28 2011/08/14 13:26:23 christos Exp $); +__RCSID($NetBSD: midiplay.c,v 1.29 2011/11/25 01:39:47 jmcneill Exp $); #endif @@ -39,6 +39,8 @@ __RCSID($NetBSD: midiplay.c,v 1.28 2011 #include stdlib.h #include fcntl.h #include err.h +#include errno.h +#include limits.h #include unistd.h #include string.h #include sys/types.h @@ -396,12 +398,19 @@ playdata(u_char *buf, u_int tot, const c int format, ntrks, divfmt, ticks, t; u_int len, mlen, status, chan; u_char *p, *end, byte, meta, *msg; + struct synth_info info; struct track *tracks; struct track *tp; + /* verify that the requested midi unit exists */ + info.device = unit; + if (ioctl(fd, SEQUENCER_INFO, info) 0) + err(1, ioctl(SEQUENCER_INFO) failed); + end = buf + tot; if (verbose) - printf(Playing %s (%d bytes) ... \n, name, tot); + printf(Playing %s (%d bytes) on %s (unit %d)... \n, + name, tot, info.name, info.device); if (tot MARK_LEN + 4) { warnx(Not a MIDI file, too short); @@ -679,6 +688,26 @@ playdata(u_char *buf, u_int tot, const c free(tracks); } +static int +parse_unit(const char *sunit) +{ + const char *osunit = sunit; + long n; + char *ep; + + if (strncmp(sunit, midi, strlen(midi)) == 0) + sunit += strlen(midi); + + errno = 0; + n = strtol(sunit, ep, 10); + if (n 0 || n INT_MAX || *ep != '\0' || + (errno == ERANGE + (n == LONG_MAX || n == LONG_MIN))) + errx(1, bad midi unit -- %s, osunit); + + return (int)n; +} + int main(int argc, char **argv) { @@ -692,12 +721,12 @@ main(int argc, char **argv) FILE *f; if ((sunit = getenv(MIDIUNIT))) - unit = atoi(sunit); + unit = parse_unit(sunit); while ((ch = getopt(argc, argv, ?d:f:lmp:qt:vx)) != -1) { switch(ch) { case 'd': - unit = atoi(optarg); + unit = parse_unit(optarg); break; case 'f': file = optarg;
CVS commit: src/usr.bin/midiplay
Module Name:src Committed By: joerg Date: Wed Aug 17 22:16:42 UTC 2011 Modified Files: src/usr.bin/midiplay: Makefile Log Message: Fix disable stricter format string messages with clang again. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/usr.bin/midiplay/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/midiplay/Makefile diff -u src/usr.bin/midiplay/Makefile:1.5 src/usr.bin/midiplay/Makefile:1.6 --- src/usr.bin/midiplay/Makefile:1.5 Sun Aug 14 13:26:23 2011 +++ src/usr.bin/midiplay/Makefile Wed Aug 17 22:16:42 2011 @@ -1,6 +1,7 @@ -# $NetBSD: Makefile,v 1.5 2011/08/14 13:26:23 christos Exp $ +# $NetBSD: Makefile,v 1.6 2011/08/17 22:16:42 joerg Exp $ # @(#)Makefile 8.1 (Berkeley) 6/6/93 PROG= midiplay +CWARNFLAGS.clang+= -Wno-format-extra-args .include bsd.prog.mk
CVS commit: src/usr.bin/midiplay
Module Name:src Committed By: christos Date: Sun Aug 14 13:26:23 UTC 2011 Modified Files: src/usr.bin/midiplay: Makefile midiplay.c Log Message: - add a SYSEX0 macro that does not override the initializers and use it - fix whitespace - make things static and eliminate unused functions To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/usr.bin/midiplay/Makefile cvs rdiff -u -r1.27 -r1.28 src/usr.bin/midiplay/midiplay.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/midiplay/Makefile diff -u src/usr.bin/midiplay/Makefile:1.4 src/usr.bin/midiplay/Makefile:1.5 --- src/usr.bin/midiplay/Makefile:1.4 Tue Jun 21 22:49:44 2011 +++ src/usr.bin/midiplay/Makefile Sun Aug 14 09:26:23 2011 @@ -1,13 +1,6 @@ -# $NetBSD: Makefile,v 1.4 2011/06/22 02:49:44 mrg Exp $ +# $NetBSD: Makefile,v 1.5 2011/08/14 13:26:23 christos Exp $ # @(#)Makefile 8.1 (Berkeley) 6/6/93 PROG= midiplay -CWARNFLAGS.clang+= -Wno-format-extra-args -Wno-initializer-overrides - .include bsd.prog.mk - -# XXX -.if ${HAVE_GCC} == 45 -COPTS.midiplay.c+= -Wno-error -.endif Index: src/usr.bin/midiplay/midiplay.c diff -u src/usr.bin/midiplay/midiplay.c:1.27 src/usr.bin/midiplay/midiplay.c:1.28 --- src/usr.bin/midiplay/midiplay.c:1.27 Sun Apr 12 10:15:08 2009 +++ src/usr.bin/midiplay/midiplay.c Sun Aug 14 09:26:23 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: midiplay.c,v 1.27 2009/04/12 14:15:08 lukem Exp $ */ +/* $NetBSD: midiplay.c,v 1.28 2011/08/14 13:26:23 christos Exp $ */ /* * Copyright (c) 1998, 2002 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include sys/cdefs.h #ifndef lint -__RCSID($NetBSD: midiplay.c,v 1.27 2009/04/12 14:15:08 lukem Exp $); +__RCSID($NetBSD: midiplay.c,v 1.28 2011/08/14 13:26:23 christos Exp $); #endif @@ -72,45 +72,50 @@ #define META_SMPTE 0x54 #define META_TIMESIGN 0x58 -const char *metanames[] = { - , Text, Copyright, Track, Instrument, +static const char *metanames[] = { + , Text, Copyright, Track, Instrument, Lyric, Marker, Cue, }; -static int midi_lengths[] = { 2,2,2,2,1,1,2,0 }; +static int midi_lengths[] = { 2, 2, 2, 2, 1, 1, 2, 0 }; /* Number of bytes in a MIDI command */ #define MIDI_LENGTH(d) (midi_lengths[((d) 4) 7]) -void usage(void); -void send_event(seq_event_t *); -void dometa(u_int, u_char *, u_int); -void midireset(void); -void send_sysex(u_char *, u_int); -u_long getvar(struct track *); -u_long getlen(struct track *); -void playfile(FILE *, const char *); -void playdata(u_char *, u_int, const char *); -int main(int argc, char **argv); - -void Heapify(struct track *, int, int); -void BuildHeap(struct track *, int); -int ShrinkHeap(struct track *, int); +#define SEQ_MK_SYSEX0(_dev,...) \ +SEQ_MK_EVENT(sysex, 0x94, .device=(_dev), .buffer={__VA_ARGS__}) + + +static void usage(void); +static void send_event(seq_event_t *); +static void dometa(u_int, u_char *, u_int); +#if 0 +static void midireset(void); +#endif +static void send_sysex(u_char *, u_int); +static u_long getvar(struct track *); +static u_long getlen(struct track *); +static void playfile(FILE *, const char *); +static void playdata(u_char *, u_int, const char *); + +static void Heapify(struct track *, int, int); +static void BuildHeap(struct track *, int); +static int ShrinkHeap(struct track *, int); /* * This sample plays at an apparent tempo of 120 bpm when the BASETEMPO is 150 * bpm, because the quavers are 5 divisions (4 on 1 off) rather than 4 total. */ -#define P(c) 1,0x90,c,0x7f,4,0x80,c,0 -#define PL(c) 1,0x90,c,0x7f,8,0x80,c,0 +#define P(c) 1, 0x90, c, 0x7f, 4, 0x80, c, 0 +#define PL(c) 1, 0x90, c, 0x7f, 8, 0x80, c, 0 #define C 0x3c #define D 0x3e #define E 0x40 #define F 0x41 -u_char sample[] = { - 'M','T','h','d', 0,0,0,6, 0,1, 0,1, 0,8, - 'M','T','r','k', 0,0,0,4+13*8, - P(C), P(C), P(C), P(E), P(D), P(D), P(D), +static u_char sample[] = { + 'M', 'T', 'h', 'd', 0, 0, 0, 6, 0, 1, 0, 1, 0, 8, + 'M', 'T', 'r', 'k', 0, 0, 0, 4+13*8, + P(C), P(C), P(C), P(E), P(D), P(D), P(D), P(F), P(E), P(E), P(D), P(D), PL(C), 0, 0xff, 0x2f, 0 }; @@ -138,41 +143,41 @@ #define GET32(p) (((p)[0] 24) | ((p)[1] 16) | ((p)[2] 8) | (p)[3]) #define GET32_LE(p) (((p)[3] 24) | ((p)[2] 16) | ((p)[1] 8) | (p)[0]) -void +static void __attribute__((__noreturn__)) usage(void) { - printf(usage: %s [-d unit] [-f file] [-l] [-m] [-p pgm] [-q] + fprintf(stderr, usage: %s [-d unit] [-f file] [-l] [-m] [-p pgm] [-q] [-t %%tempo] [-v] [-x] [file ...]\n, getprogname()); exit(1); } -int showmeta = 0; -int verbose = 0; +static int showmeta = 0; +static int verbose = 0; #define BASETEMPO 40 /* us/beat(=24 clks or qn) (150 bpm) */ -u_int tempo_set = 0; -u_int tempo_abs = 0; -u_int ttempo = 100; -int unit = 0; -int play = 1; -int fd = -1; -int sameprogram = 0; -int insysex = 0; -int svsysex = 0; /* number of sysex bytes saved internally */ +static
CVS commit: src/usr.bin/midiplay
Module Name:src Committed By: joerg Date: Thu May 26 14:20:23 UTC 2011 Modified Files: src/usr.bin/midiplay: Makefile Log Message: Use CWARNFLAGS.clang and not CWARNFLAGS here To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/usr.bin/midiplay/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/midiplay/Makefile diff -u src/usr.bin/midiplay/Makefile:1.2 src/usr.bin/midiplay/Makefile:1.3 --- src/usr.bin/midiplay/Makefile:1.2 Thu May 26 12:56:33 2011 +++ src/usr.bin/midiplay/Makefile Thu May 26 14:20:22 2011 @@ -1,8 +1,8 @@ -# $NetBSD: Makefile,v 1.2 2011/05/26 12:56:33 joerg Exp $ +# $NetBSD: Makefile,v 1.3 2011/05/26 14:20:22 joerg Exp $ # @(#)Makefile 8.1 (Berkeley) 6/6/93 PROG= midiplay -CWARNFLAGS+= -Wno-format-extra-args -Wno-initializer-overrides +CWARNFLAGS.clang+= -Wno-format-extra-args -Wno-initializer-overrides .include bsd.prog.mk
CVS commit: src/usr.bin/midiplay
Module Name:src Committed By: mbalmer Date: Sat Jan 16 08:50:29 UTC 2010 Modified Files: src/usr.bin/midiplay: midiplay.1 Log Message: fix wording: instead of the a file - instead of a file To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/usr.bin/midiplay/midiplay.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/midiplay/midiplay.1 diff -u src/usr.bin/midiplay/midiplay.1:1.18 src/usr.bin/midiplay/midiplay.1:1.19 --- src/usr.bin/midiplay/midiplay.1:1.18 Wed Apr 30 13:11:01 2008 +++ src/usr.bin/midiplay/midiplay.1 Sat Jan 16 08:50:29 2010 @@ -1,4 +1,4 @@ -.\ $NetBSD: midiplay.1,v 1.18 2008/04/30 13:11:01 martin Exp $ +.\ $NetBSD: midiplay.1,v 1.19 2010/01/16 08:50:29 mbalmer Exp $ .\ Copyright (c) 1998 The NetBSD Foundation, Inc. .\ All rights reserved. .\ @@ -25,7 +25,7 @@ .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\ POSSIBILITY OF SUCH DAMAGE. .\ -.Dd June 30, 2006 +.Dd January 16, 2010 .Dt MIDIPLAY 1 .Os .Sh NAME @@ -94,7 +94,7 @@ be verbose. If the flag is repeated the verbosity increases. .It Fl x -play a small sample sound instead of the a file. +play a small sample sound instead of a file. .El .Pp A file containing no tempo indication will be played as if it specified
CVS commit: src/usr.bin/midiplay
Module Name:src Committed By: lukem Date: Sun Apr 12 14:15:08 UTC 2009 Modified Files: src/usr.bin/midiplay: midiplay.c Log Message: fix sign-compare and cast-qual issues To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/usr.bin/midiplay/midiplay.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/midiplay/midiplay.c diff -u src/usr.bin/midiplay/midiplay.c:1.26 src/usr.bin/midiplay/midiplay.c:1.27 --- src/usr.bin/midiplay/midiplay.c:1.26 Mon Apr 28 20:24:14 2008 +++ src/usr.bin/midiplay/midiplay.c Sun Apr 12 14:15:08 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: midiplay.c,v 1.26 2008/04/28 20:24:14 martin Exp $ */ +/* $NetBSD: midiplay.c,v 1.27 2009/04/12 14:15:08 lukem Exp $ */ /* * Copyright (c) 1998, 2002 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include sys/cdefs.h #ifndef lint -__RCSID($NetBSD: midiplay.c,v 1.26 2008/04/28 20:24:14 martin Exp $); +__RCSID($NetBSD: midiplay.c,v 1.27 2009/04/12 14:15:08 lukem Exp $); #endif @@ -72,7 +72,7 @@ #define META_SMPTE 0x54 #define META_TIMESIGN 0x58 -char *metanames[] = { +const char *metanames[] = { , Text, Copyright, Track, Instrument, Lyric, Marker, Cue, }; @@ -88,8 +88,8 @@ void send_sysex(u_char *, u_int); u_long getvar(struct track *); u_long getlen(struct track *); -void playfile(FILE *, char *); -void playdata(u_char *, u_int, char *); +void playfile(FILE *, const char *); +void playdata(u_char *, u_int, const char *); int main(int argc, char **argv); void Heapify(struct track *, int, int); @@ -350,7 +350,7 @@ } void -playfile(FILE *f, char *name) +playfile(FILE *f, const char *name) { u_char *buf, *nbuf; u_int tot, n, size, nread; @@ -385,7 +385,7 @@ } void -playdata(u_char *buf, u_int tot, char *name) +playdata(u_char *buf, u_int tot, const char *name) { int format, ntrks, divfmt, ticks, t; u_int len, mlen, status, chan; @@ -406,7 +406,7 @@ u_char *eod; /* Detected a RMID file, let's just check if it's * a MIDI file */ - if (GET32_LE(buf + MARK_LEN) != tot - 8) { + if ((u_int)GET32_LE(buf + MARK_LEN) != tot - 8) { warnx(Not a RMID file, bad header); return; }