1 // Emacs style mode select   -*- C++ -*-
2 //-----------------------------------------------------------------------------
3 //
4 // $Id: I_cdmus.c 1035 2013-08-14 00:38:40Z wesleyjohnson $
5 //
6 // Copyright (C) 1998-2000 by DooM Legacy Team.
7 //
8 // This program is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU General Public License
10 // as published by the Free Software Foundation; either version 2
11 // of the License, or (at your option) any later version.
12 //
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 // GNU General Public License for more details.
17 //
18 //
19 // $Log: I_cdmus.c,v $
20 // Revision 1.2  2000/08/10 11:07:51  ydario
21 //
22 // Revision 1.1  2000/08/09 11:42:47  ydario
23 // OS/2 specific platform code
24 //
25 // Revision 1.6  2000/04/28 19:28:00  metzgermeister
26 // changed to CDROMPLAYMSF for CD music
27 //
28 // Revision 1.5  2000/04/07 23:12:38  metzgermeister
29 //
30 // Revision 1.4  2000/03/28 16:18:42  linuxcub
31 // Added a command to the Linux sound-server which sets a master volume...
32 //
33 // Revision 1.3  2000/03/22 18:53:53  metzgermeister
34 // Ripped CD code out of Quake and put it here
35 //
36 // Revision 1.2  2000/02/27 00:42:11  hurdler
37 // Revision 1.1.1.1  2000/02/22 20:32:33  hurdler
38 // Initial import into CVS (v1.29 pr3)
39 //
40 //
41 // DESCRIPTION:
42 //      cd music interface
43 //
44 //-----------------------------------------------------------------------------
45 
46 
47 #include <unistd.h>
48 #include <stdlib.h>
49 #include <sys/ioctl.h>
50 #include <sys/file.h>
51 #include <sys/types.h>
52 #include <fcntl.h>
53 #include <string.h>
54 #include <time.h>
55 #include <errno.h>
56 
57 #include "doomincl.h"
58 #include "i_sound.h"
59 #include "command.h"
60 #include "m_argv.h"
61 
62 #define MAX_CD_TRACKS 256
63 
64 byte   cdaudio_started=0;   // for system startup/shutdown
65 
66 static boolean cdValid = false;
67 static boolean playing = false;
68 static boolean wasPlaying = false;
69 static boolean initialized = false;
70 static boolean enabled = false;
71 static boolean playLooping = false;
72 static byte    playTrack;
73 static byte    maxTrack;
74 static byte    cdRemap[MAX_CD_TRACKS];
75 static int     cdvolume = -1;
76 
77 CV_PossibleValue_t cd_volume_cons_t[]={{0,"MIN"},{31,"MAX"},{0,NULL}};
78 
79 consvar_t cd_volume = {"cd_volume","31",CV_SAVE, cd_volume_cons_t};
80 consvar_t cdUpdate  = {"cd_update","1",CV_SAVE};
81 
82 static int cdfile = -1;
83 static char cd_dev[64] = "/dev/cdrom";
84 
85 
CDAudio_GetAudioDiskInfo(void)86 static int CDAudio_GetAudioDiskInfo(void)
87 {
88 	return 0;
89 }
90 
CDAudio_GetStartStop(struct cdrom_msf * msf,int track,struct cdrom_tocentry * entry)91 static boolean CDAudio_GetStartStop(struct cdrom_msf *msf, int track, struct cdrom_tocentry *entry)
92 {
93     return true;
94 }
95 
I_EjectCD(void)96 static void I_EjectCD(void)
97 {
98 }
99 
Command_Cd_f(void)100 static void Command_Cd_f (void)
101 {
102 }
103 
I_StopCD(void)104 void I_StopCD(void)
105 {
106 }
107 
I_PauseCD(void)108 void I_PauseCD (void)
109 {
110 }
111 
112 // continue after a pause
I_ResumeCD(void)113 void I_ResumeCD (void)
114 {
115 }
116 
117 
I_ShutdownCD(void)118 void I_ShutdownCD (void)
119 {
120 }
121 
I_InitCD(void)122 void I_InitCD (void)
123 {
124 	return ;
125 }
126 
127 
128 
129 // loop/go to next track when track is finished (if cd_update var is true)
130 // update the volume when it has changed (from console/menu)
131 // FIXME: Why do we have Setvolume then ???
132 // TODO: check for cd change and restart music ?
133 //
I_UpdateCD(void)134 void I_UpdateCD (void)
135 {
136 }
137 
138 
139 // play the cd
I_PlayCD(int track,boolean looping)140 void I_PlayCD (int track, boolean looping)
141 {
142 }
143 
144 
145 // volume : logical cd audio volume 0-31 (hardware is 0-255)
I_SetVolumeCD(int volume)146 int I_SetVolumeCD (int volume)
147 {
148     return 0;
149 }
150