1 /*
2  * Copyright (C) 1990 Regents of the University of California.
3  *
4  * Permission to use, copy, modify, distribute, and sell this software and
5  * its documentation for any purpose is hereby granted without fee,
6  * provided that the above copyright notice appear in all copies and that
7  * both that copyright notice and this permission notice appear in
8  * supporting documentation, and that the name of the University of
9  * California not be used in advertising or publicity pertaining to
10  * distribution of the software without specific, written prior
11  * permission.  the University of California makes no representations
12  * about the suitability of this software for any purpose.  It is provided
13  * "as is" without express or implied warranty.
14  */
15 
16 # include <X11/Intrinsic.h>
17 
18 # define NOTITLESTR     "No Title"
19 # define NODISCSTR      "No Disc"
20 
21 # define bit(n)			(1 << (n))
22 
23 /* bits for cdrom_state */
24 # define CDROM_STATE_PLAY	bit(0)
25 # define CDROM_STATE_PAUSE	bit(1)
26 # define CDROM_STATE_STOP	bit(2)
27 # define CDROM_STATE_EJECTED	bit(3)
28 # define CDROM_STATE_CYCLE	bit(4)
29 # define CDROM_STATE_SHUFFLE	bit(5)
30 # define CDROM_STATE_PROGRAM	bit(6)
31 
32 /* return codes from cdrom_status() */
33 # define CDROM_INVALID		1
34 # define CDROM_PLAYING		2
35 # define CDROM_PAUSED		3
36 # define CDROM_COMPLETED	4
37 # define CDROM_ERROR		5
38 # define CDROM_NO_STATUS	6
39 
40 #define	STILL_MOUNTED	1
41 #define	UNMOUNTED	0
42 
43 struct msf {
44 	unsigned char   minute;
45 	unsigned char   second;
46 	unsigned char   frame;
47 };
48 
49 struct prognode {
50 	unsigned char	track;
51 	Widget		button;
52 	struct prognode *next;
53 	struct prognode *prev;
54 };
55 
56 typedef struct _cdrom_info {
57 	unsigned char	curtrack;	/* current track playing	*/
58 	unsigned char	mintrack;	/* first audio track		*/
59 	unsigned char	maxtrack;	/* last audio track		*/
60 	unsigned char	ntracks;	/* size of random track list	*/
61 	int		duration;	/* seconds played so far	*/
62 	int		state;		/* state of cd-rom drive	*/
63 	short		currand;	/* index into random track list */
64 	short		lastprog;	/* number of selections in prog.*/
65 	unsigned short	*times;		/* duration of each track	*/
66 	struct msf 	*addrs;		/* starting minute/second/frames*/
67 	struct prognode	*selection;	/* currently selected prog. trk	*/
68 	struct prognode *program;	/* list of programmed tracks	*/
69 } cdrom_info;
70 
71 extern int		cdrom_open();
72 extern void		cdrom_close();
73 extern int		cdrom_start();
74 extern int		cdrom_stop();
75 extern int		cdrom_eject();
76 extern int		cdrom_pause();
77 extern int		cdrom_resume();
78 extern int		cdrom_volume();
79 extern int		cdrom_get_times();
80 extern int		cdrom_get_curtrack();
81 extern int		cdrom_get_msf();
82 extern int		cdrom_get_curmsf();
83 extern int		cdrom_play_track();
84 extern int		cdrom_play_msf();
85 extern int		cdrom_read_tocentry();
86 extern int		cdrom_read_tochdr();
87 extern int		cdrom_status();
88 
89 extern cdrom_info	cdi;
90 extern char		*disc_title;
91 extern char		program_str[];
92 extern char		*cdInfoDir;
93 
94