From 7988f8a2c791e7ee59d84ee8b6adc4e2e13081f2 Mon Sep 17 00:00:00 2001 From: "Jordan K. Hubbard" Date: Sun, 9 Apr 1995 15:50:48 +0000 Subject: [PATCH] Part of Frank Durda IV's new matcd driver CD audio support. Submitted by: Frank Durda IV --- sys/sys/cdio.h | 103 ++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 98 insertions(+), 5 deletions(-) diff --git a/sys/sys/cdio.h b/sys/sys/cdio.h index c49dfed2b34..9db1bd385b5 100644 --- a/sys/sys/cdio.h +++ b/sys/sys/cdio.h @@ -1,8 +1,26 @@ /* * 16 Feb 93 Julian Elischer (julian@dialix.oz.au) * - * $Id: cdio.h,v 1.5 1994/01/29 10:31:20 rgrimes Exp $ + * $Id: cdio.h,v 1.6 1994/02/05 09:14:24 swallace Exp $ */ +/* +<1> Fixed a conflict with ioctl usage. There were two different + functions using code #25. Made file formatting consistent. + Added two new ioctl codes: door closing and audio pitch playback. + Added a STEREO union called STEREO. + 5-Mar-95 Frank Durda IV bsdmail@nemesis.lonestar.org + +<2> Added a new ioctl that allows you to find out what capabilities + a drive has and what commands it will accept. This allows a + user application to only offer controls (buttons, sliders, etc) + for functions that drive can actually do. Things it can't do + can disappear or be greyed-out (like some other system). + If the driver doesn't respond to this call, well, handle it the + way you used to do it. + 2-Apr-95 Frank Durda IV bsdmail@nemesis.lonestar.org +*/ + + /* Shared between kernel & process */ #ifndef _SYS_CDIO_H_ #define _SYS_CDIO_H_ @@ -78,9 +96,11 @@ struct cd_sub_channel_info { } what; }; + /***************************************************************\ * Ioctls for the CD drive * \***************************************************************/ + struct ioc_play_track { u_char start_track; @@ -88,8 +108,9 @@ struct ioc_play_track u_char end_track; u_char end_index; }; - #define CDIOCPLAYTRACKS _IOW('c',1,struct ioc_play_track) + + struct ioc_play_blocks { int blk; @@ -97,6 +118,7 @@ struct ioc_play_blocks }; #define CDIOCPLAYBLOCKS _IOW('c',2,struct ioc_play_blocks) + struct ioc_read_subchannel { u_char address_format; #define CD_LBA_FORMAT 1 @@ -118,9 +140,9 @@ struct ioc_toc_header { u_char starting_track; u_char ending_track; }; - #define CDIOREADTOCHEADER _IOR('c',4,struct ioc_toc_header) + struct ioc_read_toc_entry { u_char address_format; u_char starting_track; @@ -129,32 +151,49 @@ struct ioc_read_toc_entry { }; #define CDIOREADTOCENTRYS _IOWR('c',5,struct ioc_read_toc_entry) + struct ioc_patch { u_char patch[4]; /* one for each channel */ }; #define CDIOCSETPATCH _IOW('c',9,struct ioc_patch) + + struct ioc_vol { u_char vol[4]; /* one for each channel */ }; #define CDIOCGETVOL _IOR('c',10,struct ioc_vol) + #define CDIOCSETVOL _IOW('c',11,struct ioc_vol) + #define CDIOCSETMONO _IO('c',12) + #define CDIOCSETSTERIO _IO('c',13) +#define CDIOCSETSTEREO _IO('c',13) + #define CDIOCSETMUTE _IO('c',14) + #define CDIOCSETLEFT _IO('c',15) + #define CDIOCSETRIGHT _IO('c',16) + #define CDIOCSETDEBUG _IO('c',17) + #define CDIOCCLRDEBUG _IO('c',18) + #define CDIOCPAUSE _IO('c',19) + #define CDIOCRESUME _IO('c',20) + #define CDIOCRESET _IO('c',21) + #define CDIOCSTART _IO('c',22) + #define CDIOCSTOP _IO('c',23) + #define CDIOCEJECT _IO('c',24) -#define CDIOCALLOW _IO('c',25) -#define CDIOCPREVENT _IO('c',26) + struct ioc_play_msf { @@ -167,4 +206,58 @@ struct ioc_play_msf }; #define CDIOCPLAYMSF _IOW('c',25,struct ioc_play_msf) +#define CDIOCALLOW _IO('c',26) + +#define CDIOCPREVENT _IO('c',27) + + /*<1>For drives that support it, this*/ + /*<1>causes the drive to close its door*/ + /*<1>and make the media (if any) ready*/ +#define CDIOCCLOSE _IO('c',28) /*<1>*/ + + +struct ioc_pitch /*<1>For drives that support it, this*/ +{ /*<1>call instructs the drive to play the*/ + short speed; /*<1>audio at a faster or slower-than-normal*/ +}; /*<1>rate. -32767 to -1 is slower, 0==normal,*/ + /*<1>and 1 to 32767 is faster. LSB bits are*/ + /*<1>discarded first by drives with less res.*/ +#define CDIOCPITCH _IOW('c',29,struct ioc_pitch) /*<1>*/ + +struct ioc_capability { /*<2>*/ + u_long play_function; /*<2>*/ +#define CDDOPLAYTRK 0x00000001 /*<2>Can Play tracks/index*/ +#define CDDOPLAYMSF 0x00000002 /*<2>Can Play msf to msf*/ +#define CDDOPLAYBLOCKS 0x00000004 /*<2>Can Play range of blocks*/ +#define CDDOPAUSE 0x00000100 /*<2>Output can be paused*/ +#define CDDORESUME 0x00000200 /*<2>Output can be resumed*/ +#define CDDORESET 0x00000400 /*<2>Drive can be completely reset*/ +#define CDDOSTART 0x00000800 /*<2>Audio can be started*/ +#define CDDOSTOP 0x00001000 /*<2>Audio can be stopped*/ +#define CDDOPITCH 0x00002000 /*<2>Audio pitch */ + + u_long routing_function; /*<2>*/ +#define CDREADVOLUME 0x00000001 /*<2>Volume settings can be read*/ +#define CDSETVOLUME 0x00000002 /*<2>Volume settings can be set*/ +#define CDSETMONO 0x00000100 /*<2>Output can be set to mono*/ +#define CDSETSTEREO 0x00000200 /*<2>Output can be set to stereo (def)*/ +#define CDSETLEFT 0x00000400 /*<2>Output can be set to left only*/ +#define CDSETRIGHT 0x00000800 /*<2>Output can be set to right only*/ +#define CDSETMUTE 0x00001000 /*<2>Output can be muted*/ +#define CDSETPATCH 0x00008000 /*<2>Direct routing countrol allowed*/ + + u_long special_function; /*<2>*/ +#define CDDOEJECT 0x00000001 /*<2>The tray can be opened*/ +#define CDDOCLOSE 0x00000002 /*<2>The tray can be closed*/ +#define CDDOLOCK 0x00000004 /*<2>The tray can be locked*/ +#define CDREADHEADER 0x00000100 /*<2>Can read Table of Contents*/ +#define CDREADENTRIES 0x00000200 /*<2>Can read TOC Entries*/ +#define CDREADSUBQ 0x00000200 /*<2>Can read Subchannel info*/ +#define CDREADRW 0x00000400 /*<2>Can read subcodes R-W*/ +#define CDHASDEBUG 0x00004000 /*<2>The tray has dynamic debugging*/ +}; /*<2>*/ + +#define CDIOCCAPABILITY _IOR('c',30,struct ioc_capability) /*<2>*/ + #endif /* _SYS_CDIO_H_ */ +