Advertisement
Guest User

Untitled

a guest
Dec 13th, 2019
759
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 47.35 KB | None | 0 0
  1. /*
  2.     BASS 2.4 C/C++ header file
  3.     Copyright (c) 1999-2019 Un4seen Developments Ltd.
  4.  
  5.     See the BASS.CHM file for more detailed documentation
  6. */
  7.  
  8. #ifndef BASS_H
  9. #define BASS_H
  10.  
  11. #ifdef _WIN32
  12. #include <wtypes.h>
  13. typedef unsigned __int64 QWORD;
  14. #else
  15. #include <stdint.h>
  16. #define WINAPI
  17. #define CALLBACK
  18. typedef uint8_t BYTE;
  19. typedef uint16_t WORD;
  20. typedef uint32_t DWORD;
  21. typedef uint64_t QWORD;
  22. #ifndef __OBJC__
  23. typedef int BOOL;
  24. #endif
  25. #ifndef TRUE
  26. #define TRUE 1
  27. #define FALSE 0
  28. #endif
  29. #define LOBYTE(a) (BYTE)(a)
  30. #define HIBYTE(a) (BYTE)((a)>>8)
  31. #define LOWORD(a) (WORD)(a)
  32. #define HIWORD(a) (WORD)((a)>>16)
  33. #define MAKEWORD(a,b) (WORD)(((a)&0xff)|((b)<<8))
  34. #define MAKELONG(a,b) (DWORD)(((a)&0xffff)|((b)<<16))
  35. #endif
  36.  
  37. #ifdef __cplusplus
  38. extern "C" {
  39. #endif
  40.  
  41. #define BASSVERSION         0x204   // API version
  42. #define BASSVERSIONTEXT     "2.4"
  43.  
  44. #ifndef BASSDEF
  45. #define BASSDEF(f) WINAPI f
  46. #else
  47. #define NOBASSOVERLOADS
  48. #endif
  49.  
  50. typedef DWORD HMUSIC;       // MOD music handle
  51. typedef DWORD HSAMPLE;      // sample handle
  52. typedef DWORD HCHANNEL;     // playing sample's channel handle
  53. typedef DWORD HSTREAM;      // sample stream handle
  54. typedef DWORD HRECORD;      // recording handle
  55. typedef DWORD HSYNC;        // synchronizer handle
  56. typedef DWORD HDSP;         // DSP handle
  57. typedef DWORD HFX;          // DX8 effect handle
  58. typedef DWORD HPLUGIN;      // Plugin handle
  59.  
  60. // Error codes returned by BASS_ErrorGetCode
  61. #define BASS_OK             0   // all is OK
  62. #define BASS_ERROR_MEM      1   // memory error
  63. #define BASS_ERROR_FILEOPEN 2   // can't open the file
  64. #define BASS_ERROR_DRIVER   3   // can't find a free/valid driver
  65. #define BASS_ERROR_BUFLOST  4   // the sample buffer was lost
  66. #define BASS_ERROR_HANDLE   5   // invalid handle
  67. #define BASS_ERROR_FORMAT   6   // unsupported sample format
  68. #define BASS_ERROR_POSITION 7   // invalid position
  69. #define BASS_ERROR_INIT     8   // BASS_Init has not been successfully called
  70. #define BASS_ERROR_START    9   // BASS_Start has not been successfully called
  71. #define BASS_ERROR_SSL      10  // SSL/HTTPS support isn't available
  72. #define BASS_ERROR_ALREADY  14  // already initialized/paused/whatever
  73. #define BASS_ERROR_NOCHAN   18  // can't get a free channel
  74. #define BASS_ERROR_ILLTYPE  19  // an illegal type was specified
  75. #define BASS_ERROR_ILLPARAM 20  // an illegal parameter was specified
  76. #define BASS_ERROR_NO3D     21  // no 3D support
  77. #define BASS_ERROR_NOEAX    22  // no EAX support
  78. #define BASS_ERROR_DEVICE   23  // illegal device number
  79. #define BASS_ERROR_NOPLAY   24  // not playing
  80. #define BASS_ERROR_FREQ     25  // illegal sample rate
  81. #define BASS_ERROR_NOTFILE  27  // the stream is not a file stream
  82. #define BASS_ERROR_NOHW     29  // no hardware voices available
  83. #define BASS_ERROR_EMPTY    31  // the MOD music has no sequence data
  84. #define BASS_ERROR_NONET    32  // no internet connection could be opened
  85. #define BASS_ERROR_CREATE   33  // couldn't create the file
  86. #define BASS_ERROR_NOFX     34  // effects are not available
  87. #define BASS_ERROR_NOTAVAIL 37  // requested data/action is not available
  88. #define BASS_ERROR_DECODE   38  // the channel is/isn't a "decoding channel"
  89. #define BASS_ERROR_DX       39  // a sufficient DirectX version is not installed
  90. #define BASS_ERROR_TIMEOUT  40  // connection timedout
  91. #define BASS_ERROR_FILEFORM 41  // unsupported file format
  92. #define BASS_ERROR_SPEAKER  42  // unavailable speaker
  93. #define BASS_ERROR_VERSION  43  // invalid BASS version (used by add-ons)
  94. #define BASS_ERROR_CODEC    44  // codec is not available/supported
  95. #define BASS_ERROR_ENDED    45  // the channel/file has ended
  96. #define BASS_ERROR_BUSY     46  // the device is busy
  97. #define BASS_ERROR_UNKNOWN  -1  // some other mystery problem
  98.  
  99. // BASS_SetConfig options
  100. #define BASS_CONFIG_BUFFER          0
  101. #define BASS_CONFIG_UPDATEPERIOD    1
  102. #define BASS_CONFIG_GVOL_SAMPLE     4
  103. #define BASS_CONFIG_GVOL_STREAM     5
  104. #define BASS_CONFIG_GVOL_MUSIC      6
  105. #define BASS_CONFIG_CURVE_VOL       7
  106. #define BASS_CONFIG_CURVE_PAN       8
  107. #define BASS_CONFIG_FLOATDSP        9
  108. #define BASS_CONFIG_3DALGORITHM     10
  109. #define BASS_CONFIG_NET_TIMEOUT     11
  110. #define BASS_CONFIG_NET_BUFFER      12
  111. #define BASS_CONFIG_PAUSE_NOPLAY    13
  112. #define BASS_CONFIG_NET_PREBUF      15
  113. #define BASS_CONFIG_NET_PASSIVE     18
  114. #define BASS_CONFIG_REC_BUFFER      19
  115. #define BASS_CONFIG_NET_PLAYLIST    21
  116. #define BASS_CONFIG_MUSIC_VIRTUAL   22
  117. #define BASS_CONFIG_VERIFY          23
  118. #define BASS_CONFIG_UPDATETHREADS   24
  119. #define BASS_CONFIG_DEV_BUFFER      27
  120. #define BASS_CONFIG_REC_LOOPBACK    28
  121. #define BASS_CONFIG_VISTA_TRUEPOS   30
  122. #define BASS_CONFIG_IOS_MIXAUDIO    34
  123. #define BASS_CONFIG_DEV_DEFAULT     36
  124. #define BASS_CONFIG_NET_READTIMEOUT 37
  125. #define BASS_CONFIG_VISTA_SPEAKERS  38
  126. #define BASS_CONFIG_IOS_SPEAKER     39
  127. #define BASS_CONFIG_MF_DISABLE      40
  128. #define BASS_CONFIG_HANDLES         41
  129. #define BASS_CONFIG_UNICODE         42
  130. #define BASS_CONFIG_SRC             43
  131. #define BASS_CONFIG_SRC_SAMPLE      44
  132. #define BASS_CONFIG_ASYNCFILE_BUFFER 45
  133. #define BASS_CONFIG_OGG_PRESCAN     47
  134. #define BASS_CONFIG_MF_VIDEO        48
  135. #define BASS_CONFIG_AIRPLAY         49
  136. #define BASS_CONFIG_DEV_NONSTOP     50
  137. #define BASS_CONFIG_IOS_NOCATEGORY  51
  138. #define BASS_CONFIG_VERIFY_NET      52
  139. #define BASS_CONFIG_DEV_PERIOD      53
  140. #define BASS_CONFIG_FLOAT           54
  141. #define BASS_CONFIG_NET_SEEK        56
  142. #define BASS_CONFIG_AM_DISABLE      58
  143. #define BASS_CONFIG_NET_PLAYLIST_DEPTH  59
  144. #define BASS_CONFIG_NET_PREBUF_WAIT 60
  145. #define BASS_CONFIG_WASAPI_PERSIST  65
  146. #define BASS_CONFIG_REC_WASAPI      66
  147.  
  148. // BASS_SetConfigPtr options
  149. #define BASS_CONFIG_NET_AGENT       16
  150. #define BASS_CONFIG_NET_PROXY       17
  151. #define BASS_CONFIG_IOS_NOTIFY      46
  152. #define BASS_CONFIG_LIBSSL          64
  153.  
  154. // BASS_Init flags
  155. #define BASS_DEVICE_8BITS       1       // 8 bit
  156. #define BASS_DEVICE_MONO        2       // mono
  157. #define BASS_DEVICE_3D          4       // enable 3D functionality
  158. #define BASS_DEVICE_16BITS      8       // limit output to 16 bit
  159. #define BASS_DEVICE_LATENCY     0x100   // calculate device latency (BASS_INFO struct)
  160. #define BASS_DEVICE_CPSPEAKERS  0x400   // detect speakers via Windows control panel
  161. #define BASS_DEVICE_SPEAKERS    0x800   // force enabling of speaker assignment
  162. #define BASS_DEVICE_NOSPEAKER   0x1000  // ignore speaker arrangement
  163. #define BASS_DEVICE_DMIX        0x2000  // use ALSA "dmix" plugin
  164. #define BASS_DEVICE_FREQ        0x4000  // set device sample rate
  165. #define BASS_DEVICE_STEREO      0x8000  // limit output to stereo
  166. #define BASS_DEVICE_HOG         0x10000 // hog/exclusive mode
  167. #define BASS_DEVICE_AUDIOTRACK  0x20000 // use AudioTrack output
  168. #define BASS_DEVICE_DSOUND      0x40000 // use DirectSound output
  169.  
  170. // DirectSound interfaces (for use with BASS_GetDSoundObject)
  171. #define BASS_OBJECT_DS      1   // IDirectSound
  172. #define BASS_OBJECT_DS3DL   2   // IDirectSound3DListener
  173.  
  174. // Device info structure
  175. typedef struct {
  176. #if defined(_WIN32_WCE) || (WINAPI_FAMILY && WINAPI_FAMILY!=WINAPI_FAMILY_DESKTOP_APP)
  177.     const wchar_t *name;    // description
  178.     const wchar_t *driver;  // driver
  179. #else
  180.     const char *name;   // description
  181.     const char *driver; // driver
  182. #endif
  183.     DWORD flags;
  184. } BASS_DEVICEINFO;
  185.  
  186. // BASS_DEVICEINFO flags
  187. #define BASS_DEVICE_ENABLED     1
  188. #define BASS_DEVICE_DEFAULT     2
  189. #define BASS_DEVICE_INIT        4
  190. #define BASS_DEVICE_LOOPBACK    8
  191.  
  192. #define BASS_DEVICE_TYPE_MASK           0xff000000
  193. #define BASS_DEVICE_TYPE_NETWORK        0x01000000
  194. #define BASS_DEVICE_TYPE_SPEAKERS       0x02000000
  195. #define BASS_DEVICE_TYPE_LINE           0x03000000
  196. #define BASS_DEVICE_TYPE_HEADPHONES     0x04000000
  197. #define BASS_DEVICE_TYPE_MICROPHONE     0x05000000
  198. #define BASS_DEVICE_TYPE_HEADSET        0x06000000
  199. #define BASS_DEVICE_TYPE_HANDSET        0x07000000
  200. #define BASS_DEVICE_TYPE_DIGITAL        0x08000000
  201. #define BASS_DEVICE_TYPE_SPDIF          0x09000000
  202. #define BASS_DEVICE_TYPE_HDMI           0x0a000000
  203. #define BASS_DEVICE_TYPE_DISPLAYPORT    0x40000000
  204.  
  205. // BASS_GetDeviceInfo flags
  206. #define BASS_DEVICES_AIRPLAY    0x1000000
  207.  
  208. typedef struct {
  209.     DWORD flags;    // device capabilities (DSCAPS_xxx flags)
  210.     DWORD hwsize;   // size of total device hardware memory
  211.     DWORD hwfree;   // size of free device hardware memory
  212.     DWORD freesam;  // number of free sample slots in the hardware
  213.     DWORD free3d;   // number of free 3D sample slots in the hardware
  214.     DWORD minrate;  // min sample rate supported by the hardware
  215.     DWORD maxrate;  // max sample rate supported by the hardware
  216.     BOOL eax;       // device supports EAX? (always FALSE if BASS_DEVICE_3D was not used)
  217.     DWORD minbuf;   // recommended minimum buffer length in ms (requires BASS_DEVICE_LATENCY)
  218.     DWORD dsver;    // DirectSound version
  219.     DWORD latency;  // delay (in ms) before start of playback (requires BASS_DEVICE_LATENCY)
  220.     DWORD initflags; // BASS_Init "flags" parameter
  221.     DWORD speakers; // number of speakers available
  222.     DWORD freq;     // current output rate
  223. } BASS_INFO;
  224.  
  225. // BASS_INFO flags (from DSOUND.H)
  226. #define DSCAPS_CONTINUOUSRATE   0x00000010  // supports all sample rates between min/maxrate
  227. #define DSCAPS_EMULDRIVER       0x00000020  // device does NOT have hardware DirectSound support
  228. #define DSCAPS_CERTIFIED        0x00000040  // device driver has been certified by Microsoft
  229. #define DSCAPS_SECONDARYMONO    0x00000100  // mono
  230. #define DSCAPS_SECONDARYSTEREO  0x00000200  // stereo
  231. #define DSCAPS_SECONDARY8BIT    0x00000400  // 8 bit
  232. #define DSCAPS_SECONDARY16BIT   0x00000800  // 16 bit
  233.  
  234. // Recording device info structure
  235. typedef struct {
  236.     DWORD flags;    // device capabilities (DSCCAPS_xxx flags)
  237.     DWORD formats;  // supported standard formats (WAVE_FORMAT_xxx flags)
  238.     DWORD inputs;   // number of inputs
  239.     BOOL singlein;  // TRUE = only 1 input can be set at a time
  240.     DWORD freq;     // current input rate
  241. } BASS_RECORDINFO;
  242.  
  243. // BASS_RECORDINFO flags (from DSOUND.H)
  244. #define DSCCAPS_EMULDRIVER      DSCAPS_EMULDRIVER   // device does NOT have hardware DirectSound recording support
  245. #define DSCCAPS_CERTIFIED       DSCAPS_CERTIFIED    // device driver has been certified by Microsoft
  246.  
  247. // defines for formats field of BASS_RECORDINFO (from MMSYSTEM.H)
  248. #ifndef WAVE_FORMAT_1M08
  249. #define WAVE_FORMAT_1M08       0x00000001       /* 11.025 kHz, Mono,   8-bit  */
  250. #define WAVE_FORMAT_1S08       0x00000002       /* 11.025 kHz, Stereo, 8-bit  */
  251. #define WAVE_FORMAT_1M16       0x00000004       /* 11.025 kHz, Mono,   16-bit */
  252. #define WAVE_FORMAT_1S16       0x00000008       /* 11.025 kHz, Stereo, 16-bit */
  253. #define WAVE_FORMAT_2M08       0x00000010       /* 22.05  kHz, Mono,   8-bit  */
  254. #define WAVE_FORMAT_2S08       0x00000020       /* 22.05  kHz, Stereo, 8-bit  */
  255. #define WAVE_FORMAT_2M16       0x00000040       /* 22.05  kHz, Mono,   16-bit */
  256. #define WAVE_FORMAT_2S16       0x00000080       /* 22.05  kHz, Stereo, 16-bit */
  257. #define WAVE_FORMAT_4M08       0x00000100       /* 44.1   kHz, Mono,   8-bit  */
  258. #define WAVE_FORMAT_4S08       0x00000200       /* 44.1   kHz, Stereo, 8-bit  */
  259. #define WAVE_FORMAT_4M16       0x00000400       /* 44.1   kHz, Mono,   16-bit */
  260. #define WAVE_FORMAT_4S16       0x00000800       /* 44.1   kHz, Stereo, 16-bit */
  261. #endif
  262.  
  263. // Sample info structure
  264. typedef struct {
  265.     DWORD freq;     // default playback rate
  266.     float volume;   // default volume (0-1)
  267.     float pan;      // default pan (-1=left, 0=middle, 1=right)
  268.     DWORD flags;    // BASS_SAMPLE_xxx flags
  269.     DWORD length;   // length (in bytes)
  270.     DWORD max;      // maximum simultaneous playbacks
  271.     DWORD origres;  // original resolution
  272.     DWORD chans;    // number of channels
  273.     DWORD mingap;   // minimum gap (ms) between creating channels
  274.     DWORD mode3d;   // BASS_3DMODE_xxx mode
  275.     float mindist;  // minimum distance
  276.     float maxdist;  // maximum distance
  277.     DWORD iangle;   // angle of inside projection cone
  278.     DWORD oangle;   // angle of outside projection cone
  279.     float outvol;   // delta-volume outside the projection cone
  280.     DWORD vam;      // voice allocation/management flags (BASS_VAM_xxx)
  281.     DWORD priority; // priority (0=lowest, 0xffffffff=highest)
  282. } BASS_SAMPLE;
  283.  
  284. #define BASS_SAMPLE_8BITS       1   // 8 bit
  285. #define BASS_SAMPLE_FLOAT       256 // 32 bit floating-point
  286. #define BASS_SAMPLE_MONO        2   // mono
  287. #define BASS_SAMPLE_LOOP        4   // looped
  288. #define BASS_SAMPLE_3D          8   // 3D functionality
  289. #define BASS_SAMPLE_SOFTWARE    16  // not using hardware mixing
  290. #define BASS_SAMPLE_MUTEMAX     32  // mute at max distance (3D only)
  291. #define BASS_SAMPLE_VAM         64  // DX7 voice allocation & management
  292. #define BASS_SAMPLE_FX          128 // old implementation of DX8 effects
  293. #define BASS_SAMPLE_OVER_VOL    0x10000 // override lowest volume
  294. #define BASS_SAMPLE_OVER_POS    0x20000 // override longest playing
  295. #define BASS_SAMPLE_OVER_DIST   0x30000 // override furthest from listener (3D only)
  296.  
  297. #define BASS_STREAM_PRESCAN     0x20000 // enable pin-point seeking/length (MP3/MP2/MP1)
  298. #define BASS_STREAM_AUTOFREE    0x40000 // automatically free the stream when it stop/ends
  299. #define BASS_STREAM_RESTRATE    0x80000 // restrict the download rate of internet file streams
  300. #define BASS_STREAM_BLOCK       0x100000 // download/play internet file stream in small blocks
  301. #define BASS_STREAM_DECODE      0x200000 // don't play the stream, only decode (BASS_ChannelGetData)
  302. #define BASS_STREAM_STATUS      0x800000 // give server status info (HTTP/ICY tags) in DOWNLOADPROC
  303.  
  304. #define BASS_MP3_IGNOREDELAY    0x200 // ignore LAME/Xing/VBRI/iTunes delay & padding info
  305. #define BASS_MP3_SETPOS         BASS_STREAM_PRESCAN
  306.  
  307. #define BASS_MUSIC_FLOAT        BASS_SAMPLE_FLOAT
  308. #define BASS_MUSIC_MONO         BASS_SAMPLE_MONO
  309. #define BASS_MUSIC_LOOP         BASS_SAMPLE_LOOP
  310. #define BASS_MUSIC_3D           BASS_SAMPLE_3D
  311. #define BASS_MUSIC_FX           BASS_SAMPLE_FX
  312. #define BASS_MUSIC_AUTOFREE     BASS_STREAM_AUTOFREE
  313. #define BASS_MUSIC_DECODE       BASS_STREAM_DECODE
  314. #define BASS_MUSIC_PRESCAN      BASS_STREAM_PRESCAN // calculate playback length
  315. #define BASS_MUSIC_CALCLEN      BASS_MUSIC_PRESCAN
  316. #define BASS_MUSIC_RAMP         0x200   // normal ramping
  317. #define BASS_MUSIC_RAMPS        0x400   // sensitive ramping
  318. #define BASS_MUSIC_SURROUND     0x800   // surround sound
  319. #define BASS_MUSIC_SURROUND2    0x1000  // surround sound (mode 2)
  320. #define BASS_MUSIC_FT2PAN       0x2000  // apply FastTracker 2 panning to XM files
  321. #define BASS_MUSIC_FT2MOD       0x2000  // play .MOD as FastTracker 2 does
  322. #define BASS_MUSIC_PT1MOD       0x4000  // play .MOD as ProTracker 1 does
  323. #define BASS_MUSIC_NONINTER     0x10000 // non-interpolated sample mixing
  324. #define BASS_MUSIC_SINCINTER    0x800000 // sinc interpolated sample mixing
  325. #define BASS_MUSIC_POSRESET     0x8000  // stop all notes when moving position
  326. #define BASS_MUSIC_POSRESETEX   0x400000 // stop all notes and reset bmp/etc when moving position
  327. #define BASS_MUSIC_STOPBACK     0x80000 // stop the music on a backwards jump effect
  328. #define BASS_MUSIC_NOSAMPLE     0x100000 // don't load the samples
  329.  
  330. // Speaker assignment flags
  331. #define BASS_SPEAKER_FRONT  0x1000000   // front speakers
  332. #define BASS_SPEAKER_REAR   0x2000000   // rear/side speakers
  333. #define BASS_SPEAKER_CENLFE 0x3000000   // center & LFE speakers (5.1)
  334. #define BASS_SPEAKER_REAR2  0x4000000   // rear center speakers (7.1)
  335. #define BASS_SPEAKER_N(n)   ((n)<<24)   // n'th pair of speakers (max 15)
  336. #define BASS_SPEAKER_LEFT   0x10000000  // modifier: left
  337. #define BASS_SPEAKER_RIGHT  0x20000000  // modifier: right
  338. #define BASS_SPEAKER_FRONTLEFT  BASS_SPEAKER_FRONT|BASS_SPEAKER_LEFT
  339. #define BASS_SPEAKER_FRONTRIGHT BASS_SPEAKER_FRONT|BASS_SPEAKER_RIGHT
  340. #define BASS_SPEAKER_REARLEFT   BASS_SPEAKER_REAR|BASS_SPEAKER_LEFT
  341. #define BASS_SPEAKER_REARRIGHT  BASS_SPEAKER_REAR|BASS_SPEAKER_RIGHT
  342. #define BASS_SPEAKER_CENTER     BASS_SPEAKER_CENLFE|BASS_SPEAKER_LEFT
  343. #define BASS_SPEAKER_LFE        BASS_SPEAKER_CENLFE|BASS_SPEAKER_RIGHT
  344. #define BASS_SPEAKER_REAR2LEFT  BASS_SPEAKER_REAR2|BASS_SPEAKER_LEFT
  345. #define BASS_SPEAKER_REAR2RIGHT BASS_SPEAKER_REAR2|BASS_SPEAKER_RIGHT
  346.  
  347. #define BASS_ASYNCFILE          0x40000000
  348. #define BASS_UNICODE            0x80000000
  349.  
  350. #define BASS_RECORD_PAUSE       0x8000  // start recording paused
  351. #define BASS_RECORD_ECHOCANCEL  0x2000
  352. #define BASS_RECORD_AGC         0x4000
  353.  
  354. // DX7 voice allocation & management flags
  355. #define BASS_VAM_HARDWARE       1
  356. #define BASS_VAM_SOFTWARE       2
  357. #define BASS_VAM_TERM_TIME      4
  358. #define BASS_VAM_TERM_DIST      8
  359. #define BASS_VAM_TERM_PRIO      16
  360.  
  361. // Channel info structure
  362. typedef struct {
  363.     DWORD freq;     // default playback rate
  364.     DWORD chans;    // channels
  365.     DWORD flags;    // BASS_SAMPLE/STREAM/MUSIC/SPEAKER flags
  366.     DWORD ctype;    // type of channel
  367.     DWORD origres;  // original resolution
  368.     HPLUGIN plugin; // plugin
  369.     HSAMPLE sample; // sample
  370.     const char *filename; // filename
  371. } BASS_CHANNELINFO;
  372.  
  373. #define BASS_ORIGRES_FLOAT      0x10000
  374.  
  375. // BASS_CHANNELINFO types
  376. #define BASS_CTYPE_SAMPLE       1
  377. #define BASS_CTYPE_RECORD       2
  378. #define BASS_CTYPE_STREAM       0x10000
  379. #define BASS_CTYPE_STREAM_OGG   0x10002
  380. #define BASS_CTYPE_STREAM_MP1   0x10003
  381. #define BASS_CTYPE_STREAM_MP2   0x10004
  382. #define BASS_CTYPE_STREAM_MP3   0x10005
  383. #define BASS_CTYPE_STREAM_AIFF  0x10006
  384. #define BASS_CTYPE_STREAM_CA    0x10007
  385. #define BASS_CTYPE_STREAM_MF    0x10008
  386. #define BASS_CTYPE_STREAM_AM    0x10009
  387. #define BASS_CTYPE_STREAM_DUMMY     0x18000
  388. #define BASS_CTYPE_STREAM_DEVICE    0x18001
  389. #define BASS_CTYPE_STREAM_WAV   0x40000 // WAVE flag, LOWORD=codec
  390. #define BASS_CTYPE_STREAM_WAV_PCM   0x50001
  391. #define BASS_CTYPE_STREAM_WAV_FLOAT 0x50003
  392. #define BASS_CTYPE_MUSIC_MOD    0x20000
  393. #define BASS_CTYPE_MUSIC_MTM    0x20001
  394. #define BASS_CTYPE_MUSIC_S3M    0x20002
  395. #define BASS_CTYPE_MUSIC_XM     0x20003
  396. #define BASS_CTYPE_MUSIC_IT     0x20004
  397. #define BASS_CTYPE_MUSIC_MO3    0x00100 // MO3 flag
  398.  
  399. typedef struct {
  400.     DWORD ctype;        // channel type
  401. #if defined(_WIN32_WCE) || (WINAPI_FAMILY && WINAPI_FAMILY!=WINAPI_FAMILY_DESKTOP_APP)
  402.     const wchar_t *name;    // format description
  403.     const wchar_t *exts;    // file extension filter (*.ext1;*.ext2;etc...)
  404. #else
  405.     const char *name;   // format description
  406.     const char *exts;   // file extension filter (*.ext1;*.ext2;etc...)
  407. #endif
  408. } BASS_PLUGINFORM;
  409.  
  410. typedef struct {
  411.     DWORD version;                  // version (same form as BASS_GetVersion)
  412.     DWORD formatc;                  // number of formats
  413.     const BASS_PLUGINFORM *formats; // the array of formats
  414. } BASS_PLUGININFO;
  415.  
  416. // 3D vector (for 3D positions/velocities/orientations)
  417. typedef struct BASS_3DVECTOR {
  418. #ifdef __cplusplus
  419.     BASS_3DVECTOR() {};
  420.     BASS_3DVECTOR(float _x, float _y, float _z) : x(_x), y(_y), z(_z) {};
  421. #endif
  422.     float x;    // +=right, -=left
  423.     float y;    // +=up, -=down
  424.     float z;    // +=front, -=behind
  425. } BASS_3DVECTOR;
  426.  
  427. // 3D channel modes
  428. #define BASS_3DMODE_NORMAL      0   // normal 3D processing
  429. #define BASS_3DMODE_RELATIVE    1   // position is relative to the listener
  430. #define BASS_3DMODE_OFF         2   // no 3D processing
  431.  
  432. // software 3D mixing algorithms (used with BASS_CONFIG_3DALGORITHM)
  433. #define BASS_3DALG_DEFAULT  0
  434. #define BASS_3DALG_OFF      1
  435. #define BASS_3DALG_FULL     2
  436. #define BASS_3DALG_LIGHT    3
  437.  
  438. // EAX environments, use with BASS_SetEAXParameters
  439. enum
  440. {
  441.     EAX_ENVIRONMENT_GENERIC,
  442.     EAX_ENVIRONMENT_PADDEDCELL,
  443.     EAX_ENVIRONMENT_ROOM,
  444.     EAX_ENVIRONMENT_BATHROOM,
  445.     EAX_ENVIRONMENT_LIVINGROOM,
  446.     EAX_ENVIRONMENT_STONEROOM,
  447.     EAX_ENVIRONMENT_AUDITORIUM,
  448.     EAX_ENVIRONMENT_CONCERTHALL,
  449.     EAX_ENVIRONMENT_CAVE,
  450.     EAX_ENVIRONMENT_ARENA,
  451.     EAX_ENVIRONMENT_HANGAR,
  452.     EAX_ENVIRONMENT_CARPETEDHALLWAY,
  453.     EAX_ENVIRONMENT_HALLWAY,
  454.     EAX_ENVIRONMENT_STONECORRIDOR,
  455.     EAX_ENVIRONMENT_ALLEY,
  456.     EAX_ENVIRONMENT_FOREST,
  457.     EAX_ENVIRONMENT_CITY,
  458.     EAX_ENVIRONMENT_MOUNTAINS,
  459.     EAX_ENVIRONMENT_QUARRY,
  460.     EAX_ENVIRONMENT_PLAIN,
  461.     EAX_ENVIRONMENT_PARKINGLOT,
  462.     EAX_ENVIRONMENT_SEWERPIPE,
  463.     EAX_ENVIRONMENT_UNDERWATER,
  464.     EAX_ENVIRONMENT_DRUGGED,
  465.     EAX_ENVIRONMENT_DIZZY,
  466.     EAX_ENVIRONMENT_PSYCHOTIC,
  467.  
  468.     EAX_ENVIRONMENT_COUNT           // total number of environments
  469. };
  470.  
  471. // EAX presets, usage: BASS_SetEAXParameters(EAX_PRESET_xxx)
  472. #define EAX_PRESET_GENERIC         EAX_ENVIRONMENT_GENERIC,0.5F,1.493F,0.5F
  473. #define EAX_PRESET_PADDEDCELL      EAX_ENVIRONMENT_PADDEDCELL,0.25F,0.1F,0.0F
  474. #define EAX_PRESET_ROOM            EAX_ENVIRONMENT_ROOM,0.417F,0.4F,0.666F
  475. #define EAX_PRESET_BATHROOM        EAX_ENVIRONMENT_BATHROOM,0.653F,1.499F,0.166F
  476. #define EAX_PRESET_LIVINGROOM      EAX_ENVIRONMENT_LIVINGROOM,0.208F,0.478F,0.0F
  477. #define EAX_PRESET_STONEROOM       EAX_ENVIRONMENT_STONEROOM,0.5F,2.309F,0.888F
  478. #define EAX_PRESET_AUDITORIUM      EAX_ENVIRONMENT_AUDITORIUM,0.403F,4.279F,0.5F
  479. #define EAX_PRESET_CONCERTHALL     EAX_ENVIRONMENT_CONCERTHALL,0.5F,3.961F,0.5F
  480. #define EAX_PRESET_CAVE            EAX_ENVIRONMENT_CAVE,0.5F,2.886F,1.304F
  481. #define EAX_PRESET_ARENA           EAX_ENVIRONMENT_ARENA,0.361F,7.284F,0.332F
  482. #define EAX_PRESET_HANGAR          EAX_ENVIRONMENT_HANGAR,0.5F,10.0F,0.3F
  483. #define EAX_PRESET_CARPETEDHALLWAY EAX_ENVIRONMENT_CARPETEDHALLWAY,0.153F,0.259F,2.0F
  484. #define EAX_PRESET_HALLWAY         EAX_ENVIRONMENT_HALLWAY,0.361F,1.493F,0.0F
  485. #define EAX_PRESET_STONECORRIDOR   EAX_ENVIRONMENT_STONECORRIDOR,0.444F,2.697F,0.638F
  486. #define EAX_PRESET_ALLEY           EAX_ENVIRONMENT_ALLEY,0.25F,1.752F,0.776F
  487. #define EAX_PRESET_FOREST          EAX_ENVIRONMENT_FOREST,0.111F,3.145F,0.472F
  488. #define EAX_PRESET_CITY            EAX_ENVIRONMENT_CITY,0.111F,2.767F,0.224F
  489. #define EAX_PRESET_MOUNTAINS       EAX_ENVIRONMENT_MOUNTAINS,0.194F,7.841F,0.472F
  490. #define EAX_PRESET_QUARRY          EAX_ENVIRONMENT_QUARRY,1.0F,1.499F,0.5F
  491. #define EAX_PRESET_PLAIN           EAX_ENVIRONMENT_PLAIN,0.097F,2.767F,0.224F
  492. #define EAX_PRESET_PARKINGLOT      EAX_ENVIRONMENT_PARKINGLOT,0.208F,1.652F,1.5F
  493. #define EAX_PRESET_SEWERPIPE       EAX_ENVIRONMENT_SEWERPIPE,0.652F,2.886F,0.25F
  494. #define EAX_PRESET_UNDERWATER      EAX_ENVIRONMENT_UNDERWATER,1.0F,1.499F,0.0F
  495. #define EAX_PRESET_DRUGGED         EAX_ENVIRONMENT_DRUGGED,0.875F,8.392F,1.388F
  496. #define EAX_PRESET_DIZZY           EAX_ENVIRONMENT_DIZZY,0.139F,17.234F,0.666F
  497. #define EAX_PRESET_PSYCHOTIC       EAX_ENVIRONMENT_PSYCHOTIC,0.486F,7.563F,0.806F
  498.  
  499. typedef DWORD (CALLBACK STREAMPROC)(HSTREAM handle, void *buffer, DWORD length, void *user);
  500. /* User stream callback function. NOTE: A stream function should obviously be as quick
  501. as possible, other streams (and MOD musics) can't be mixed until it's finished.
  502. handle : The stream that needs writing
  503. buffer : Buffer to write the samples in
  504. length : Number of bytes to write
  505. user   : The 'user' parameter value given when calling BASS_StreamCreate
  506. RETURN : Number of bytes written. Set the BASS_STREAMPROC_END flag to end the stream. */
  507.  
  508. #define BASS_STREAMPROC_END     0x80000000  // end of user stream flag
  509.  
  510. // special STREAMPROCs
  511. #define STREAMPROC_DUMMY        (STREAMPROC*)0      // "dummy" stream
  512. #define STREAMPROC_PUSH         (STREAMPROC*)-1     // push stream
  513. #define STREAMPROC_DEVICE       (STREAMPROC*)-2     // device mix stream
  514. #define STREAMPROC_DEVICE_3D    (STREAMPROC*)-3     // device 3D mix stream
  515.  
  516. // BASS_StreamCreateFileUser file systems
  517. #define STREAMFILE_NOBUFFER     0
  518. #define STREAMFILE_BUFFER       1
  519. #define STREAMFILE_BUFFERPUSH   2
  520.  
  521. // User file stream callback functions
  522. typedef void (CALLBACK FILECLOSEPROC)(void *user);
  523. typedef QWORD (CALLBACK FILELENPROC)(void *user);
  524. typedef DWORD (CALLBACK FILEREADPROC)(void *buffer, DWORD length, void *user);
  525. typedef BOOL (CALLBACK FILESEEKPROC)(QWORD offset, void *user);
  526.  
  527. typedef struct {
  528.     FILECLOSEPROC *close;
  529.     FILELENPROC *length;
  530.     FILEREADPROC *read;
  531.     FILESEEKPROC *seek;
  532. } BASS_FILEPROCS;
  533.  
  534. // BASS_StreamPutFileData options
  535. #define BASS_FILEDATA_END       0   // end & close the file
  536.  
  537. // BASS_StreamGetFilePosition modes
  538. #define BASS_FILEPOS_CURRENT    0
  539. #define BASS_FILEPOS_DECODE     BASS_FILEPOS_CURRENT
  540. #define BASS_FILEPOS_DOWNLOAD   1
  541. #define BASS_FILEPOS_END        2
  542. #define BASS_FILEPOS_START      3
  543. #define BASS_FILEPOS_CONNECTED  4
  544. #define BASS_FILEPOS_BUFFER     5
  545. #define BASS_FILEPOS_SOCKET     6
  546. #define BASS_FILEPOS_ASYNCBUF   7
  547. #define BASS_FILEPOS_SIZE       8
  548. #define BASS_FILEPOS_BUFFERING  9
  549.  
  550. typedef void (CALLBACK DOWNLOADPROC)(const void *buffer, DWORD length, void *user);
  551. /* Internet stream download callback function.
  552. buffer : Buffer containing the downloaded data... NULL=end of download
  553. length : Number of bytes in the buffer
  554. user   : The 'user' parameter value given when calling BASS_StreamCreateURL */
  555.  
  556. // BASS_ChannelSetSync types
  557. #define BASS_SYNC_POS           0
  558. #define BASS_SYNC_END           2
  559. #define BASS_SYNC_META          4
  560. #define BASS_SYNC_SLIDE         5
  561. #define BASS_SYNC_STALL         6
  562. #define BASS_SYNC_DOWNLOAD      7
  563. #define BASS_SYNC_FREE          8
  564. #define BASS_SYNC_SETPOS        11
  565. #define BASS_SYNC_MUSICPOS      10
  566. #define BASS_SYNC_MUSICINST     1
  567. #define BASS_SYNC_MUSICFX       3
  568. #define BASS_SYNC_OGG_CHANGE    12
  569. #define BASS_SYNC_DEV_FAIL      14
  570. #define BASS_SYNC_DEV_FORMAT    15
  571. #define BASS_SYNC_MIXTIME       0x40000000  // flag: sync at mixtime, else at playtime
  572. #define BASS_SYNC_ONETIME       0x80000000  // flag: sync only once, else continuously
  573.  
  574. typedef void (CALLBACK SYNCPROC)(HSYNC handle, DWORD channel, DWORD data, void *user);
  575. /* Sync callback function. NOTE: a sync callback function should be very
  576. quick as other syncs can't be processed until it has finished. If the sync
  577. is a "mixtime" sync, then other streams and MOD musics can't be mixed until
  578. it's finished either.
  579. handle : The sync that has occured
  580. channel: Channel that the sync occured in
  581. data   : Additional data associated with the sync's occurance
  582. user   : The 'user' parameter given when calling BASS_ChannelSetSync */
  583.  
  584. typedef void (CALLBACK DSPPROC)(HDSP handle, DWORD channel, void *buffer, DWORD length, void *user);
  585. /* DSP callback function. NOTE: A DSP function should obviously be as quick as
  586. possible... other DSP functions, streams and MOD musics can not be processed
  587. until it's finished.
  588. handle : The DSP handle
  589. channel: Channel that the DSP is being applied to
  590. buffer : Buffer to apply the DSP to
  591. length : Number of bytes in the buffer
  592. user   : The 'user' parameter given when calling BASS_ChannelSetDSP */
  593.  
  594. typedef BOOL (CALLBACK RECORDPROC)(HRECORD handle, const void *buffer, DWORD length, void *user);
  595. /* Recording callback function.
  596. handle : The recording handle
  597. buffer : Buffer containing the recorded sample data
  598. length : Number of bytes
  599. user   : The 'user' parameter value given when calling BASS_RecordStart
  600. RETURN : TRUE = continue recording, FALSE = stop */
  601.  
  602. // BASS_ChannelIsActive return values
  603. #define BASS_ACTIVE_STOPPED         0
  604. #define BASS_ACTIVE_PLAYING         1
  605. #define BASS_ACTIVE_STALLED         2
  606. #define BASS_ACTIVE_PAUSED          3
  607. #define BASS_ACTIVE_PAUSED_DEVICE   4
  608.  
  609. // Channel attributes
  610. #define BASS_ATTRIB_FREQ            1
  611. #define BASS_ATTRIB_VOL             2
  612. #define BASS_ATTRIB_PAN             3
  613. #define BASS_ATTRIB_EAXMIX          4
  614. #define BASS_ATTRIB_NOBUFFER        5
  615. #define BASS_ATTRIB_VBR             6
  616. #define BASS_ATTRIB_CPU             7
  617. #define BASS_ATTRIB_SRC             8
  618. #define BASS_ATTRIB_NET_RESUME      9
  619. #define BASS_ATTRIB_SCANINFO        10
  620. #define BASS_ATTRIB_NORAMP          11
  621. #define BASS_ATTRIB_BITRATE         12
  622. #define BASS_ATTRIB_BUFFER          13
  623. #define BASS_ATTRIB_MUSIC_AMPLIFY   0x100
  624. #define BASS_ATTRIB_MUSIC_PANSEP    0x101
  625. #define BASS_ATTRIB_MUSIC_PSCALER   0x102
  626. #define BASS_ATTRIB_MUSIC_BPM       0x103
  627. #define BASS_ATTRIB_MUSIC_SPEED     0x104
  628. #define BASS_ATTRIB_MUSIC_VOL_GLOBAL 0x105
  629. #define BASS_ATTRIB_MUSIC_ACTIVE    0x106
  630. #define BASS_ATTRIB_MUSIC_VOL_CHAN  0x200 // + channel #
  631. #define BASS_ATTRIB_MUSIC_VOL_INST  0x300 // + instrument #
  632.  
  633. // BASS_ChannelSlideAttribute flags
  634. #define BASS_SLIDE_LOG              0x1000000
  635.  
  636. // BASS_ChannelGetData flags
  637. #define BASS_DATA_AVAILABLE 0           // query how much data is buffered
  638. #define BASS_DATA_FIXED     0x20000000  // flag: return 8.24 fixed-point data
  639. #define BASS_DATA_FLOAT     0x40000000  // flag: return floating-point sample data
  640. #define BASS_DATA_FFT256    0x80000000  // 256 sample FFT
  641. #define BASS_DATA_FFT512    0x80000001  // 512 FFT
  642. #define BASS_DATA_FFT1024   0x80000002  // 1024 FFT
  643. #define BASS_DATA_FFT2048   0x80000003  // 2048 FFT
  644. #define BASS_DATA_FFT4096   0x80000004  // 4096 FFT
  645. #define BASS_DATA_FFT8192   0x80000005  // 8192 FFT
  646. #define BASS_DATA_FFT16384  0x80000006  // 16384 FFT
  647. #define BASS_DATA_FFT32768  0x80000007  // 32768 FFT
  648. #define BASS_DATA_FFT_INDIVIDUAL 0x10   // FFT flag: FFT for each channel, else all combined
  649. #define BASS_DATA_FFT_NOWINDOW  0x20    // FFT flag: no Hanning window
  650. #define BASS_DATA_FFT_REMOVEDC  0x40    // FFT flag: pre-remove DC bias
  651. #define BASS_DATA_FFT_COMPLEX   0x80    // FFT flag: return complex data
  652. #define BASS_DATA_FFT_NYQUIST   0x100   // FFT flag: return extra Nyquist value
  653.  
  654. // BASS_ChannelGetLevelEx flags
  655. #define BASS_LEVEL_MONO     1
  656. #define BASS_LEVEL_STEREO   2
  657. #define BASS_LEVEL_RMS      4
  658. #define BASS_LEVEL_VOLPAN   8
  659.  
  660. // BASS_ChannelGetTags types : what's returned
  661. #define BASS_TAG_ID3        0   // ID3v1 tags : TAG_ID3 structure
  662. #define BASS_TAG_ID3V2      1   // ID3v2 tags : variable length block
  663. #define BASS_TAG_OGG        2   // OGG comments : series of null-terminated UTF-8 strings
  664. #define BASS_TAG_HTTP       3   // HTTP headers : series of null-terminated ANSI strings
  665. #define BASS_TAG_ICY        4   // ICY headers : series of null-terminated ANSI strings
  666. #define BASS_TAG_META       5   // ICY metadata : ANSI string
  667. #define BASS_TAG_APE        6   // APE tags : series of null-terminated UTF-8 strings
  668. #define BASS_TAG_MP4        7   // MP4/iTunes metadata : series of null-terminated UTF-8 strings
  669. #define BASS_TAG_WMA        8   // WMA tags : series of null-terminated UTF-8 strings
  670. #define BASS_TAG_VENDOR     9   // OGG encoder : UTF-8 string
  671. #define BASS_TAG_LYRICS3    10  // Lyric3v2 tag : ASCII string
  672. #define BASS_TAG_CA_CODEC   11  // CoreAudio codec info : TAG_CA_CODEC structure
  673. #define BASS_TAG_MF         13  // Media Foundation tags : series of null-terminated UTF-8 strings
  674. #define BASS_TAG_WAVEFORMAT 14  // WAVE format : WAVEFORMATEEX structure
  675. #define BASS_TAG_AM_MIME    15  // Android Media MIME type : ASCII string
  676. #define BASS_TAG_AM_NAME    16  // Android Media codec name : ASCII string
  677. #define BASS_TAG_RIFF_INFO  0x100 // RIFF "INFO" tags : series of null-terminated ANSI strings
  678. #define BASS_TAG_RIFF_BEXT  0x101 // RIFF/BWF "bext" tags : TAG_BEXT structure
  679. #define BASS_TAG_RIFF_CART  0x102 // RIFF/BWF "cart" tags : TAG_CART structure
  680. #define BASS_TAG_RIFF_DISP  0x103 // RIFF "DISP" text tag : ANSI string
  681. #define BASS_TAG_RIFF_CUE   0x104 // RIFF "cue " chunk : TAG_CUE structure
  682. #define BASS_TAG_RIFF_SMPL  0x105 // RIFF "smpl" chunk : TAG_SMPL structure
  683. #define BASS_TAG_APE_BINARY 0x1000  // + index #, binary APE tag : TAG_APE_BINARY structure
  684. #define BASS_TAG_MUSIC_NAME     0x10000 // MOD music name : ANSI string
  685. #define BASS_TAG_MUSIC_MESSAGE  0x10001 // MOD message : ANSI string
  686. #define BASS_TAG_MUSIC_ORDERS   0x10002 // MOD order list : BYTE array of pattern numbers
  687. #define BASS_TAG_MUSIC_AUTH     0x10003 // MOD author : UTF-8 string
  688. #define BASS_TAG_MUSIC_INST     0x10100 // + instrument #, MOD instrument name : ANSI string
  689. #define BASS_TAG_MUSIC_SAMPLE   0x10300 // + sample #, MOD sample name : ANSI string
  690.  
  691. // ID3v1 tag structure
  692. typedef struct {
  693.     char id[3];
  694.     char title[30];
  695.     char artist[30];
  696.     char album[30];
  697.     char year[4];
  698.     char comment[30];
  699.     BYTE genre;
  700. } TAG_ID3;
  701.  
  702. // Binary APE tag structure
  703. typedef struct {
  704.     const char *key;
  705.     const void *data;
  706.     DWORD length;
  707. } TAG_APE_BINARY;
  708.  
  709. // BWF "bext" tag structure
  710. #ifdef _MSC_VER
  711. #pragma warning(push)
  712. #pragma warning(disable:4200)
  713. #endif
  714. #pragma pack(push,1)
  715. typedef struct {
  716.     char Description[256];          // description
  717.     char Originator[32];            // name of the originator
  718.     char OriginatorReference[32];   // reference of the originator
  719.     char OriginationDate[10];       // date of creation (yyyy-mm-dd)
  720.     char OriginationTime[8];        // time of creation (hh-mm-ss)
  721.     QWORD TimeReference;            // first sample count since midnight (little-endian)
  722.     WORD Version;                   // BWF version (little-endian)
  723.     BYTE UMID[64];                  // SMPTE UMID
  724.     BYTE Reserved[190];
  725. #if defined(__GNUC__) && __GNUC__<3
  726.     char CodingHistory[0];          // history
  727. #elif 1 // change to 0 if compiler fails the following line
  728.     char CodingHistory[];           // history
  729. #else
  730.     char CodingHistory[1];          // history
  731. #endif
  732. } TAG_BEXT;
  733. #pragma pack(pop)
  734.  
  735. // BWF "cart" tag structures
  736. typedef struct
  737. {
  738.     DWORD dwUsage;                  // FOURCC timer usage ID
  739.     DWORD dwValue;                  // timer value in samples from head
  740. } TAG_CART_TIMER;
  741.  
  742. typedef struct
  743. {
  744.     char Version[4];                // version of the data structure
  745.     char Title[64];                 // title of cart audio sequence
  746.     char Artist[64];                // artist or creator name
  747.     char CutID[64];                 // cut number identification
  748.     char ClientID[64];              // client identification
  749.     char Category[64];              // category ID, PSA, NEWS, etc
  750.     char Classification[64];        // classification or auxiliary key
  751.     char OutCue[64];                // out cue text
  752.     char StartDate[10];             // yyyy-mm-dd
  753.     char StartTime[8];              // hh:mm:ss
  754.     char EndDate[10];               // yyyy-mm-dd
  755.     char EndTime[8];                // hh:mm:ss
  756.     char ProducerAppID[64];         // name of vendor or application
  757.     char ProducerAppVersion[64];    // version of producer application
  758.     char UserDef[64];               // user defined text
  759.     DWORD dwLevelReference;         // sample value for 0 dB reference
  760.     TAG_CART_TIMER PostTimer[8];    // 8 time markers after head
  761.     char Reserved[276];
  762.     char URL[1024];                 // uniform resource locator
  763. #if defined(__GNUC__) && __GNUC__<3
  764.     char TagText[0];                // free form text for scripts or tags
  765. #elif 1 // change to 0 if compiler fails the following line
  766.     char TagText[];                 // free form text for scripts or tags
  767. #else
  768.     char TagText[1];                // free form text for scripts or tags
  769. #endif
  770. } TAG_CART;
  771.  
  772. // RIFF "cue " tag structures
  773. typedef struct
  774. {
  775.     DWORD dwName;
  776.     DWORD dwPosition;
  777.     DWORD fccChunk;
  778.     DWORD dwChunkStart;
  779.     DWORD dwBlockStart;
  780.     DWORD dwSampleOffset;
  781. } TAG_CUE_POINT;
  782.  
  783. typedef struct
  784. {
  785.     DWORD dwCuePoints;
  786. #if defined(__GNUC__) && __GNUC__<3
  787.     TAG_CUE_POINT CuePoints[0];
  788. #elif 1 // change to 0 if compiler fails the following line
  789.     TAG_CUE_POINT CuePoints[];
  790. #else
  791.     TAG_CUE_POINT CuePoints[1];
  792. #endif
  793. } TAG_CUE;
  794.  
  795. // RIFF "smpl" tag structures
  796. typedef struct
  797. {
  798.     DWORD dwIdentifier;
  799.     DWORD dwType;
  800.     DWORD dwStart;
  801.     DWORD dwEnd;
  802.     DWORD dwFraction;
  803.     DWORD dwPlayCount;
  804. } TAG_SMPL_LOOP;
  805.  
  806. typedef struct
  807. {
  808.     DWORD dwManufacturer;
  809.     DWORD dwProduct;
  810.     DWORD dwSamplePeriod;
  811.     DWORD dwMIDIUnityNote;
  812.     DWORD dwMIDIPitchFraction;
  813.     DWORD dwSMPTEFormat;
  814.     DWORD dwSMPTEOffset;
  815.     DWORD cSampleLoops;
  816.     DWORD cbSamplerData;
  817. #if defined(__GNUC__) && __GNUC__<3
  818.     TAG_SMPL_LOOP SampleLoops[0];
  819. #elif 1 // change to 0 if compiler fails the following line
  820.     TAG_SMPL_LOOP SampleLoops[];
  821. #else
  822.     TAG_SMPL_LOOP SampleLoops[1];
  823. #endif
  824. } TAG_SMPL;
  825. #ifdef _MSC_VER
  826. #pragma warning(pop)
  827. #endif
  828.  
  829. // CoreAudio codec info structure
  830. typedef struct {
  831.     DWORD ftype;                    // file format
  832.     DWORD atype;                    // audio format
  833.     const char *name;               // description
  834. } TAG_CA_CODEC;
  835.  
  836. #ifndef _WAVEFORMATEX_
  837. #define _WAVEFORMATEX_
  838. #pragma pack(push,1)
  839. typedef struct tWAVEFORMATEX
  840. {
  841.     WORD wFormatTag;
  842.     WORD nChannels;
  843.     DWORD nSamplesPerSec;
  844.     DWORD nAvgBytesPerSec;
  845.     WORD nBlockAlign;
  846.     WORD wBitsPerSample;
  847.     WORD cbSize;
  848. } WAVEFORMATEX, *PWAVEFORMATEX, *LPWAVEFORMATEX;
  849. typedef const WAVEFORMATEX *LPCWAVEFORMATEX;
  850. #pragma pack(pop)
  851. #endif
  852.  
  853. // BASS_ChannelGetLength/GetPosition/SetPosition modes
  854. #define BASS_POS_BYTE           0       // byte position
  855. #define BASS_POS_MUSIC_ORDER    1       // order.row position, MAKELONG(order,row)
  856. #define BASS_POS_OGG            3       // OGG bitstream number
  857. #define BASS_POS_RESET          0x2000000 // flag: reset user file buffers
  858. #define BASS_POS_RELATIVE       0x4000000 // flag: seek relative to the current position
  859. #define BASS_POS_INEXACT        0x8000000 // flag: allow seeking to inexact position
  860. #define BASS_POS_DECODE         0x10000000 // flag: get the decoding (not playing) position
  861. #define BASS_POS_DECODETO       0x20000000 // flag: decode to the position instead of seeking
  862. #define BASS_POS_SCAN           0x40000000 // flag: scan to the position
  863.  
  864. // BASS_ChannelSetDevice/GetDevice option
  865. #define BASS_NODEVICE           0x20000
  866.  
  867. // BASS_RecordSetInput flags
  868. #define BASS_INPUT_OFF      0x10000
  869. #define BASS_INPUT_ON       0x20000
  870.  
  871. #define BASS_INPUT_TYPE_MASK        0xff000000
  872. #define BASS_INPUT_TYPE_UNDEF       0x00000000
  873. #define BASS_INPUT_TYPE_DIGITAL     0x01000000
  874. #define BASS_INPUT_TYPE_LINE        0x02000000
  875. #define BASS_INPUT_TYPE_MIC         0x03000000
  876. #define BASS_INPUT_TYPE_SYNTH       0x04000000
  877. #define BASS_INPUT_TYPE_CD          0x05000000
  878. #define BASS_INPUT_TYPE_PHONE       0x06000000
  879. #define BASS_INPUT_TYPE_SPEAKER     0x07000000
  880. #define BASS_INPUT_TYPE_WAVE        0x08000000
  881. #define BASS_INPUT_TYPE_AUX         0x09000000
  882. #define BASS_INPUT_TYPE_ANALOG      0x0a000000
  883.  
  884. // BASS_ChannelSetFX effect types
  885. #define BASS_FX_DX8_CHORUS          0
  886. #define BASS_FX_DX8_COMPRESSOR      1
  887. #define BASS_FX_DX8_DISTORTION      2
  888. #define BASS_FX_DX8_ECHO            3
  889. #define BASS_FX_DX8_FLANGER         4
  890. #define BASS_FX_DX8_GARGLE          5
  891. #define BASS_FX_DX8_I3DL2REVERB     6
  892. #define BASS_FX_DX8_PARAMEQ         7
  893. #define BASS_FX_DX8_REVERB          8
  894. #define BASS_FX_VOLUME              9
  895.  
  896. typedef struct {
  897.     float       fWetDryMix;
  898.     float       fDepth;
  899.     float       fFeedback;
  900.     float       fFrequency;
  901.     DWORD       lWaveform;  // 0=triangle, 1=sine
  902.     float       fDelay;
  903.     DWORD       lPhase;     // BASS_DX8_PHASE_xxx
  904. } BASS_DX8_CHORUS;
  905.  
  906. typedef struct {
  907.     float   fGain;
  908.     float   fAttack;
  909.     float   fRelease;
  910.     float   fThreshold;
  911.     float   fRatio;
  912.     float   fPredelay;
  913. } BASS_DX8_COMPRESSOR;
  914.  
  915. typedef struct {
  916.     float   fGain;
  917.     float   fEdge;
  918.     float   fPostEQCenterFrequency;
  919.     float   fPostEQBandwidth;
  920.     float   fPreLowpassCutoff;
  921. } BASS_DX8_DISTORTION;
  922.  
  923. typedef struct {
  924.     float   fWetDryMix;
  925.     float   fFeedback;
  926.     float   fLeftDelay;
  927.     float   fRightDelay;
  928.     BOOL    lPanDelay;
  929. } BASS_DX8_ECHO;
  930.  
  931. typedef struct {
  932.     float       fWetDryMix;
  933.     float       fDepth;
  934.     float       fFeedback;
  935.     float       fFrequency;
  936.     DWORD       lWaveform;  // 0=triangle, 1=sine
  937.     float       fDelay;
  938.     DWORD       lPhase;     // BASS_DX8_PHASE_xxx
  939. } BASS_DX8_FLANGER;
  940.  
  941. typedef struct {
  942.     DWORD       dwRateHz;               // Rate of modulation in hz
  943.     DWORD       dwWaveShape;            // 0=triangle, 1=square
  944. } BASS_DX8_GARGLE;
  945.  
  946. typedef struct {
  947.     int     lRoom;                  // [-10000, 0]      default: -1000 mB
  948.     int     lRoomHF;                // [-10000, 0]      default: 0 mB
  949.     float   flRoomRolloffFactor;    // [0.0, 10.0]      default: 0.0
  950.     float   flDecayTime;            // [0.1, 20.0]      default: 1.49s
  951.     float   flDecayHFRatio;         // [0.1, 2.0]       default: 0.83
  952.     int     lReflections;           // [-10000, 1000]   default: -2602 mB
  953.     float   flReflectionsDelay;     // [0.0, 0.3]       default: 0.007 s
  954.     int     lReverb;                // [-10000, 2000]   default: 200 mB
  955.     float   flReverbDelay;          // [0.0, 0.1]       default: 0.011 s
  956.     float   flDiffusion;            // [0.0, 100.0]     default: 100.0 %
  957.     float   flDensity;              // [0.0, 100.0]     default: 100.0 %
  958.     float   flHFReference;          // [20.0, 20000.0]  default: 5000.0 Hz
  959. } BASS_DX8_I3DL2REVERB;
  960.  
  961. typedef struct {
  962.     float   fCenter;
  963.     float   fBandwidth;
  964.     float   fGain;
  965. } BASS_DX8_PARAMEQ;
  966.  
  967. typedef struct {
  968.     float   fInGain;                // [-96.0,0.0]            default: 0.0 dB
  969.     float   fReverbMix;             // [-96.0,0.0]            default: 0.0 db
  970.     float   fReverbTime;            // [0.001,3000.0]         default: 1000.0 ms
  971.     float   fHighFreqRTRatio;       // [0.001,0.999]          default: 0.001
  972. } BASS_DX8_REVERB;
  973.  
  974. #define BASS_DX8_PHASE_NEG_180        0
  975. #define BASS_DX8_PHASE_NEG_90         1
  976. #define BASS_DX8_PHASE_ZERO           2
  977. #define BASS_DX8_PHASE_90             3
  978. #define BASS_DX8_PHASE_180            4
  979.  
  980. typedef struct {
  981.     float fTarget;
  982.     float fCurrent;
  983.     float fTime;
  984.     DWORD lCurve;
  985. } BASS_FX_VOLUME_PARAM;
  986.  
  987. typedef void (CALLBACK IOSNOTIFYPROC)(DWORD status);
  988. /* iOS notification callback function.
  989. status : The notification (BASS_IOSNOTIFY_xxx) */
  990.  
  991. #define BASS_IOSNOTIFY_INTERRUPT        1   // interruption started
  992. #define BASS_IOSNOTIFY_INTERRUPT_END    2   // interruption ended
  993.  
  994. BOOL BASSDEF(BASS_SetConfig)(DWORD option, DWORD value);
  995. DWORD BASSDEF(BASS_GetConfig)(DWORD option);
  996. BOOL BASSDEF(BASS_SetConfigPtr)(DWORD option, const void *value);
  997. void *BASSDEF(BASS_GetConfigPtr)(DWORD option);
  998. DWORD BASSDEF(BASS_GetVersion)();
  999. int BASSDEF(BASS_ErrorGetCode)();
  1000. BOOL BASSDEF(BASS_GetDeviceInfo)(DWORD device, BASS_DEVICEINFO *info);
  1001. #if defined(_WIN32) && !defined(_WIN32_WCE) && !(WINAPI_FAMILY && WINAPI_FAMILY!=WINAPI_FAMILY_DESKTOP_APP)
  1002. BOOL BASSDEF(BASS_Init)(int device, DWORD freq, DWORD flags, HWND win, const GUID *dsguid);
  1003. #else
  1004. BOOL BASSDEF(BASS_Init)(int device, DWORD freq, DWORD flags, void *win, void *dsguid);
  1005. #endif
  1006. BOOL BASSDEF(BASS_SetDevice)(DWORD device);
  1007. DWORD BASSDEF(BASS_GetDevice)();
  1008. BOOL BASSDEF(BASS_Free)();
  1009. #if defined(_WIN32) && !defined(_WIN32_WCE) && !(WINAPI_FAMILY && WINAPI_FAMILY!=WINAPI_FAMILY_DESKTOP_APP)
  1010. void *BASSDEF(BASS_GetDSoundObject)(DWORD object);
  1011. #endif
  1012. BOOL BASSDEF(BASS_GetInfo)(BASS_INFO *info);
  1013. BOOL BASSDEF(BASS_Update)(DWORD length);
  1014. float BASSDEF(BASS_GetCPU)();
  1015. BOOL BASSDEF(BASS_Start)();
  1016. BOOL BASSDEF(BASS_Stop)();
  1017. BOOL BASSDEF(BASS_Pause)();
  1018. BOOL BASSDEF(BASS_IsStarted)();
  1019. BOOL BASSDEF(BASS_SetVolume)(float volume);
  1020. float BASSDEF(BASS_GetVolume)();
  1021.  
  1022. HPLUGIN BASSDEF(BASS_PluginLoad)(const char *file, DWORD flags);
  1023. BOOL BASSDEF(BASS_PluginFree)(HPLUGIN handle);
  1024. const BASS_PLUGININFO *BASSDEF(BASS_PluginGetInfo)(HPLUGIN handle);
  1025.  
  1026. BOOL BASSDEF(BASS_Set3DFactors)(float distf, float rollf, float doppf);
  1027. BOOL BASSDEF(BASS_Get3DFactors)(float *distf, float *rollf, float *doppf);
  1028. BOOL BASSDEF(BASS_Set3DPosition)(const BASS_3DVECTOR *pos, const BASS_3DVECTOR *vel, const BASS_3DVECTOR *front, const BASS_3DVECTOR *top);
  1029. BOOL BASSDEF(BASS_Get3DPosition)(BASS_3DVECTOR *pos, BASS_3DVECTOR *vel, BASS_3DVECTOR *front, BASS_3DVECTOR *top);
  1030. void BASSDEF(BASS_Apply3D)();
  1031. #if defined(_WIN32) && !defined(_WIN32_WCE) && !(WINAPI_FAMILY && WINAPI_FAMILY!=WINAPI_FAMILY_DESKTOP_APP)
  1032. BOOL BASSDEF(BASS_SetEAXParameters)(int env, float vol, float decay, float damp);
  1033. BOOL BASSDEF(BASS_GetEAXParameters)(DWORD *env, float *vol, float *decay, float *damp);
  1034. #endif
  1035.  
  1036. HMUSIC BASSDEF(BASS_MusicLoad)(BOOL mem, const void *file, QWORD offset, DWORD length, DWORD flags, DWORD freq);
  1037. BOOL BASSDEF(BASS_MusicFree)(HMUSIC handle);
  1038.  
  1039. HSAMPLE BASSDEF(BASS_SampleLoad)(BOOL mem, const void *file, QWORD offset, DWORD length, DWORD max, DWORD flags);
  1040. HSAMPLE BASSDEF(BASS_SampleCreate)(DWORD length, DWORD freq, DWORD chans, DWORD max, DWORD flags);
  1041. BOOL BASSDEF(BASS_SampleFree)(HSAMPLE handle);
  1042. BOOL BASSDEF(BASS_SampleSetData)(HSAMPLE handle, const void *buffer);
  1043. BOOL BASSDEF(BASS_SampleGetData)(HSAMPLE handle, void *buffer);
  1044. BOOL BASSDEF(BASS_SampleGetInfo)(HSAMPLE handle, BASS_SAMPLE *info);
  1045. BOOL BASSDEF(BASS_SampleSetInfo)(HSAMPLE handle, const BASS_SAMPLE *info);
  1046. HCHANNEL BASSDEF(BASS_SampleGetChannel)(HSAMPLE handle, BOOL onlynew);
  1047. DWORD BASSDEF(BASS_SampleGetChannels)(HSAMPLE handle, HCHANNEL *channels);
  1048. BOOL BASSDEF(BASS_SampleStop)(HSAMPLE handle);
  1049.  
  1050. HSTREAM BASSDEF(BASS_StreamCreate)(DWORD freq, DWORD chans, DWORD flags, STREAMPROC *proc, void *user);
  1051. HSTREAM BASSDEF(BASS_StreamCreateFile)(BOOL mem, const void *file, QWORD offset, QWORD length, DWORD flags);
  1052. HSTREAM BASSDEF(BASS_StreamCreateURL)(const char *url, DWORD offset, DWORD flags, DOWNLOADPROC *proc, void *user);
  1053. HSTREAM BASSDEF(BASS_StreamCreateFileUser)(DWORD system, DWORD flags, const BASS_FILEPROCS *proc, void *user);
  1054. BOOL BASSDEF(BASS_StreamFree)(HSTREAM handle);
  1055. QWORD BASSDEF(BASS_StreamGetFilePosition)(HSTREAM handle, DWORD mode);
  1056. DWORD BASSDEF(BASS_StreamPutData)(HSTREAM handle, const void *buffer, DWORD length);
  1057. DWORD BASSDEF(BASS_StreamPutFileData)(HSTREAM handle, const void *buffer, DWORD length);
  1058.  
  1059. BOOL BASSDEF(BASS_RecordGetDeviceInfo)(DWORD device, BASS_DEVICEINFO *info);
  1060. BOOL BASSDEF(BASS_RecordInit)(int device);
  1061. BOOL BASSDEF(BASS_RecordSetDevice)(DWORD device);
  1062. DWORD BASSDEF(BASS_RecordGetDevice)();
  1063. BOOL BASSDEF(BASS_RecordFree)();
  1064. BOOL BASSDEF(BASS_RecordGetInfo)(BASS_RECORDINFO *info);
  1065. const char *BASSDEF(BASS_RecordGetInputName)(int input);
  1066. BOOL BASSDEF(BASS_RecordSetInput)(int input, DWORD flags, float volume);
  1067. DWORD BASSDEF(BASS_RecordGetInput)(int input, float *volume);
  1068. HRECORD BASSDEF(BASS_RecordStart)(DWORD freq, DWORD chans, DWORD flags, RECORDPROC *proc, void *user);
  1069.  
  1070. double BASSDEF(BASS_ChannelBytes2Seconds)(DWORD handle, QWORD pos);
  1071. QWORD BASSDEF(BASS_ChannelSeconds2Bytes)(DWORD handle, double pos);
  1072. DWORD BASSDEF(BASS_ChannelGetDevice)(DWORD handle);
  1073. BOOL BASSDEF(BASS_ChannelSetDevice)(DWORD handle, DWORD device);
  1074. DWORD BASSDEF(BASS_ChannelIsActive)(DWORD handle);
  1075. BOOL BASSDEF(BASS_ChannelGetInfo)(DWORD handle, BASS_CHANNELINFO *info);
  1076. const char *BASSDEF(BASS_ChannelGetTags)(DWORD handle, DWORD tags);
  1077. DWORD BASSDEF(BASS_ChannelFlags)(DWORD handle, DWORD flags, DWORD mask);
  1078. BOOL BASSDEF(BASS_ChannelUpdate)(DWORD handle, DWORD length);
  1079. BOOL BASSDEF(BASS_ChannelLock)(DWORD handle, BOOL lock);
  1080. BOOL BASSDEF(BASS_ChannelPlay)(DWORD handle, BOOL restart);
  1081. BOOL BASSDEF(BASS_ChannelStop)(DWORD handle);
  1082. BOOL BASSDEF(BASS_ChannelPause)(DWORD handle);
  1083. BOOL BASSDEF(BASS_ChannelSetAttribute)(DWORD handle, DWORD attrib, float value);
  1084. BOOL BASSDEF(BASS_ChannelGetAttribute)(DWORD handle, DWORD attrib, float *value);
  1085. BOOL BASSDEF(BASS_ChannelSlideAttribute)(DWORD handle, DWORD attrib, float value, DWORD time);
  1086. BOOL BASSDEF(BASS_ChannelIsSliding)(DWORD handle, DWORD attrib);
  1087. BOOL BASSDEF(BASS_ChannelSetAttributeEx)(DWORD handle, DWORD attrib, void *value, DWORD size);
  1088. DWORD BASSDEF(BASS_ChannelGetAttributeEx)(DWORD handle, DWORD attrib, void *value, DWORD size);
  1089. BOOL BASSDEF(BASS_ChannelSet3DAttributes)(DWORD handle, int mode, float min, float max, int iangle, int oangle, float outvol);
  1090. BOOL BASSDEF(BASS_ChannelGet3DAttributes)(DWORD handle, DWORD *mode, float *min, float *max, DWORD *iangle, DWORD *oangle, float *outvol);
  1091. BOOL BASSDEF(BASS_ChannelSet3DPosition)(DWORD handle, const BASS_3DVECTOR *pos, const BASS_3DVECTOR *orient, const BASS_3DVECTOR *vel);
  1092. BOOL BASSDEF(BASS_ChannelGet3DPosition)(DWORD handle, BASS_3DVECTOR *pos, BASS_3DVECTOR *orient, BASS_3DVECTOR *vel);
  1093. QWORD BASSDEF(BASS_ChannelGetLength)(DWORD handle, DWORD mode);
  1094. BOOL BASSDEF(BASS_ChannelSetPosition)(DWORD handle, QWORD pos, DWORD mode);
  1095. QWORD BASSDEF(BASS_ChannelGetPosition)(DWORD handle, DWORD mode);
  1096. DWORD BASSDEF(BASS_ChannelGetLevel)(DWORD handle);
  1097. BOOL BASSDEF(BASS_ChannelGetLevelEx)(DWORD handle, float *levels, float length, DWORD flags);
  1098. DWORD BASSDEF(BASS_ChannelGetData)(DWORD handle, void *buffer, DWORD length);
  1099. HSYNC BASSDEF(BASS_ChannelSetSync)(DWORD handle, DWORD type, QWORD param, SYNCPROC *proc, void *user);
  1100. BOOL BASSDEF(BASS_ChannelRemoveSync)(DWORD handle, HSYNC sync);
  1101. HDSP BASSDEF(BASS_ChannelSetDSP)(DWORD handle, DSPPROC *proc, void *user, int priority);
  1102. BOOL BASSDEF(BASS_ChannelRemoveDSP)(DWORD handle, HDSP dsp);
  1103. BOOL BASSDEF(BASS_ChannelSetLink)(DWORD handle, DWORD chan);
  1104. BOOL BASSDEF(BASS_ChannelRemoveLink)(DWORD handle, DWORD chan);
  1105. HFX BASSDEF(BASS_ChannelSetFX)(DWORD handle, DWORD type, int priority);
  1106. BOOL BASSDEF(BASS_ChannelRemoveFX)(DWORD handle, HFX fx);
  1107.  
  1108. BOOL BASSDEF(BASS_FXSetParameters)(HFX handle, const void *params);
  1109. BOOL BASSDEF(BASS_FXGetParameters)(HFX handle, void *params);
  1110. BOOL BASSDEF(BASS_FXReset)(HFX handle);
  1111. BOOL BASSDEF(BASS_FXSetPriority)(HFX handle, int priority);
  1112.  
  1113. #ifdef __cplusplus
  1114. }
  1115.  
  1116. #if defined(_WIN32) && !defined(NOBASSOVERLOADS)
  1117. static inline HPLUGIN BASS_PluginLoad(const WCHAR *file, DWORD flags)
  1118. {
  1119.     return BASS_PluginLoad((const char*)file, flags|BASS_UNICODE);
  1120. }
  1121.  
  1122. static inline HMUSIC BASS_MusicLoad(BOOL mem, const WCHAR *file, QWORD offset, DWORD length, DWORD flags, DWORD freq)
  1123. {
  1124.     return BASS_MusicLoad(mem, (const void*)file, offset, length, flags|BASS_UNICODE, freq);
  1125. }
  1126.  
  1127. static inline HSAMPLE BASS_SampleLoad(BOOL mem, const WCHAR *file, QWORD offset, DWORD length, DWORD max, DWORD flags)
  1128. {
  1129.     return BASS_SampleLoad(mem, (const void*)file, offset, length, max, flags|BASS_UNICODE);
  1130. }
  1131.  
  1132. static inline HSTREAM BASS_StreamCreateFile(BOOL mem, const WCHAR *file, QWORD offset, QWORD length, DWORD flags)
  1133. {
  1134.     return BASS_StreamCreateFile(mem, (const void*)file, offset, length, flags|BASS_UNICODE);
  1135. }
  1136.  
  1137. static inline HSTREAM BASS_StreamCreateURL(const WCHAR *url, DWORD offset, DWORD flags, DOWNLOADPROC *proc, void *user)
  1138. {
  1139.     return BASS_StreamCreateURL((const char*)url, offset, flags|BASS_UNICODE, proc, user);
  1140. }
  1141.  
  1142. static inline BOOL BASS_SetConfigPtr(DWORD option, const WCHAR *value)
  1143. {
  1144.     return BASS_SetConfigPtr(option|BASS_UNICODE, (const void*)value);
  1145. }
  1146. #endif
  1147. #endif
  1148.  
  1149. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement