1999-02-02 16:22:03 +01:00
|
|
|
/* -*- tab-width: 8; c-basic-offset: 4 -*- */
|
|
|
|
/*
|
2000-02-07 17:28:52 +01:00
|
|
|
* Header file for CD-ROM support
|
1999-02-02 16:22:03 +01:00
|
|
|
*
|
|
|
|
* Copyright 1994 Martin Ayotte
|
|
|
|
* Copyright 1999 Eric Pouech
|
2000-02-07 17:28:52 +01:00
|
|
|
* Copyright 2000 Andreas Mohr
|
1999-02-02 16:22:03 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __WINE_CDROM_H__
|
|
|
|
#define __WINE_CDROM_H__
|
|
|
|
|
1999-02-17 14:51:06 +01:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <unistd.h>
|
2000-11-26 05:04:21 +01:00
|
|
|
#include "config.h"
|
1999-03-14 17:35:05 +01:00
|
|
|
#include "windef.h"
|
2000-09-27 00:20:14 +02:00
|
|
|
#include "wine/windef16.h"
|
1999-02-17 14:51:06 +01:00
|
|
|
|
1999-02-02 16:22:03 +01:00
|
|
|
#ifdef HAVE_LINUX_CDROM_H
|
|
|
|
# include <linux/cdrom.h>
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_LINUX_UCDROM_H
|
|
|
|
# include <linux/ucdrom.h>
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_SYS_CDIO_H
|
|
|
|
# include <sys/cdio.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
typedef struct {
|
2000-10-23 02:40:23 +02:00
|
|
|
const char *devname;
|
1999-02-02 16:22:03 +01:00
|
|
|
#if defined(linux)
|
|
|
|
struct cdrom_subchnl sc;
|
|
|
|
#elif defined(__FreeBSD__) || defined(__NetBSD__)
|
|
|
|
struct cd_sub_channel_info sc;
|
|
|
|
#endif
|
1999-12-25 23:54:54 +01:00
|
|
|
/* those data reflect the cdaudio structure and
|
|
|
|
* don't change while playing
|
|
|
|
*/
|
1999-02-02 16:22:03 +01:00
|
|
|
UINT16 nTracks;
|
|
|
|
UINT16 nFirstTrack;
|
|
|
|
UINT16 nLastTrack;
|
|
|
|
LPDWORD lpdwTrackLen;
|
|
|
|
LPDWORD lpdwTrackPos;
|
|
|
|
LPBYTE lpbTrackFlags;
|
1999-12-25 23:54:54 +01:00
|
|
|
DWORD dwFirstFrame;
|
|
|
|
DWORD dwLastFrame;
|
|
|
|
/* those data change while playing */
|
|
|
|
int cdaMode;
|
|
|
|
UINT16 nCurTrack;
|
|
|
|
DWORD dwCurFrame;
|
1999-02-02 16:22:03 +01:00
|
|
|
} WINE_CDAUDIO;
|
|
|
|
|
|
|
|
#define WINE_CDA_DONTKNOW 0x00
|
|
|
|
#define WINE_CDA_NOTREADY 0x01
|
|
|
|
#define WINE_CDA_OPEN 0x02
|
|
|
|
#define WINE_CDA_PLAY 0x03
|
|
|
|
#define WINE_CDA_STOP 0x04
|
|
|
|
#define WINE_CDA_PAUSE 0x05
|
|
|
|
|
2000-02-07 17:28:52 +01:00
|
|
|
int CDROM_Open(WINE_CDAUDIO* wcda, int drive);
|
2000-10-23 02:40:23 +02:00
|
|
|
int CDROM_OpenDev(WINE_CDAUDIO* wcda);
|
|
|
|
int CDROM_GetMediaType(WINE_CDAUDIO* wcda, int parentdev);
|
|
|
|
int CDROM_CloseDev(int dev);
|
2000-02-07 17:28:52 +01:00
|
|
|
int CDROM_Close(WINE_CDAUDIO* wcda);
|
2000-10-23 02:40:23 +02:00
|
|
|
int CDROM_Reset(WINE_CDAUDIO* wcda, int parentdev);
|
|
|
|
int CDROM_Audio_Play(WINE_CDAUDIO* wcda, DWORD start, DWORD stop, int parentdev);
|
|
|
|
int CDROM_Audio_Stop(WINE_CDAUDIO* wcda, int parentdev);
|
|
|
|
int CDROM_Audio_Pause(WINE_CDAUDIO* wcda, int pauseOn, int parentdev);
|
|
|
|
int CDROM_Audio_Seek(WINE_CDAUDIO* wcda, DWORD at, int parentdev);
|
|
|
|
int CDROM_SetDoor(WINE_CDAUDIO* wcda, int open, int parentdev);
|
|
|
|
UINT16 CDROM_Audio_GetNumberOfTracks(WINE_CDAUDIO* wcda, int parentdev);
|
|
|
|
BOOL CDROM_Audio_GetTracksInfo(WINE_CDAUDIO* wcda, int parentdev);
|
|
|
|
BOOL CDROM_Audio_GetCDStatus(WINE_CDAUDIO* wcda, int parentdev);
|
2000-07-25 22:59:59 +02:00
|
|
|
WORD CDROM_Data_FindBestVoldesc(int fd);
|
2000-02-07 17:28:52 +01:00
|
|
|
DWORD CDROM_Audio_GetSerial(WINE_CDAUDIO* wcda);
|
2000-10-23 02:40:23 +02:00
|
|
|
DWORD CDROM_Data_GetSerial(WINE_CDAUDIO* wcda, int parentdev);
|
2000-02-07 17:28:52 +01:00
|
|
|
DWORD CDROM_GetSerial(int drive);
|
2000-07-25 22:59:59 +02:00
|
|
|
DWORD CDROM_GetLabel(int drive, char *label);
|
1999-02-02 16:22:03 +01:00
|
|
|
|
|
|
|
#define CDFRAMES_PERSEC 75
|
|
|
|
#define SECONDS_PERMIN 60
|
1999-03-15 16:14:43 +01:00
|
|
|
#define CDFRAMES_PERMIN ((CDFRAMES_PERSEC) * (SECONDS_PERMIN))
|
1999-02-02 16:22:03 +01:00
|
|
|
|
|
|
|
#ifndef CDROM_DATA_TRACK
|
|
|
|
#define CDROM_DATA_TRACK 0x04
|
|
|
|
#endif
|
|
|
|
|
2000-02-07 17:28:52 +01:00
|
|
|
#define CDROM_MSF_MINUTE(msf) ((BYTE)(msf))
|
|
|
|
#define CDROM_MSF_SECOND(msf) ((BYTE)(((WORD)(msf)) >> 8))
|
|
|
|
#define CDROM_MSF_FRAME(msf) ((BYTE)((msf)>>16))
|
|
|
|
|
|
|
|
#define CDROM_MAKE_MSF(m, s, f) ((DWORD)(((BYTE)(m) | \
|
|
|
|
((WORD)(s)<<8)) | \
|
|
|
|
(((DWORD)(BYTE)(f))<<16)))
|
|
|
|
|
2000-01-29 22:11:47 +01:00
|
|
|
/* values borrowed from Linux 2.2.x cdrom.h */
|
|
|
|
#define CDS_NO_INFO 0
|
|
|
|
#define CDS_AUDIO 100
|
2000-10-24 03:42:42 +02:00
|
|
|
#define CDS_DATA_1 101
|
|
|
|
#define CDS_DATA_2 102
|
|
|
|
#define CDS_XA_2_1 103
|
|
|
|
#define CDS_XA_2_2 104
|
|
|
|
#define CDS_MIXED 105
|
2000-01-29 22:11:47 +01:00
|
|
|
|
1999-02-02 16:22:03 +01:00
|
|
|
#endif
|
|
|
|
|