bass.h 45 KB

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