Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1.  
  2. #ifndef _SOUND_H_
  3. #define _SOUND_H_
  4.  
  5. #ifdef __cplusplus
  6. extern "C"
  7. {
  8. #endif
  9.  
  10. #define SOUND_VERSION 5
  11.  
  12. #define PCM_ALL       0
  13.  
  14. #define PCM_OUT       0x08000000
  15. #define PCM_RING      0x10000000
  16. #define PCM_STATIC    0x20000000
  17. #define PCM_FLOAT     0x40000000
  18. #define PCM_FILTER    0x80000000
  19.  
  20. #define PCM_2_16_48   1
  21. #define PCM_1_16_48   2
  22. #define PCM_2_16_44   3
  23. #define PCM_1_16_44   4
  24. #define PCM_2_16_32   5
  25. #define PCM_1_16_32   6
  26. #define PCM_2_16_24   7
  27. #define PCM_1_16_24   8
  28. #define PCM_2_16_22   9
  29. #define PCM_1_16_22  10
  30. #define PCM_2_16_16  11
  31. #define PCM_1_16_16  12
  32. #define PCM_2_16_12  13
  33. #define PCM_1_16_12  14
  34. #define PCM_2_16_11  15
  35. #define PCM_1_16_11  16
  36. #define PCM_2_16_8   17
  37. #define PCM_1_16_8   18
  38. #define PCM_2_8_48   19
  39. #define PCM_1_8_48   20
  40. #define PCM_2_8_44   21
  41. #define PCM_1_8_44   22
  42. #define PCM_2_8_32   23
  43. #define PCM_1_8_32   24
  44. #define PCM_2_8_24   25
  45. #define PCM_1_8_24   26
  46. #define PCM_2_8_22   27
  47. #define PCM_1_8_22   28
  48. #define PCM_2_8_16   29
  49. #define PCM_1_8_16   30
  50. #define PCM_2_8_12   31
  51. #define PCM_1_8_12   32
  52. #define PCM_2_8_11   33
  53. #define PCM_1_8_11   34
  54. #define PCM_2_8_8    35
  55. #define PCM_1_8_8    36
  56.  
  57. #define SRV_GETVERSION      0
  58. #define SND_CREATE_BUFF     1
  59. #define SND_DESTROY_BUFF    2
  60. #define SND_SETFORMAT       3
  61. #define SND_GETFORMAT       4
  62. #define SND_RESET           5
  63. #define SND_SETPOS          6
  64. #define SND_GETPOS          7
  65. #define SND_SETBUFF         8
  66. #define SND_OUT             9
  67. #define SND_PLAY           10
  68. #define SND_STOP           11
  69. #define SND_SETVOLUME      12
  70. #define SND_GETVOLUME      13
  71. #define SND_SETPAN         14
  72. #define SND_GETPAN         15
  73. #define SND_GETBUFFSIZE    16
  74.  
  75. #define PLAY_SYNC     0x80000000
  76.  
  77. typedef unsigned int SNDBUF;
  78.  
  79. int _stdcall  InitSound();
  80.  
  81. SNDBUF _stdcall  CreateBuffer(unsigned int format,int size);
  82. int _stdcall  DestroyBuffer(SNDBUF hBuff);
  83.  
  84. int _stdcall  SetFormat(SNDBUF hBuff, unsigned int format);                        
  85. int _stdcall  GetFormat(SNDBUF hBuff);                        
  86.  
  87. int _stdcall  ResetBuffer(SNDBUF hBuff, unsigned int flags);
  88. int _stdcall  SetBufferPos(SNDBUF hBuff, int offset);
  89. int _stdcall  GetBufferPos(SNDBUF hBuff);
  90. int _stdcall  GetBufferSize(SNDBUF hBuff);
  91.  
  92. int _stdcall  SetBuffer(SNDBUF hBuff,void* buff,
  93.                         int offs, int size);
  94. int _stdcall  WaveOut(SNDBUF hBuff,void *buff, int size);
  95. int _stdcall  PlayBuffer(SNDBUF hBuff,unsigned int flags);
  96. int _stdcall  StopBuffer(SNDBUF hBuff);
  97.                        
  98. int _stdcall  SetVolume(SNDBUF hBuff, int left, int right);
  99. int _stdcall  GetVolume(SNDBUF hBuff, int *left, int *right);
  100. int _stdcall  SetPan(SNDBUF hBuff, int pan);
  101. int _stdcall  GetPan(SNDBUF hBuff, int pan);
  102.                        
  103. int _stdcall  GetMasterVol(int* vol);
  104. int _stdcall  SetMasterVol(int vol);
  105.  
  106.  
  107. typedef struct
  108. {
  109.     unsigned int   riff_id;
  110.     unsigned int   riff_size;
  111.     unsigned int   riff_format;
  112.  
  113.     unsigned int   fmt_id;
  114.     unsigned int   fmt_size;
  115.  
  116.     unsigned short int wFormatTag;
  117.     unsigned short int nChannels;
  118.     unsigned int   nSamplesPerSec;
  119.     unsigned int   nAvgBytesPerSec;
  120.     unsigned short int nBlockAlign;
  121.     unsigned short int wBitsPerSample;
  122.     unsigned int   data_id;
  123.     unsigned int   data_size;
  124. } WAVEHEADER;
  125.  
  126.  
  127. unsigned int _stdcall test_wav(WAVEHEADER *hdr);
  128.  
  129. #ifdef __cplusplus
  130. extern "C"
  131. }
  132. #endif
  133.  
  134. #endif //_SOUND_H_
  135.