diff options
author | ache <ache@FreeBSD.org> | 1995-01-10 18:35:23 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1995-01-10 18:35:23 +0000 |
commit | 47bbf47f3cf8c044f276a2d32db2b4c6f533bfd1 (patch) | |
tree | 84b5ddb62c2a3cc3e62132822ae6d6d60126d96e | |
parent | f1933d1eef93555307c075cc76f35081e962afa0 (diff) | |
download | FreeBSD-src-47bbf47f3cf8c044f276a2d32db2b4c6f533bfd1.zip FreeBSD-src-47bbf47f3cf8c044f276a2d32db2b4c6f533bfd1.tar.gz |
Updates from jmz and me
-rw-r--r-- | usr.sbin/cdplay/Makefile | 2 | ||||
-rw-r--r-- | usr.sbin/cdplay/cdplay.1 | 101 | ||||
-rw-r--r-- | usr.sbin/cdplay/cdplay.c | 13 |
3 files changed, 109 insertions, 7 deletions
diff --git a/usr.sbin/cdplay/Makefile b/usr.sbin/cdplay/Makefile index a5a1193..7f3fdc1 100644 --- a/usr.sbin/cdplay/Makefile +++ b/usr.sbin/cdplay/Makefile @@ -1,5 +1,3 @@ PROG= cdplay -NOMAN= noman - .include <bsd.prog.mk> diff --git a/usr.sbin/cdplay/cdplay.1 b/usr.sbin/cdplay/cdplay.1 new file mode 100644 index 0000000..489b25d --- /dev/null +++ b/usr.sbin/cdplay/cdplay.1 @@ -0,0 +1,101 @@ +.Dd January 8, 1995 +.Dt CDPLAY 1 +.Os FreeBSD +.Sh NAME +.Nm cdplay +.Nd Audio CD player +.Sh SYNOPSIS +.Nm cdplay +.Ar device +.Sh DESCRIPTION +.Nm cdplay +is a program to control an audio CD player. The device is a name such +as cd0 or mcd0. +.Pp + Currently supported commands are as follows: +.Bl -tag -width Cm +.It Cm play first_track last_track +Play from track +.Nm first_track to track +.Nm last_track. +The first track has number 1 +.Xr play 1 +.It Cm stop +Stop playing. Do not stop the disc. +.It Cm resume +Resume playing. Used after the +.Nm pause + command. +.It Cm stop +Stop the disc. +.It Cm eject +Eject the disc. +.It Cm setvol left_channel right_channel +Set the volume of left channel to +.Nm left_channel +and the volume of right channel to +.Nm right_channel. +Allowed values are in the range 0-255. +.It Cm getvol +Print the current values of the volume for left and right channels. +.It Cm msfplay start_m start_s start_f end_m end_s end_f +Play from the absolute address +(MSF) defined by +.Nm start_m +in minutes, +.Nm start_s, +in seconds and +.Nm start_f +(frame number) to the abolute address defined by +.Nm end_m +in minutes, +.Nm end_s, +in seconds and +.Nm end_f +(frame number). Minutes are in the range 0-99. Seconds are in the range 0-59. +Frame numbers are in the range 0-74 +.It Cm status +Print the status of the CD player. The first number has the following meaning: +.sp +.Nm 17 +Audio play operation in progress +.br +.Nm 18 +Audio play operation paused +.br +.Nm 19 +Audio play operation successfully completed +.br +.Nm 20 +Audio play operation stopped due to error +.br +.Nm 21 +No current audio status to return +.sp +The other numbers are the current MSF address (minute, second, frame) +.It Cm tochdr +Print the first and last track numbers and length. +.It Cm tocentry +Print the table of contents (TOC) of the disc on the form +.br +.Nm track-number minute second frame +where +.NM minute, second +and +.Nm frame +represent the absolute address of the track. +.br +The track numbered 255 gives the absolute address of the end of the disc. +.It Cm quit +Quit the program +.Sh FILES +.Bl -tag -width /dev/rmcd0c -compact +.It Pa /dev/rcd0c +.It Pa /dev/rmcd0c +.El +.Sh AUTHOR +Jean-Marc Zucconi +.Sh HISTORY +The +.Nm cdplay +command appeared in FreeBSD 2.0 diff --git a/usr.sbin/cdplay/cdplay.c b/usr.sbin/cdplay/cdplay.c index b4e78b2..3066c77 100644 --- a/usr.sbin/cdplay/cdplay.c +++ b/usr.sbin/cdplay/cdplay.c @@ -65,13 +65,16 @@ main (int argc, char **argv) } else if (command ("getvol")) { int r, l; rc = getvol (&l, &r); - if (rc > 0) + if (rc > -1) printf ("%d %d\n", l, r); } else if (command ("tochdr")) { struct ioc_toc_header h; rc = read_toc_header (&h); - if (rc > 0) - printf ("%d %d %d\n", h.len, h.starting_track, h.ending_track); + if (rc > -1) { + if (standalone) + printf("start end length\n"); + printf ("%d %d %d\n", h.starting_track, h.ending_track, h.len); + } } else if (command ("msfplay")) { int m1, m2, s1, s2, f1, f2; sscanf(cmd+7, "%d%d%d%d%d%d", &m1, &s1, &f1, &m2, &s2, &f2); @@ -80,7 +83,7 @@ main (int argc, char **argv) struct ioc_toc_header h; int i, n; rc = read_toc_header (&h); - if (rc > 0) { + if (rc > -1) { n = h.ending_track - h.starting_track + 1; rc = read_toc_entrys ((n+1)*sizeof(struct cd_toc_entry)); toc_buffer[n].track = 255; @@ -108,7 +111,7 @@ tocentry, status, quit, help\n"); printf("No such command, enter 'help' for commands list\n"); fflush (stdout); if (rc < 0 && standalone) - perror("cdplayer"); + perror("cdplay"); } exit (0); } |