FreeBSD Bugzilla – Attachment 7006 Details for
Bug 15480
[patch] [request] make cdcontrol(1) easier to use
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 3.30 KB, created by
Knut A. Syed
on 1999-12-14 11:40:02 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Knut A. Syed
Created:
1999-12-14 11:40:02 UTC
Size:
3.30 KB
patch
obsolete
>diff -crN cdcontrol.orig/cdcontrol.1 cdcontrol/cdcontrol.1 >*** cdcontrol.orig/cdcontrol.1 Mon Dec 13 21:56:21 1999 >--- cdcontrol/cdcontrol.1 Mon Dec 13 21:32:26 1999 >*************** >*** 104,109 **** >--- 104,119 ---- > .It Cm close > Inject the disc. > >+ .It Cm volume >+ Same as >+ .Em status volume >+ command. >+ >+ .It Cm volume Ar level >+ Set the volume of both channels to >+ .Ar level . >+ Allowed values are in the range 0-255. >+ > .It Cm volume Ar left_channel Ar right_channel > Set the volume of left channel to > .Ar left_channel >diff -crN cdcontrol.orig/cdcontrol.c cdcontrol/cdcontrol.c >*** cdcontrol.orig/cdcontrol.c Mon Dec 13 21:56:21 1999 >--- cdcontrol/cdcontrol.c Mon Dec 13 21:47:11 1999 >*************** >*** 16,21 **** >--- 16,27 ---- > * 11-Oct-1995: Serge V.Vakulenko <vak@cronyx.ru> > * New eject algorithm. > * Some code style reformatting. >+ * >+ * 1999-12-13: Knut A. Syed <kas@kas.no> >+ * Version 2.0.1. >+ * Volume-command modified. If used with only one >+ * parameter it now sets both channels. If used without >+ * parameters it will print volume-info. > */ > > #ifndef lint >*************** >*** 34,40 **** > #include <sys/cdio.h> > #include <sys/ioctl.h> > >! #define VERSION "2.0" > > #define ASTS_INVALID 0x00 /* Audio status byte not valid */ > #define ASTS_PLAYING 0x11 /* Audio play operation in progress */ >--- 40,46 ---- > #include <sys/cdio.h> > #include <sys/ioctl.h> > >! #define VERSION "2.0.1" > > #define ASTS_INVALID 0x00 /* Audio status byte not valid */ > #define ASTS_PLAYING 0x11 /* Audio play operation in progress */ >*************** >*** 92,98 **** > { CMD_SET, "set", 2, "msf | lba" }, > { CMD_STATUS, "status", 1, "[audio | media | volume]" }, > { CMD_STOP, "stop", 3, "" }, >! { CMD_VOLUME, "volume", 1, "<l> <r> | left | right | mute | mono | stereo" }, > { 0, } > }; > >--- 98,104 ---- > { CMD_SET, "set", 2, "msf | lba" }, > { CMD_STATUS, "status", 1, "[audio | media | volume]" }, > { CMD_STOP, "stop", 3, "" }, >! { CMD_VOLUME, "volume", 1, "<l&r> | <l> <r> | left | right | mute | mono | stereo" }, > { 0, } > }; > >*************** >*** 239,245 **** > > int run (int cmd, char *arg) > { >! int l, r, rc; > > switch (cmd) { > >--- 245,251 ---- > > int run (int cmd, char *arg) > { >! int l, r, rc, count; > > switch (cmd) { > >*************** >*** 349,354 **** >--- 355,363 ---- > if (fd < 0 && !open_cd ()) > return (0); > >+ if (strlen(arg) == 0) >+ return pstatus ("volume"); >+ > if (! strncasecmp (arg, "left", strlen(arg))) > return ioctl (fd, CDIOCSETLEFT); > >*************** >*** 364,375 **** > if (! strncasecmp (arg, "mute", strlen(arg))) > return ioctl (fd, CDIOCSETMUTE); > >! if (2 != sscanf (arg, "%d %d", &l, &r)) { > warnx("invalid command arguments"); > return (0); > } >- >- return setvol (l, r); > > default: > case CMD_HELP: >--- 373,387 ---- > if (! strncasecmp (arg, "mute", strlen(arg))) > return ioctl (fd, CDIOCSETMUTE); > >! count = sscanf (arg, "%d %d", &l, &r); >! if (count == 1) >! return setvol (l, l); >! if (count == 2) >! return setvol (l, r); >! else { > warnx("invalid command arguments"); > return (0); > } > > default: > case CMD_HELP:
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 15480
: 7006