1 | /* -*- tab-width: 8; c-basic-offset: 4 -*- */
|
---|
2 | /*
|
---|
3 | * MCI CDAUDIO Driver for OS/2
|
---|
4 | *
|
---|
5 | * Copyright 1994 Martin Ayotte
|
---|
6 | * Copyright 1999 Eric Pouech
|
---|
7 | * Copyright 2000 Chris Wohlgemuth
|
---|
8 | *
|
---|
9 | * Project Odin Software License can be found in LICENSE.TXT
|
---|
10 | */
|
---|
11 |
|
---|
12 | #ifndef __WINE_CDROM_H__
|
---|
13 | #define __WINE_CDROM_H__
|
---|
14 |
|
---|
15 | #include <stdlib.h>
|
---|
16 | // #include <unistd.h>
|
---|
17 | //#include "windef.h"
|
---|
18 |
|
---|
19 | #ifdef HAVE_LINUX_CDROM_H
|
---|
20 | # include <linux/cdrom.h>
|
---|
21 | #endif
|
---|
22 | #ifdef HAVE_LINUX_UCDROM_H
|
---|
23 | # include <linux/ucdrom.h>
|
---|
24 | #endif
|
---|
25 | #ifdef HAVE_SYS_CDIO_H
|
---|
26 | # include <sys/cdio.h>
|
---|
27 | #endif
|
---|
28 |
|
---|
29 | typedef struct {
|
---|
30 | int unixdev;
|
---|
31 | #if defined(linux)
|
---|
32 | struct cdrom_subchnl sc;
|
---|
33 | #elif defined(__FreeBSD__) || defined(__NetBSD__)
|
---|
34 | struct cd_sub_channel_info sc;
|
---|
35 | #endif
|
---|
36 | char chrDrive[3];
|
---|
37 | char cPad;
|
---|
38 | char chrDeviceType[128];
|
---|
39 | ULONG hfOS2Handle;
|
---|
40 | ULONG ulLeadOut;
|
---|
41 | /* those data reflect the cdaudio structure and
|
---|
42 | * don't change while playing
|
---|
43 | */
|
---|
44 | UINT16 nTracks;
|
---|
45 | UINT16 nFirstTrack;
|
---|
46 | UINT16 nLastTrack;
|
---|
47 | LPDWORD lpdwTrackLen;
|
---|
48 | LPDWORD lpdwTrackPos;
|
---|
49 | LPBYTE lpbTrackFlags;
|
---|
50 | DWORD dwFirstFrame;
|
---|
51 | DWORD dwLastFrame;
|
---|
52 | /* those data change while playing */
|
---|
53 | ULONG ulCDROMStatus;
|
---|
54 | USHORT usCDAudioStatus;
|
---|
55 | int cdaMode;
|
---|
56 | UINT nCurTrack;
|
---|
57 | DWORD dwCurFrame;
|
---|
58 | } WINE_CDAUDIO;
|
---|
59 |
|
---|
60 | typedef struct {
|
---|
61 | UINT wDevID;
|
---|
62 | int nUseCount; /* Incremented for each shared open */
|
---|
63 | BOOL fShareable; /* TRUE if first open was shareable */
|
---|
64 | WORD wNotifyDeviceID; /* MCI device ID with a pending notification */
|
---|
65 | HANDLE hCallback; /* Callback handle for pending notification */
|
---|
66 | DWORD dwTimeFormat;
|
---|
67 | WINE_CDAUDIO wcda;
|
---|
68 | int mciMode;
|
---|
69 | } WINE_MCICDAUDIO;
|
---|
70 |
|
---|
71 |
|
---|
72 | #define WINE_CDA_DONTKNOW 0x00
|
---|
73 | #define WINE_CDA_NOTREADY 0x01
|
---|
74 | #define WINE_CDA_OPEN 0x02
|
---|
75 | #define WINE_CDA_PLAY 0x03
|
---|
76 | #define WINE_CDA_STOP 0x04
|
---|
77 | #define WINE_CDA_PAUSE 0x05
|
---|
78 |
|
---|
79 | #ifndef MCI_CONFIGURE
|
---|
80 | #define MCI_CONFIGURE 0x087A
|
---|
81 | #endif
|
---|
82 |
|
---|
83 | int CDAUDIO_Open(WINE_CDAUDIO* wcda);
|
---|
84 | int CDAUDIO_Close(WINE_CDAUDIO* wcda);
|
---|
85 | int CDAUDIO_Reset(WINE_CDAUDIO* wcda);
|
---|
86 | int CDAUDIO_Play(WINE_CDAUDIO* wcda, DWORD start, DWORD stop);
|
---|
87 | int CDAUDIO_Stop(WINE_CDAUDIO* wcda);
|
---|
88 | int CDAUDIO_Pause(WINE_CDAUDIO* wcda, int pauseOn);
|
---|
89 | int CDAUDIO_Seek(WINE_CDAUDIO* wcda, DWORD at);
|
---|
90 | int CDAUDIO_SetDoor(WINE_CDAUDIO* wcda, int open);
|
---|
91 | int CDAUDIO_GetNumberOfTracks(WINE_CDAUDIO* wcda);
|
---|
92 | BOOL CDAUDIO_GetTracksInfo(WINE_CDAUDIO* wcda);
|
---|
93 | BOOL CDAUDIO_GetCDStatus(WINE_CDAUDIO* wcda);
|
---|
94 |
|
---|
95 | HANDLE os2CDOpen(char *drive);
|
---|
96 | ULONG os2CDClose(ULONG hfOS2Handle);
|
---|
97 | int os2GetNumTracks(HANDLE hfOS2Handle,ULONG *ulLeadOut);
|
---|
98 | BOOL os2GetCDStatus(HANDLE hfOS2Handle, ULONG *ulStatus);
|
---|
99 | BOOL os2GetCDAudioStatus(HANDLE hfOS2Handle, USHORT *usStatus);
|
---|
100 | ULONG os2CDQueryTrackStartSector( HANDLE hfDrive, ULONG numTrack, BOOL *flAudio);
|
---|
101 | BOOL os2CDEject(HANDLE hfDrive);
|
---|
102 | BOOL os2CDCloseTray(HANDLE hfDrive);
|
---|
103 | BOOL os2CDStop(HANDLE hfDrive);
|
---|
104 | BOOL os2CDPlayRange(HANDLE hfDrive ,ULONG ulFrom, ULONG ulTo);
|
---|
105 | BOOL os2CDResume(HANDLE hfDrive);
|
---|
106 | BOOL os2CDGetHeadLocation(HANDLE hfOS2Handle, ULONG *ulHeadLocation);
|
---|
107 | BOOL os2CDSeek(HANDLE hfOS2Handle, ULONG ulTo);
|
---|
108 | BOOL os2CDQueryCurTrack(HANDLE hfOS2Handle, UINT * uiCurTrack);
|
---|
109 | BOOL os2CDQueryCDDrives(int *iNumCD, char * cFirstDrive);
|
---|
110 |
|
---|
111 | #define CDFRAMES_PERSEC 75
|
---|
112 | #define SECONDS_PERMIN 60
|
---|
113 | #define CDFRAMES_PERMIN ((CDFRAMES_PERSEC) * (SECONDS_PERMIN))
|
---|
114 |
|
---|
115 | #ifndef CDROM_DATA_TRACK
|
---|
116 | #define CDROM_DATA_TRACK 0x04
|
---|
117 | #endif
|
---|
118 |
|
---|
119 | #endif
|
---|
120 |
|
---|