Subversion Repositories Kolibri OS

Rev

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