1 #ifndef __WIN95_CDPLAYER_H__
2 #define __WIN95_CDPLAYER_H__
3 
4 /* KJL 12:40:35 07/05/98 - This is code derived from Patrick's original stuff &
5 moved into it's own file. */
6 
7 
8 /* Patrick 10/6/97 --------------------------------------------------------------
9   SUPPORT FOR CDDA SYSTEM
10   -----------------------------------------------------------------------------*/
11 
12 /* Patrick 10/6/97 --------------------------------------------------------------
13   Some Volume defines
14   -----------------------------------------------------------------------------*/
15 #define CDDA_VOLUME_MAX		(127)
16 #define CDDA_VOLUME_MIN		(0)
17 #define CDDA_VOLUME_DEFAULT	(127)
18 #define CDDA_VOLUME_RESTOREPREGAMEVALUE (-100)
19 
20 /* Patrick 10/6/97 --------------------------------------------------------------
21   Enumeration of CD player states
22   -----------------------------------------------------------------------------*/
23 typedef enum cdoperationstates
24 {
25 	CDOp_Idle,
26 	CDOp_Playing,
27 }
28 CDOPERATIONSTATES;
29 
30 /* Patrick 10/6/97 --------------------------------------------------------------
31   CDDA_Start/End are used to initialise and de-initialise the CDDA system.
32   No CDDA operations have any effect until the system has been initialised.
33   -----------------------------------------------------------------------------*/
34 extern void CDDA_Start(void);
35 extern void CDDA_End(void);
36 /* Patrick 10/6/97 --------------------------------------------------------------
37  This is provided to allow platform specific polling/management of the CD device
38  whilst playing. It should be called during the main game loop.
39   -----------------------------------------------------------------------------*/
40 extern void CDDA_Management(void);
41 /* Patrick 10/6/97 --------------------------------------------------------------
42   Play , change volume, and stop are the basic CDDA operations provided. An
43   enumeration of tracks should be provided in the platform header.
44   -----------------------------------------------------------------------------*/
45 extern void CDDA_Play(int CDDATrack);
46 extern void CDDA_PlayLoop(int CDDATrack);
47 extern void CDDA_ChangeVolume(int volume);
48 extern void CDDA_Stop(void);
49 extern int CDDA_CheckNumberOfTracks(void);
50 /* Patrick 23/6/97 --------------------------------------------------------------
51   Returns the current CDDA volume setting.  NB if the cd player has not been
52   initialised the volume setting can still be obtained by calling this function,
53   though it may not be changed using CDDA_ChangeVolume().
54   -----------------------------------------------------------------------------*/
55 extern int CDDA_GetCurrentVolumeSetting(void);
56 /* Patrick 10/6/97 --------------------------------------------------------------
57   Switch on and switch off may be used to stop and start the CDDA system after
58   initialisation. They are provided to allow the user to stop and start CDDA
59   during a game.
60   -----------------------------------------------------------------------------*/
61 extern void CDDA_SwitchOn(void);
62 extern void CDDA_SwitchOff(void);
63 /* Patrick 10/6/97 --------------------------------------------------------------
64   These are provided to interrogate the state of the CDDA system.
65   -----------------------------------------------------------------------------*/
66 extern int CDDA_IsOn(void);
67 extern int CDDA_IsPlaying(void);
68 
69 
70 
71 enum CDCOMMANDID
72 {
73 	CDCOMMANDID_Start,
74 	CDCOMMANDID_End,
75 	CDCOMMANDID_Play,
76 	CDCOMMANDID_PlayLoop,
77 	CDCOMMANDID_ChangeVolume,
78 	CDCOMMANDID_Stop,
79 };
80 
81 /* CDDA SUPPORT */
82 
83 #define VOLUME_CDDA_MAXPLAT			(65535)
84 #define VOLUME_CDDA_MINPLAT			(0)
85 
86 /* Patrick 10/6/97 -------------------------------------------------------------
87   Start and end functions provide any platform specific initialisation for
88   the CD player. The start function returns SOUND_PLATFORM error if unsucessful,
89   or zero otherwise.
90   ----------------------------------------------------------------------------*/
91 extern int PlatStartCDDA(void);
92 extern void PlatEndCDDA(void);
93 /* Patrick 10/6/97 -------------------------------------------------------------
94   Platform specific play, stop, and change volume functions. NB the volume
95   is scaled to the platform limits defined above.
96   These functions return SOUND_PLATFORM error if unsucessful, or 0 otherwise.
97   ----------------------------------------------------------------------------*/
98 extern int PlatPlayCDDA(int track);
99 extern int PlatStopCDDA(void);
100 extern int PlatChangeCDDAVolume(int volume);
101 int PlatGetNumberOfCDTracks(int* numTracks);
102 /* Patrick 10/6/97 -------------------------------------------------------------
103   Management functions are provided for platform specific detection of changes
104   in the cd player state (ie finishing a track, or an error).  The basic
105   management function is provided for consoles, who need to poll the device,
106   whilst the call back is provided for intercepting WIN95 MCI call backs.
107   ----------------------------------------------------------------------------*/
108 extern void PlatCDDAManagement(void);
109 extern void PlatCDDAManagementCallBack(WPARAM flags, LONG deviceId);
110 
111 
112 
113 extern int CDPlayerVolume;
114 
115 #endif
116