2 //**************************************************************************
6 //**************************************************************************
8 // HEADER FILES ------------------------------------------------------------
12 #include <sys/ioctl.h>
14 #include <sys/types.h>
19 #ifdef HAVE_LINUX_CDROM_H
20 #include <linux/cdrom.h>
25 // MACROS ------------------------------------------------------------------
27 // #define MAX_AUDIO_TRACKS 25
29 // TYPES -------------------------------------------------------------------
31 // EXTERNAL FUNCTION PROTOTYPES --------------------------------------------
33 // PUBLIC FUNCTION PROTOTYPES ----------------------------------------------
35 // PRIVATE FUNCTION PROTOTYPES ---------------------------------------------
37 // EXTERNAL DATA DECLARATIONS ----------------------------------------------
39 // PUBLIC DATA DEFINITIONS -------------------------------------------------
43 // PRIVATE DATA DEFINITIONS ------------------------------------------------
45 //static int cd_FirstTrack;
46 //static int cd_LastTrack;
48 static int cdfile = -1;
49 //static char cd_dev[64] = "/dev/cdrom";
51 // CODE --------------------------------------------------------------------
53 static int I_CDGetDiskInfo(void)
57 //==========================================================================
61 // Initializes the CD audio system. Must be called before using any
62 // other I_CDMus functions.
64 // Returns: 0 (ok) or -1 (error, in cd_Error).
66 //==========================================================================
75 //==========================================================================
79 // Play an audio CD track.
81 // Returns: 0 (ok) or -1 (error, in cd_Error).
83 //==========================================================================
85 int I_CDMusPlay(int track)
90 //==========================================================================
94 // Stops the playing of an audio CD.
96 // Returns: 0 (ok) or -1 (error, in cd_Error).
98 //==========================================================================
100 int I_CDMusStop(void)
105 //==========================================================================
109 // Resumes the playing of an audio CD.
111 // Returns: 0 (ok) or -1 (error, in cd_Error).
113 //==========================================================================
115 int I_CDMusResume(void)
120 //==========================================================================
124 // Sets the CD audio volume (0 - 255).
126 // Returns: 0 (ok) or -1 (error, in cd_Error).
128 //==========================================================================
130 int I_CDMusSetVolume(int volume)
135 //==========================================================================
139 // Returns: the number of the first track.
141 //==========================================================================
143 int I_CDMusFirstTrack(void)
148 //==========================================================================
152 // Returns: the number of the last track.
154 //==========================================================================
156 int I_CDMusLastTrack(void)
161 //==========================================================================
165 //==========================================================================
167 void I_CDMusShutdown(void)
169 if(cdfile) close(cdfile);
172 //==========================================================================
176 //==========================================================================
178 void I_CDMusUpdate(void)