Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/usr.bin/cdplay Allow a single argument to volume to set...



details:   https://anonhg.NetBSD.org/src/rev/c65bc05e81d9
branches:  netbsd-1-5
changeset: 489469:c65bc05e81d9
user:      abs <abs%NetBSD.org@localhost>
date:      Mon Sep 18 16:49:08 2000 +0000

description:
Allow a single argument to volume to set both left and right channels
Fix incorrect use of Ar in manpage (noted by jhawk)
Pullup (approved by jhawk)
usr.bin/cdplay/cdplay.1         1.7,1.8
usr.bin/cdplay/cdplay.c         1.9

diffstat:

 usr.bin/cdplay/cdplay.1 |  24 ++++++++++++++----------
 usr.bin/cdplay/cdplay.c |  12 ++++++++----
 2 files changed, 22 insertions(+), 14 deletions(-)

diffs (94 lines):

diff -r 8b3c78269580 -r c65bc05e81d9 usr.bin/cdplay/cdplay.1
--- a/usr.bin/cdplay/cdplay.1   Sun Sep 17 21:09:03 2000 +0000
+++ b/usr.bin/cdplay/cdplay.1   Mon Sep 18 16:49:08 2000 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: cdplay.1,v 1.6 2000/06/14 14:38:52 ad Exp $
+.\"    $NetBSD: cdplay.1,v 1.6.2.1 2000/09/18 16:49:08 abs Exp $
 .\"
 .\" Copyright (c) 1999, 2000 Andrew Doran.
 .\" All rights reserved.
@@ -26,7 +26,7 @@
 .\"
 .\" from FreeBSD: cdcontrol.1,v 1.16.2.2 1999/01/31 15:36:01 billf Exp
 .\"
-.Dd June 4, 1999
+.Dd Sep 18, 2000
 .Dt CDPLAY 1
 .Os NetBSD 1.5
 .Sh NAME
@@ -113,20 +113,24 @@
 and the volume of right channel to 
 .Ar right_channel . 
 Allowed values are in the range 0-255. 
-.It Cm volume Ar mute
+.It Cm volume Ar value
+Set the volume of both left channel right channel to 
+.Ar value . 
+Allowed values are in the range 0-255. 
+.It Cm volume mute
 Turn the sound off.
-.It Cm volume Ar mono
+.It Cm volume mono
 Set the mono mode.
-.It Cm volume Ar stereo
+.It Cm volume stereo
 Set the stereo mode.
-.It Cm volume Ar left
+.It Cm volume left
 Play the left subtrack on both left and right channels.
-.It Cm volume Ar right
+.It Cm volume right
 Play the right subtrack on both left and right channels.
 .It Cm info
 Print the table of contents.
 .It Cm status 
-.Op Ar audio | media | volume
+.Op audio | media | volume
 
 Print the information about the disc:
 
@@ -142,9 +146,9 @@
 Print the list of available commands.
 .It Cm reset
 Perform the hardware reset of the device.
-.It Cm set Ar msf
+.It Cm set msf
 Set minute-second-frame ioctl mode (default).
-.It Cm set Ar lba
+.It Cm set lba
 Set LBA ioctl mode.
 .It Cm quit
 Quit the program.
diff -r 8b3c78269580 -r c65bc05e81d9 usr.bin/cdplay/cdplay.c
--- a/usr.bin/cdplay/cdplay.c   Sun Sep 17 21:09:03 2000 +0000
+++ b/usr.bin/cdplay/cdplay.c   Mon Sep 18 16:49:08 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cdplay.c,v 1.8 2000/06/15 21:07:37 msaitoh Exp $       */
+/*     $NetBSD: cdplay.c,v 1.8.2.1 2000/09/18 16:49:08 abs Exp $       */
 
 /*
  * Copyright (c) 1999 Andrew Doran.
@@ -56,7 +56,7 @@
  
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: cdplay.c,v 1.8 2000/06/15 21:07:37 msaitoh Exp $");
+__RCSID("$NetBSD: cdplay.c,v 1.8.2.1 2000/09/18 16:49:08 abs Exp $");
 #endif /* not lint */
 
 #include <sys/endian.h>
@@ -395,8 +395,12 @@
                        return (ioctl(fd, CDIOCSETMUTE));
 
                if (sscanf(arg, "%d %d", &l, &r) != 2) {
-                       warnx("invalid command arguments");
-                       return (0);
+                       if (sscanf(arg, "%d", &l) == 1) {
+                               r = l;
+                       } else {
+                               warnx("invalid command arguments");
+                               return (0);
+                       }
                }
                return (setvol(l, r));
                



Home | Main Index | Thread Index | Old Index