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 0x0101
  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. #define SND_GETFREESPACE   17
  74. #define SND_SETTIMEBASE    18
  75. #define SND_GETTIMESTAMP   19
  76.  
  77. #define PLAY_SYNC     0x80000000
  78.  
  79. typedef struct
  80. {
  81.     unsigned int   riff_id;
  82.     unsigned int   riff_size;
  83.     unsigned int   riff_format;
  84.  
  85.     unsigned int   fmt_id;
  86.     unsigned int   fmt_size;
  87.  
  88.     unsigned short int wFormatTag;
  89.     unsigned short int nChannels;
  90.     unsigned int   nSamplesPerSec;
  91.     unsigned int   nAvgBytesPerSec;
  92.     unsigned short int nBlockAlign;
  93.     unsigned short int wBitsPerSample;
  94.     unsigned int   data_id;
  95.     unsigned int   data_size;
  96. } WAVEHEADER;
  97.  
  98. typedef unsigned int SNDBUF;
  99.  
  100. int _stdcall  InitSound(int *version);
  101.  
  102. int _stdcall  CreateBuffer(unsigned int format,int size,SNDBUF *buf);
  103. int _stdcall  DestroyBuffer(SNDBUF hBuff);
  104.  
  105. int _stdcall  SetFormat(SNDBUF hBuff, unsigned int format);
  106. int _stdcall  GetFormat(SNDBUF hBuff, unsigned int *format);
  107.  
  108. int _stdcall  ResetBuffer(SNDBUF hBuff, unsigned int flags);
  109. int _stdcall  SetBufferPos(SNDBUF hBuff, int offset);
  110. int _stdcall  GetBufferPos(SNDBUF hBuff, int *offset);
  111. int _stdcall  GetBufferSize(SNDBUF hBuff, int *size);
  112. int _stdcall  GetBufferFree(SNDBUF hBuff, int *free);
  113.  
  114. int _stdcall  SetBuffer(SNDBUF hBuff,void* buff,
  115.                         int offs, int size);
  116. int _stdcall  WaveOut(SNDBUF hBuff,void *buff, int size);
  117. int _stdcall  PlayBuffer(SNDBUF hBuff,unsigned int flags);
  118. int _stdcall  StopBuffer(SNDBUF hBuff);
  119.  
  120. int _stdcall  SetVolume(SNDBUF hBuff, int left, int right);
  121. int _stdcall  GetVolume(SNDBUF hBuff, int *left, int *right);
  122. int _stdcall  SetPan(SNDBUF hBuff, int pan);
  123. int _stdcall  GetPan(SNDBUF hBuff, int *pan);
  124.  
  125. int _stdcall  GetMasterVol(int* vol);
  126. int _stdcall  SetMasterVol(int vol);
  127.  
  128. int _stdcall  SetTimeBase(SNDBUF hBuff, double base);
  129. int _stdcall  GetTimeStamp(SNDBUF hBuff, double *stamp);
  130.  
  131. unsigned int _stdcall test_wav(WAVEHEADER *hdr);
  132.  
  133. #ifdef __cplusplus
  134. extern "C"
  135. }
  136. #endif
  137.  
  138. #endif //_SOUND_H_
  139.