Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

151 lines
4.2 KiB

  1. /*******************************Module*Header*********************************\
  2. * Module Name: cdio.h
  3. *
  4. * Media Control Architecture Redbook CD Audio Driver
  5. *
  6. * Created:
  7. * Author:
  8. *
  9. * History:
  10. *
  11. * Internal data structures
  12. *
  13. * Copyright (c) 1990-1997 Microsoft Corporation
  14. *
  15. \****************************************************************************/
  16. #include <devioctl.h>
  17. #include <ntddcdrm.h>
  18. //
  19. // define types
  20. //
  21. typedef redbook MSF; // minutes, seconds, frames.
  22. #define ANSI_NAME_SIZE 32 // device name size
  23. #define IS_DATA_TRACK 0x04 // Flag for track control byte - defines type of
  24. // track = bit = 0 => audio, bit = 1 => data
  25. //
  26. // Private structures
  27. //
  28. typedef struct _TRACK_INFO {
  29. UCHAR TrackNumber; // Track number read from TOC
  30. MSF msfStart; // Track start MSF from TOC
  31. UCHAR Ctrl; // Track control byte (defined by SCSI2)
  32. } TRACK_INFO, *LPTRACK_INFO;
  33. //
  34. // Information about a single device and any disk in it
  35. //
  36. typedef struct _CD_INFO {
  37. HANDLE DeviceCritSec; // The device critical section
  38. TCHAR cDrive; // The device disc letter
  39. HANDLE hDevice; // Handle to an open device
  40. int NumberOfUsers; // Support multiple opens
  41. BOOL bTOCValid; // TOC info is valid
  42. UCHAR FirstTrack;
  43. UCHAR LastTrack;
  44. MSF msfEnd; // Address of the end of the disk
  45. MSF leadout; // Address of the real of the disk
  46. UCHAR fPrevStatus; // fixes Audio Status bug !
  47. MSF fPrevSeekTime; // Store away previous seek time
  48. UCHAR VolChannels[4]; // Store away volume channels
  49. TRACK_INFO Track[MAXIMUM_NUMBER_TRACKS];
  50. } CDINFO, *LPCDINFO;
  51. typedef LPCDINFO HCD; // handle to a CD device driver
  52. // (in cdio.c)
  53. //
  54. // Global data
  55. //
  56. int NumDrives; // The number of drives
  57. CDINFO CdInfo[MCIRBOOK_MAX_DRIVES]; // Data on each drive
  58. //
  59. // Device functions
  60. //
  61. int CdGetNumDrives(void);
  62. BOOL CdOpen(int Drive);
  63. BOOL CdClose(HCD hCD);
  64. BOOL CdReload(LPCDINFO lpInfo);
  65. BOOL CdReady(HCD hCD);
  66. BOOL CdPlay(HCD hCD, MSF msfStart, MSF msfEnd);
  67. BOOL CdSeek(HCD hCD, MSF msf, BOOL fForceAudio);
  68. MSF CdTrackStart(HCD hCD, UCHAR Track);
  69. MSF CdTrackLength(HCD hCD, UCHAR Track);
  70. int CdTrackType(HCD hCD, UCHAR Track);
  71. BOOL CdPosition(HCD hCD, MSF *tracktime, MSF *disktime);
  72. MSF CdDiskEnd(HCD hCD);
  73. MSF CdDiskLength(HCD hCD);
  74. DWORD CdStatus(HCD hCD);
  75. BOOL CdEject(HCD hCD);
  76. BOOL CdPause(HCD hCD);
  77. BOOL CdResume(HCD hCD);
  78. BOOL CdStop(HCD hCD);
  79. BOOL CdSetVolumeAll(HCD hCD, UCHAR Volume);
  80. BOOL CdSetVolume(HCD hCD, int Channel, UCHAR Volume);
  81. BOOL CdCloseTray(HCD hCD);
  82. int CdNumTracks(HCD hCD);
  83. BOOL CdTrayClosed(HCD hCD);
  84. DWORD CdDiskID(HCD hCD);
  85. BOOL CdDiskUPC(HCD hCD, LPTSTR upc);
  86. BOOL CdGetDrive(LPCTSTR lpstrDeviceName, DID * pdid);
  87. BOOL CdStatusTrackPos(HCD hCD, DWORD * pStatus,
  88. MSF * pTrackTime, MSF * pDiscTime);
  89. void
  90. EnterCrit(
  91. HANDLE hMutex
  92. );
  93. void
  94. LeaveCrit(
  95. HANDLE hMutex
  96. );
  97. /***************************************************************************
  98. DEBUGGING SUPPORT
  99. ***************************************************************************/
  100. #if DBG
  101. #define STATICFN
  102. #define STATICDT
  103. extern void mcicdaDbgOut(LPSTR lpszFormat, ...);
  104. extern void mcicdaSetDebugLevel(int level);
  105. int DebugLevel;
  106. #define dprintf( _x_ ) mcicdaDbgOut _x_
  107. #define dprintf1( _x_ ) if (DebugLevel >= 1) mcicdaDbgOut _x_
  108. #define dprintf2( _x_ ) if (DebugLevel >= 2) mcicdaDbgOut _x_
  109. #define dprintf3( _x_ ) if (DebugLevel >= 3) mcicdaDbgOut _x_
  110. #define dprintf4( _x_ ) if (DebugLevel >= 4) mcicdaDbgOut _x_
  111. #else
  112. #define STATICFN
  113. #define STATICDT static
  114. #define dprintf(x)
  115. #define dprintf1(x)
  116. #define dprintf2(x)
  117. #define dprintf3(x)
  118. #define dprintf4(x)
  119. #endif