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.

233 lines
4.9 KiB

  1. /*
  2. * MEDIAWAVE.H
  3. *
  4. * There is the external definition of the WAVE
  5. * medai handlers. DO NOT USE THIS STRUCTURE IN ANY WAY UNLESS YOU
  6. * ARE WRITING A MEDIA HANDLER!!! This structure subject to change
  7. * without notice.
  8. *
  9. * This file requires "windows.h", "mediaman.h"
  10. */
  11. #ifndef _MEDWAVE_H_
  12. #define _MEDWAVE_H_
  13. #define medtypeWAVE medFOURCC('W','A','V','E')
  14. #define medtypeAIFF medFOURCC('A','I','F','F')
  15. #define medtypePCM medFOURCC('P','C','M',' ')
  16. #define medtypeCNVW medFOURCC('C','N','V','W')
  17. #define medtypeADPV medFOURCC('A','D','P','V')
  18. #define medtypeADPM medFOURCC('A','D','P','M')
  19. #define CFNAME_WAVEEDIT "WaveEditIntSound"
  20. #define WAVE_GETSIZE ( MED_USER + 2 )
  21. #define WAVE_CUT ( MED_USER + 3 )
  22. #define WAVE_PASTE ( MED_USER + 4 )
  23. #define WAVE_READ ( MED_USER + 5 )
  24. #define WAVE_COPY ( MED_USER + 6 )
  25. #define WAVE_GETDATA ( MED_USER + 9 )
  26. #define WAVE_GETFMT ( MED_USER + 10 )
  27. #define WAVE_GETFMTSIZE ( MED_USER + 11 )
  28. #define WAVE_WRITE ( MED_USER + 12 )
  29. #define WAVE_SETFMT ( MED_USER + 13 )
  30. #define WAVE_REALIZE ( MED_USER + 14 )
  31. #define WAVE_SETFMTNORESIZE ( MED_USER + 15 )
  32. #define WAVE_PASTECHUNK (MED_USER + 16)
  33. /* HACK HACK a HWAVE is now defined in mmsystem.h */
  34. /* Get around this by defining a different type. */
  35. typedef DWORD MedWaveHWAVE;
  36. #define HWAVE MedWaveHWAVE
  37. typedef struct _WaveChange {
  38. int nOperation;
  39. LONG nPosition;
  40. LONG nLength;
  41. } WaveChangeStruct;
  42. typedef WaveChangeStruct FAR * FPWaveChangeStruct;
  43. typedef struct _WaveRead {
  44. LONG nPosition;
  45. LONG nLength;
  46. LPSTR fpchBuffer;
  47. } WaveReadStruct;
  48. typedef WaveReadStruct FAR * FPWaveReadStruct;
  49. typedef struct _WaveGetData {
  50. LONG nChunkStart;
  51. LONG nPosition;
  52. LONG nLength;
  53. LPSTR fpchBuffer;
  54. } WaveGetDataStruct;
  55. typedef WaveGetDataStruct FAR * FPWaveGetDataStruct;
  56. typedef struct _WaveWrite {
  57. LONG nLength;
  58. LPSTR fpchBuffer;
  59. } WaveWriteStruct;
  60. typedef WaveWriteStruct FAR * FPWaveWriteStruct;
  61. typedef struct _WavePasteChunk {
  62. LONG nPosition;
  63. LONG nLength;
  64. HMED hMed;
  65. } WavePasteChunkStruct;
  66. typedef WavePasteChunkStruct FAR * FPWavePasteChunkStruct;
  67. /*
  68. * WARNING WARNING WARNING
  69. *
  70. * Do not read below this line if you are not writing a wave physical
  71. * handler for use with the WAVE handlers. The structure given
  72. * below is not for public consumption.
  73. *
  74. */
  75. #define HWaveSound( x ) HIWORD( x )
  76. #define HWaveFmt( x ) LOWORD( x )
  77. #define WAVE_MED 1
  78. #define WAVE_TMEM 2
  79. #define WAVE_TMED 3
  80. #define WAVE_NONE 5
  81. #define WAVE_LINK 42
  82. typedef WORD PWAVELINK;
  83. typedef WORD PWAVELOC;
  84. extern HPSTR hpStorage;
  85. typedef struct _WaveLocation {
  86. WORD wType; // the contents of the union
  87. WORD wAccessCount; // Access count
  88. LONG nLength; // Sample Length of the Block
  89. LONG nStart; // Offset in union u element
  90. // sample counts are in format stored in
  91. union {
  92. MEDID medid;
  93. struct _TmpMed NEAR * pTmpMed;
  94. struct _TmpMem NEAR * pTmpMem;
  95. } u;
  96. } WaveLocation;
  97. typedef PWAVELOC PWaveLocation;
  98. #define MEDWAVE_ACCESS(p) (hpStorage + p * (DWORD) sizeof(WaveLocation))
  99. #define PLOC(p) ((WaveLocation FAR *) MEDWAVE_ACCESS(p))
  100. // typedef WaveLocation NEAR *PWaveLocation;
  101. typedef struct _WaveLink {
  102. WORD wType;
  103. PWAVELINK pNext;
  104. PWAVELINK pPrev;
  105. LONG nStart; // Starting sample # of the block
  106. LONG nLength;// Sample Length of the Block
  107. // sample counts are in format wanted
  108. PWAVELOC pLoc; // Where the data is
  109. } WaveLink;
  110. // typedef WaveLink NEAR *PWaveLink;
  111. // typedef WaveLink FAR *FPWaveLink;
  112. typedef PWAVELINK PWaveLink;
  113. #define PLINK(p) ((WaveLink FAR *) MEDWAVE_ACCESS(p))
  114. #define LINKLOC(p) PLOC(PLINK(p)->pLoc)
  115. typedef struct _MediaWave {
  116. MEDID medidOld;
  117. MEDTYPE medTypeCurrent;
  118. LONG nSampleSize;
  119. WORD cbSample;
  120. NPPCMWAVEFORMAT pFmt;
  121. NPPCMWAVEFORMAT pFmtWanted;
  122. HMED hMed;
  123. PWAVELINK pMedia;
  124. } MediaWave;
  125. typedef MediaWave FAR *FPMediaWave;
  126. typedef struct _TmpMed {
  127. MEDID medid;
  128. WORD wAccessCount;
  129. LONG nLength;
  130. MediaWave Wave;
  131. } TmpMed;
  132. typedef TmpMed NEAR *PTmpMed;
  133. typedef struct _TmpMem {
  134. HANDLE hMem;
  135. WORD wAccessCount;
  136. LONG nLength;
  137. MediaWave Wave;
  138. } TmpMem;
  139. typedef TmpMem NEAR *PTmpMem;
  140. #define MediaWaveSetError(ERR) medSetExtError(ERR, ghInst)
  141. /* ERROR MESSAGE DEFINITIONS, must be greater than 100 */
  142. #define ERRCNV_READING 100
  143. #define ERRCNV_SSND_OFFSET 101
  144. #define ERRCNV_SSND_BLOCK 102
  145. #define ERRCNV_SEEKING_FOR 103
  146. #define ERRCNV_DATA_CREATE 104
  147. #define ERRCNV_SSND_NOTFOUND 105
  148. #define ERRCNV_COMM_ASCEND 109
  149. #define ERRCNV_SEEK_START 110
  150. #define ERRCNV_COMM_FIND 118
  151. #define ERRCNV_NOT_AIFF 119
  152. #define ERRCNV_OPEN_INPUT 121
  153. #define ERRCNV_OPEN_OUTPUT 122
  154. #define ERRCNV_NOT_RIFF 133
  155. #define ERRCNV_NOT_WAVE 134
  156. #define ERRCNV_BAD_FMT 135
  157. #define ERRCNV_FMT_FIND 137
  158. #define ERRCNV_DATA_FIND 138
  159. #define ERRCNV_SSND_FIND 140
  160. #define ERRCNV_ALLOC 141
  161. #define ERRCNV_SAVE 142
  162. #define ERRCNV_NOTWRITE 143
  163. #define ERRCNV_NOTREAD 144
  164. extern void FAR PASCAL MediaWaveFreeHWAVE( HWAVE hWave );
  165. #endif /* _WAVE_H_ */