Leaked source code of windows server 2003
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.

106 lines
4.0 KiB

  1. /*******************************Module*Header*********************************\
  2. * Module Name: cda.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-1996 Microsoft Corporation
  14. *
  15. \****************************************************************************/
  16. typedef unsigned long redbook; /* redbook address */
  17. typedef int DID; /* drive id */
  18. /*
  19. * Return codes from CDA_... routines
  20. */
  21. #define INVALID_DRIVE -1
  22. #define NO_EXTENSIONS -1
  23. #define BAD_EXTENSIONS_VERSION -2
  24. #define NO_REQUEST_BUFF -3
  25. #define TRAY_OPEN 1
  26. #define TRAY_CLOSED 2
  27. #define INVALID_TRACK 0xFF000000
  28. #define COMMAND_FAILED 1
  29. #define COMMAND_SUCCESSFUL 0
  30. #define SUPPORTS_REDBOOKAUDIO 1
  31. #define SUPPORTS_CHANNELCONTROL 2
  32. #define DISC_IN_DRIVE 4
  33. #define DISC_PLAYING 1
  34. #define DISC_PAUSED 2
  35. #define DISC_NOT_READY 3
  36. #define DISC_READY 4
  37. #define NEW_DISC 5
  38. #define SAME_DISC 6
  39. #define DISC_NOT_IN_CDROM 7
  40. /*
  41. * Macros to handle conversions of various time formats
  42. */
  43. #define REDFRAME(x) ((UCHAR)((int)( (x) & 0x000000FF)))
  44. #define REDSECOND(x) ((UCHAR)((int)(((x) & 0x0000FF00)>>8)))
  45. #define REDMINUTE(x) ((UCHAR)((int)(((x) & 0x00FF0000)>>16)))
  46. #define REDTRACK(x) ((UCHAR)((int)(((x) & 0xFF000000)>>24)))
  47. #define MAKERED(m,s,f) ((unsigned long)(((unsigned char)(f) | \
  48. ((unsigned short)(s)<<8)) | \
  49. (((unsigned long)(unsigned char)(m))<<16)))
  50. #define REDTH(red,trk) \
  51. ((redbook)((red) & 0xFFFFFF | ((trk) << 24) & 0xFF000000))
  52. #define TRACK_ERROR (0xFF000000)
  53. #define reddiff(high,low) (CDA_bin2red(CDA_red2bin((high)) - CDA_red2bin((low))))
  54. #define redadd(onered,twored) (CDA_bin2red(CDA_red2bin((onered)) + CDA_red2bin((twored))))
  55. /*
  56. * Function prototypes
  57. */
  58. extern redbook CDA_bin2red (unsigned long ul);
  59. extern unsigned long CDA_red2bin (redbook red);
  60. extern BOOL CDA_open(DID did);
  61. extern BOOL CDA_close(DID did);
  62. extern int CDA_seek_audio(DID did, redbook address, BOOL fForceAudio);
  63. extern int CDA_init_audio(void);
  64. extern int CDA_terminate_audio(void);
  65. extern BOOL CDA_disc_ready(DID did);
  66. extern int CDA_traystate(DID did);
  67. extern int CDA_num_tracks(DID did);
  68. extern int CDA_track_type(DID did, int trk);
  69. extern redbook CDA_track_start(DID did, int whichtrack);
  70. extern redbook CDA_track_length(DID did, int whichtrack);
  71. extern int CDA_track_type(DID did, int trk);
  72. extern int CDA_play_audio(DID did, redbook start, redbook length);
  73. extern int CDA_stop_audio(DID did);
  74. extern void CDA_reset_drive(DID did);
  75. extern int CDA_eject(DID did);
  76. extern BOOL CDA_closetray(DID did);
  77. extern redbook CDA_disc_length(DID did);
  78. extern int CDA_drive_status (DID did);
  79. extern int CDA_disc_changed(DID did);
  80. extern int CDA_pause_audio(DID did);
  81. extern int CDA_resume_audio(DID did);
  82. extern int CDA_time_info(DID did, redbook FAR *disctime, redbook FAR *tracktime);
  83. extern int CDA_set_audio_volume(DID did, int channel, UCHAR volume);
  84. extern int CDA_set_audio_volume_all(DID did, UCHAR volume);
  85. extern redbook CDA_disc_end( DID did ); //leadout
  86. extern DWORD CDA_disc_id( DID did );
  87. extern BOOL CDA_disc_upc( DID did, LPTSTR upc );
  88. unsigned long CDA_get_support_info(DID did);
  89. int CDA_get_drive(LPCTSTR lpstrDeviceName, DID * pdid);
  90. int CDA_status_track_pos(DID did, DWORD * pStatus,
  91. redbook * pTrackTime, redbook * pDiscTime);