1 #ifndef _DJGPP_INCLUDE_CD_H
2 #define _DJGPP_INCLUDE_CD_H
3 
4 #define COOKED  0
5 #define RAW     1
6 
7 #define MSF     0
8 #define REDBOOK 1
9 
10 // variables are quite self explanatory
11 extern int			cdda_first_drive;
12 extern int			cdda_nb_of_drives;
13 extern int			cdda_current_drive;
14 extern int			cdda_current_track;
15 extern int			cdda_playing;
16 extern int			cdda_min_track;
17 extern int			cdda_max_track;
18 extern int			cdda_disk_length;
19 
20 extern char	global_error[80];
21 
22 int cdda_init();
23 // initialize the cd rom driver
24 
25 int cdda_play(int track);
26 // play an audio track
27 
28 void cdda_stop();
29 // stop the current playing
30 
31 void cdda_shutdown();
32 // for now, just stop the playing
33 
34 void cdda_loop_check();
35 // seems to must be called each seconde if you want audio tracks to be
36 // played again when finished
37 
38 void cdda_track_info(unsigned char *result, int track);
39 // return info on the given track, result is 7-bytes long
40 
41 void cdda_read_sector(unsigned char* p,unsigned long nb_sect,
42                       unsigned char mode_read, unsigned char mode_addr);
43 
44 void cdda_cooked_prefech_read_sector_redbook(unsigned long nb_sect);
45 
46 void cdda_cooked_prefech_read_sector_msf(unsigned long nb_sect);
47 
48 void cdda_dos_cooked_read_sector_lba(unsigned char* p, unsigned long nb_sect);
49 
50 int	cdda_play_sectors(int begin_sect, int length);
51 
52 //-- Fonctions de conversion -------------------------------------------------
53 
54 unsigned Time2Frame(int min, int sec, int frame);
55 
56 unsigned Time2HSG(int min, int sec, int frame);
57 
58 unsigned Time2Redbook(int min, int sec, int frame);
59 
60 void Frame2Time(unsigned frame,
61                 int *Min,
62                 int *Sec,
63                 int *Fra);
64 
65 void Redbook2Time(unsigned redbook,
66                   int* Min,
67                   int* Sec,
68                   int* Fra);
69 
70 void HSG2Time(unsigned hsg,
71               int *Min,
72               int *Sec,
73               int *Fra);
74 
75 unsigned Redbook2HSG(unsigned redbook);
76 unsigned HSG2Redbook(unsigned HSG);
77 
78 #endif
79