home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 February / PCFFeb.iso / xenon / ModBass / c / bass.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-20  |  43.0 KB  |  900 lines

  1. /* BASS 0.8 C/C++ header file, copyright (c) 1999-2000 Ian Luck.
  2.    Please report bugs/suggestions/etc... to bass@un4seen.com */
  3.  
  4. #ifndef BASS_H
  5. #define BASS_H
  6.  
  7. #include <wtypes.h>
  8.  
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12.  
  13. #ifndef BASSDEF
  14. #define BASSDEF(f) WINAPI f
  15. #endif
  16.  
  17. typedef DWORD HMUSIC;        // MOD music handle
  18. typedef DWORD HSAMPLE;        // sample handle
  19. typedef DWORD HCHANNEL;        // playing sample's channel handle
  20. typedef DWORD HSTREAM;        // sample stream handle
  21. typedef DWORD HSYNC;        // synchronizer handle
  22. typedef DWORD HDSP;            // DSP handle
  23.  
  24. // Error codes returned by BASS_GetErrorCode()
  25. #define BASS_OK                0    // all is OK
  26. #define BASS_ERROR_MEM        1    // memory error
  27. #define BASS_ERROR_FILEOPEN    2    // can't open the file
  28. #define BASS_ERROR_DRIVER    3    // can't find a free/valid driver
  29. #define BASS_ERROR_BUFLOST    4    // the sample buffer was lost - please report this!
  30. #define BASS_ERROR_HANDLE    5    // invalid handle
  31. #define BASS_ERROR_FORMAT    6    // unsupported format
  32. #define BASS_ERROR_POSITION    7    // invalid playback position
  33. #define BASS_ERROR_INIT        8    // BASS_Init has not been successfully called
  34. #define BASS_ERROR_START    9    // BASS_Start has not been successfully called
  35. #define BASS_ERROR_INITCD    10    // can't initialize CD
  36. #define BASS_ERROR_CDINIT    11    // BASS_CDInit has not been successfully called
  37. #define BASS_ERROR_NOCD        12    // no CD in drive
  38. #define BASS_ERROR_CDTRACK    13    // can't play the selected CD track
  39. #define BASS_ERROR_ALREADY    14    // already initialized
  40. #define BASS_ERROR_CDVOL    15    // CD has no volume control
  41. #define BASS_ERROR_NOPAUSE    16    // not paused
  42. #define BASS_ERROR_NOTAUDIO    17    // not an audio track
  43. #define BASS_ERROR_NOCHAN    18    // can't get a free channel
  44. #define BASS_ERROR_ILLTYPE    19    // an illegal type was specified
  45. #define BASS_ERROR_ILLPARAM    20    // an illegal parameter was specified
  46. #define BASS_ERROR_NO3D        21    // no 3D support
  47. #define BASS_ERROR_NOEAX    22    // no EAX support
  48. #define BASS_ERROR_DEVICE    23    // illegal device number
  49. #define BASS_ERROR_NOPLAY    24    // not playing
  50. #define BASS_ERROR_FREQ        25    // illegal sample rate
  51. #define BASS_ERROR_NOA3D    26    // A3D.DLL is not installed
  52. #define BASS_ERROR_NOTFILE    27    // the stream is not a file stream (WAV/MP3)
  53. #define BASS_ERROR_NOHW        29    // no hardware voices available
  54. #define BASS_ERROR_NOSYNC    30    // synchronizers have been disabled
  55. #define BASS_ERROR_UNKNOWN    -1    // some other mystery error
  56.  
  57. // Device setup flags
  58. #define BASS_DEVICE_8BITS    1    // use 8 bit resolution, else 16 bit
  59. #define BASS_DEVICE_MONO    2    // use mono, else stereo
  60. #define BASS_DEVICE_3D        4    // enable 3D functionality
  61. /* If the BASS_DEVICE_3D flag is not specified when initilizing BASS,
  62. then the 3D flags (BASS_SAMPLE_3D and BASS_MUSIC_3D) are ignored when
  63. loading/creating a sample/stream/music. */
  64. #define BASS_DEVICE_A3D        8    // enable A3D functionality
  65. #define BASS_DEVICE_NOSYNC    16    // disable synchronizers
  66.  
  67. // DirectSound interfaces (for use with BASS_GetDSoundObject)
  68. #define BASS_OBJECT_DS        1    // IDirectSound
  69. #define BASS_OBJECT_DS3DL    2    // IDirectSound3DListener
  70.  
  71. typedef struct {
  72.     DWORD size;        // size of this struct (set this before calling the function)
  73.     DWORD flags;    // device capabilities (DSCAPS_xxx flags)
  74. /* The following values are irrelevant if the device doesn't have hardware
  75. support (DSCAPS_EMULDRIVER is specified in flags) */
  76.     DWORD hwsize;    // size of total device hardware memory
  77.     DWORD hwfree;    // size of free device hardware memory
  78.     DWORD freesam;    // number of free sample slots in the hardware
  79.     DWORD free3d;    // number of free 3D sample slots in the hardware
  80.     DWORD minrate;    // min sample rate supported by the hardware
  81.     DWORD maxrate;    // max sample rate supported by the hardware
  82.     BOOL eax;        // device supports EAX? (always FALSE if BASS_DEVICE_3D was not used)
  83.     DWORD a3d;        // A3D version (0=unsupported or BASS_DEVICE_A3D was not used)
  84.     DWORD dsver;    // DirectSound version (use to check for DX5/7 functions)
  85. } BASS_INFO;
  86.  
  87. // BASS_INFO flags (from DSOUND.H)
  88. #define DSCAPS_CONTINUOUSRATE    0x00000010
  89. /* supports all sample rates between min/maxrate */
  90. #define DSCAPS_EMULDRIVER        0x00000020
  91. /* device does NOT have hardware DirectSound support */
  92. #define DSCAPS_CERTIFIED        0x00000040
  93. /* device driver has been certified by Microsoft */
  94. /* The following flags tell what type of samples are supported by HARDWARE
  95. mixing, all these formats are supported by SOFTWARE mixing */
  96. #define DSCAPS_SECONDARYMONO    0x00000100    // mono
  97. #define DSCAPS_SECONDARYSTEREO    0x00000200    // stereo
  98. #define DSCAPS_SECONDARY8BIT    0x00000400    // 8 bit
  99. #define DSCAPS_SECONDARY16BIT    0x00000800    // 16 bit
  100.  
  101. // Volume sliding flags
  102. #define BASS_SLIDE_DIGITAL    1    // slide digital master volume
  103. #define BASS_SLIDE_CD        2    // slide CD volume
  104.  
  105. // Music flags
  106. #define BASS_MUSIC_RAMP        1    // normal ramping
  107. #define BASS_MUSIC_RAMPS    2    // sensitive ramping
  108. /* Ramping doesn't take a lot of extra processing and improves
  109. the sound quality by removing "clicks". Sensitive ramping will
  110. leave sharp attacked samples, unlike normal ramping. */
  111. #define BASS_MUSIC_LOOP        4    // loop music
  112. #define BASS_MUSIC_FT2MOD    16    // play .MOD as FastTracker 2 does
  113. #define BASS_MUSIC_PT1MOD    32    // play .MOD as ProTracker 1 does
  114. #define BASS_MUSIC_MONO        64    // force mono mixing (less CPU usage)
  115. #define BASS_MUSIC_3D        128    // enable 3D functionality
  116. #define BASS_MUSIC_POSRESET    256    // stop all notes when moving position
  117.  
  118. // Sample info structure & flags
  119. typedef struct {
  120.     DWORD freq;        // default playback rate
  121.     DWORD volume;    // default volume (0-100)
  122.     int pan;        // default pan (-100=left, 0=middle, 100=right)
  123.     DWORD flags;    // BASS_SAMPLE_xxx flags
  124.     DWORD length;    // length (in samples, not bytes)
  125.     DWORD max;        // maximum simultaneous playbacks
  126. /* The following are the sample's default 3D attributes (if the sample
  127. is 3D, BASS_SAMPLE_3D is in flags) see BASS_ChannelSet3DAttributes */
  128.     DWORD mode3d;    // BASS_3DMODE_xxx mode
  129.     float mindist;    // minimum distance
  130.     float maxdist;    // maximum distance
  131.     DWORD iangle;    // angle of inside projection cone
  132.     DWORD oangle;    // angle of outside projection cone
  133.     DWORD outvol;    // delta-volume outside the projection cone
  134. /* The following are the defaults used if the sample uses the DirectX 7
  135. voice allocation/management features. */
  136.     DWORD vam;        // voice allocation/management flags (BASS_VAM_xxx)
  137.     DWORD priority;    // priority (0=lowest, 0xffffffff=highest)
  138. } BASS_SAMPLE;
  139.  
  140. #define BASS_SAMPLE_8BITS        1    // 8 bit, else 16 bit
  141. #define BASS_SAMPLE_MONO        2    // mono, else stereo
  142. #define BASS_SAMPLE_LOOP        4    // looped
  143. #define BASS_SAMPLE_3D            8    // 3D functionality enabled
  144. #define BASS_SAMPLE_SOFTWARE    16    // it's NOT using hardware mixing
  145. #define BASS_SAMPLE_MUTEMAX        32    // muted at max distance (3D only)
  146. #define BASS_SAMPLE_VAM            64    // uses the DX7 voice allocation & management
  147. #define BASS_SAMPLE_OVER_VOL    0x10000    // override lowest volume
  148. #define BASS_SAMPLE_OVER_POS    0x20000    // override longest playing
  149. #define BASS_SAMPLE_OVER_DIST    0x30000 // override furthest from listener (3D only)
  150.  
  151. #define BASS_MP3_HALFRATE    0x10000 // reduced quality MP3 (half sample rate)
  152. #define BASS_MP3_SETPOS        0x20000 // enable seeking on the MP3
  153.  
  154. // DX7 voice allocation flags
  155. #define BASS_VAM_HARDWARE        1
  156. /* Play the sample in hardware. If no hardware voices are available then
  157. the "play" call will fail */
  158. #define BASS_VAM_SOFTWARE        2
  159. /* Play the sample in software (ie. non-accelerated). No other VAM flags
  160. may be used together with this flag. */
  161.  
  162. // DX7 voice management flags
  163. /* These flags enable hardware resource stealing... if the hardware has no
  164. available voices, a currently playing buffer will be stopped to make room for
  165. the new buffer. NOTE: only samples loaded/created with the BASS_SAMPLE_VAM
  166. flag are considered for termination by the DX7 voice management. */
  167. #define BASS_VAM_TERM_TIME        4
  168. /* If there are no free hardware voices, the buffer to be terminated will be
  169. the one with the least time left to play. */
  170. #define BASS_VAM_TERM_DIST        8
  171. /* If there are no free hardware voices, the buffer to be terminated will be
  172. one that was loaded/created with the BASS_SAMPLE_MUTEMAX flag and is beyond
  173. it's max distance. If there are no buffers that match this criteria, then the
  174. "play" call will fail. */
  175. #define BASS_VAM_TERM_PRIO        16
  176. /* If there are no free hardware voices, the buffer to be terminated will be
  177. the one with the lowest priority. */
  178.  
  179.  
  180. // 3D vector (for 3D positions/velocities/orientations)
  181. typedef struct {
  182.     float x;    // +=right, -=left
  183.     float y;    // +=up, -=down
  184.     float z;    // +=front, -=behind
  185. } BASS_3DVECTOR;
  186.  
  187. // 3D channel modes
  188. #define BASS_3DMODE_NORMAL        0
  189. /* normal 3D processing */
  190. #define BASS_3DMODE_RELATIVE    1
  191. /* The channel's 3D position (position/velocity/orientation) are relative to
  192. the listener. When the listener's position/velocity/orientation is changed
  193. with BASS_Set3DPosition, the channel's position relative to the listener does
  194. not change. */
  195. #define BASS_3DMODE_OFF            2
  196. /* Turn off 3D processing on the channel, the sound will be played
  197. in the center. */
  198.  
  199. // EAX environments, use with BASS_SetEAXParameters
  200. enum
  201. {
  202.     EAX_ENVIRONMENT_GENERIC,
  203.     EAX_ENVIRONMENT_PADDEDCELL,
  204.     EAX_ENVIRONMENT_ROOM,
  205.     EAX_ENVIRONMENT_BATHROOM,
  206.     EAX_ENVIRONMENT_LIVINGROOM,
  207.     EAX_ENVIRONMENT_STONEROOM,
  208.     EAX_ENVIRONMENT_AUDITORIUM,
  209.     EAX_ENVIRONMENT_CONCERTHALL,
  210.     EAX_ENVIRONMENT_CAVE,
  211.     EAX_ENVIRONMENT_ARENA,
  212.     EAX_ENVIRONMENT_HANGAR,
  213.     EAX_ENVIRONMENT_CARPETEDHALLWAY,
  214.     EAX_ENVIRONMENT_HALLWAY,
  215.     EAX_ENVIRONMENT_STONECORRIDOR,
  216.     EAX_ENVIRONMENT_ALLEY,
  217.     EAX_ENVIRONMENT_FOREST,
  218.     EAX_ENVIRONMENT_CITY,
  219.     EAX_ENVIRONMENT_MOUNTAINS,
  220.     EAX_ENVIRONMENT_QUARRY,
  221.     EAX_ENVIRONMENT_PLAIN,
  222.     EAX_ENVIRONMENT_PARKINGLOT,
  223.     EAX_ENVIRONMENT_SEWERPIPE,
  224.     EAX_ENVIRONMENT_UNDERWATER,
  225.     EAX_ENVIRONMENT_DRUGGED,
  226.     EAX_ENVIRONMENT_DIZZY,
  227.     EAX_ENVIRONMENT_PSYCHOTIC,
  228.  
  229.     EAX_ENVIRONMENT_COUNT            // total number of environments
  230. };
  231.  
  232. // EAX presets, usage: BASS_SetEAXParameters(EAX_PRESET_xxx)
  233. #define EAX_PRESET_GENERIC         EAX_ENVIRONMENT_GENERIC,0.5F,1.493F,0.5F
  234. #define EAX_PRESET_PADDEDCELL      EAX_ENVIRONMENT_PADDEDCELL,0.25F,0.1F,0.0F
  235. #define EAX_PRESET_ROOM            EAX_ENVIRONMENT_ROOM,0.417F,0.4F,0.666F
  236. #define EAX_PRESET_BATHROOM        EAX_ENVIRONMENT_BATHROOM,0.653F,1.499F,0.166F
  237. #define EAX_PRESET_LIVINGROOM      EAX_ENVIRONMENT_LIVINGROOM,0.208F,0.478F,0.0F
  238. #define EAX_PRESET_STONEROOM       EAX_ENVIRONMENT_STONEROOM,0.5F,2.309F,0.888F
  239. #define EAX_PRESET_AUDITORIUM      EAX_ENVIRONMENT_AUDITORIUM,0.403F,4.279F,0.5F
  240. #define EAX_PRESET_CONCERTHALL     EAX_ENVIRONMENT_CONCERTHALL,0.5F,3.961F,0.5F
  241. #define EAX_PRESET_CAVE            EAX_ENVIRONMENT_CAVE,0.5F,2.886F,1.304F
  242. #define EAX_PRESET_ARENA           EAX_ENVIRONMENT_ARENA,0.361F,7.284F,0.332F
  243. #define EAX_PRESET_HANGAR          EAX_ENVIRONMENT_HANGAR,0.5F,10.0F,0.3F
  244. #define EAX_PRESET_CARPETEDHALLWAY EAX_ENVIRONMENT_CARPETEDHALLWAY,0.153F,0.259F,2.0F
  245. #define EAX_PRESET_HALLWAY         EAX_ENVIRONMENT_HALLWAY,0.361F,1.493F,0.0F
  246. #define EAX_PRESET_STONECORRIDOR   EAX_ENVIRONMENT_STONECORRIDOR,0.444F,2.697F,0.638F
  247. #define EAX_PRESET_ALLEY           EAX_ENVIRONMENT_ALLEY,0.25F,1.752F,0.776F
  248. #define EAX_PRESET_FOREST          EAX_ENVIRONMENT_FOREST,0.111F,3.145F,0.472F
  249. #define EAX_PRESET_CITY            EAX_ENVIRONMENT_CITY,0.111F,2.767F,0.224F
  250. #define EAX_PRESET_MOUNTAINS       EAX_ENVIRONMENT_MOUNTAINS,0.194F,7.841F,0.472F
  251. #define EAX_PRESET_QUARRY          EAX_ENVIRONMENT_QUARRY,1.0F,1.499F,0.5F
  252. #define EAX_PRESET_PLAIN           EAX_ENVIRONMENT_PLAIN,0.097F,2.767F,0.224F
  253. #define EAX_PRESET_PARKINGLOT      EAX_ENVIRONMENT_PARKINGLOT,0.208F,1.652F,1.5F
  254. #define EAX_PRESET_SEWERPIPE       EAX_ENVIRONMENT_SEWERPIPE,0.652F,2.886F,0.25F
  255. #define EAX_PRESET_UNDERWATER      EAX_ENVIRONMENT_UNDERWATER,1.0F,1.499F,0.0F
  256. #define EAX_PRESET_DRUGGED         EAX_ENVIRONMENT_DRUGGED,0.875F,8.392F,1.388F
  257. #define EAX_PRESET_DIZZY           EAX_ENVIRONMENT_DIZZY,0.139F,17.234F,0.666F
  258. #define EAX_PRESET_PSYCHOTIC       EAX_ENVIRONMENT_PSYCHOTIC,0.486F,7.563F,0.806F
  259.  
  260. // A3D resource manager modes
  261. #define A3D_RESMODE_OFF                0    // off
  262. #define A3D_RESMODE_NOTIFY            1    // notify when there are no free hardware channels
  263. #define A3D_RESMODE_DYNAMIC         2    // non-looping channels are managed
  264. #define A3D_RESMODE_DYNAMIC_LOOPERS    3    // all (inc. looping) channels are managed (req A3D 1.2)
  265.  
  266. // software 3D mixing algorithm modes (used with BASS_Set3DAlgorithm)
  267. #define BASS_3DALG_DEFAULT    0
  268. /* default algorithm (currently translates to BASS_3DALG_OFF) */
  269. #define BASS_3DALG_OFF        1
  270. /* Uses normal left and right panning. The vertical axis is ignored except for
  271. scaling of volume due to distance. Doppler shift and volume scaling are still
  272. applied, but the 3D filtering is not performed. This is the most CPU efficient
  273. software implementation, but provides no virtual 3D audio effect. Head Related
  274. Transfer Function processing will not be done. Since only normal stereo panning
  275. is used, a channel using this algorithm may be accelerated by a 2D hardware
  276. voice if no free 3D hardware voices are available. */
  277. #define BASS_3DALG_FULL        2
  278. /* This algorithm gives the highest quality 3D audio effect, but uses more CPU.
  279. Requires Windows 98 2nd Edition or Windows 2000 that uses WDM drivers, if this
  280. mode is not available then BASS_3DALG_OFF will be used instead. */
  281. #define BASS_3DALG_LIGHT    3
  282. /* This algorithm gives a good 3D audio effect, and uses less CPU than the FULL
  283. mode. Requires Windows 98 2nd Edition or Windows 2000 that uses WDM drivers, if
  284. this mode is not available then BASS_3DALG_OFF will be used instead. */
  285.  
  286. typedef DWORD (CALLBACK STREAMPROC)(HSTREAM handle, void *buffer, DWORD length, DWORD user);
  287. /* Stream callback function. NOTE: A stream function should obviously be as quick
  288. as possible, other streams (and MOD musics) can't be mixed until it's finished.
  289. handle : The stream that needs writing
  290. buffer : Buffer to write the samples in
  291. length : Number of bytes to write
  292. user   : The 'user' parameter value given when calling BASS_StreamCreate
  293. RETURN : Number of bytes written. If less than "length" then the
  294.          stream is assumed to be at the end, and is stopped. */
  295.  
  296. /* Sync types (with BASS_ChannelSetSync() "param" and SYNCPROC "data"
  297. definitions) & flags. */
  298. #define BASS_SYNC_MUSICPOS    0
  299. /* Sync when a music reaches a position.
  300. param: LOWORD=order (0=first, -1=all) HIWORD=row (0=first, -1=all)
  301. data : LOWORD=order HIWORD=row */
  302. #define BASS_SYNC_MUSICINST    1
  303. /* Sync when an instrument (sample for the non-instrument based formats)
  304. is played in a music (not including retrigs).
  305. param: LOWORD=instrument (1=first) HIWORD=note (0=c0...119=b9, -1=all)
  306. data : LOWORD=note HIWORD=volume (0-64) */
  307. #define BASS_SYNC_END        2
  308. /* Sync when a music or file stream reaches the end.
  309. param: not used
  310. data : not used */
  311. #define BASS_SYNC_MUSICFX    3
  312. /* Sync when the "sync" effect (XM/MTM/MOD: E8x, IT/S3M: S0x) is used.
  313. param: 0:data=pos, 1:data="x" value
  314. data : param=0: LOWORD=order HIWORD=row, param=1: "x" value */
  315. #define BASS_SYNC_MIXTIME    0x40000000    // FLAG: sync at mixtime, else at playtime
  316. #define BASS_SYNC_ONETIME    0x80000000    // FLAG: sync only once, else continuously
  317.  
  318. typedef void (CALLBACK SYNCPROC)(HSYNC handle, DWORD channel, DWORD data, DWORD user);
  319. /* Sync callback function. NOTE: a sync callback function should be very
  320. quick (eg. just posting a message) as other syncs cannot be processed
  321. until it has finished. If the sync is a "mixtime" sync, then other streams
  322. and MOD musics can not be mixed until it's finished either.
  323. handle : The sync that has occured
  324. channel: Channel that the sync occured in
  325. data   : Additional data associated with the sync's occurance
  326. user   : The 'user' parameter given when calling BASS_ChannelSetSync */
  327.  
  328. typedef void (CALLBACK DSPPROC)(HSYNC handle, DWORD channel, void *buffer, DWORD length, DWORD user);
  329. /* DSP callback function. NOTE: A DSP function should obviously be as quick as
  330. possible... other DSP functions, streams and MOD musics can not be processed
  331. until it's finished.
  332. handle : The DSP handle
  333. channel: Channel that the DSP is being applied to
  334. buffer : Buffer to apply the DSP to
  335. length : Number of bytes in the buffer
  336. user   : The 'user' parameter given when calling BASS_ChannelSetDSP */
  337.  
  338. #define CDCHANNEL    0    // CD channel, for use with BASS_Channel functions
  339.  
  340. DWORD BASSDEF(BASS_GetVersion)();
  341. /* Retrieve the version number of BASS that is loaded.
  342. RETURN : The BASS version (LOWORD.HIWORD) */
  343.  
  344. BOOL BASSDEF(BASS_GetDeviceDescription)(int devnum, char **desc);
  345. /* Get the text description of a device. This function can be used to
  346. enumerate the available devices.
  347. devnum : The device (0=first)
  348. desc   : Pointer to store pointer to text description at */
  349.  
  350. void BASSDEF(BASS_SetBufferLength)(float length);
  351. /* Set the amount that BASS mixes ahead new musics/streams. Changing
  352. this setting does not affect musics/streams that have already been
  353. loaded/created. Increasing the buffer length, decreases the chance of
  354. the sound possibly breaking-up on slower computers, but also requires
  355. more memory. The default length is 0.5 secs.
  356. length : The buffer length in seconds (limited to 0.3-2.0s)
  357.  
  358. NOTE: This setting does not represent the latency (delay between playing
  359. and hearing the sound). The latency depends on the drivers, the power of
  360. the CPU, and the complexity of what's being mixed (eg. an IT using filters
  361. requires more processing than a plain 4 channel MOD). So the buffer length
  362. actually has no effect on the latency. */
  363.  
  364. void BASSDEF(BASS_SetGlobalVolumes)(int musvol, int samvol, int strvol);
  365. /* Set the global music/sample/stream volume levels.
  366. musvol : MOD music global volume level (0-100, -1=leave current)
  367. samvol : Sample global volume level (0-100, -1=leave current)
  368. strvol : Stream global volume level (0-100, -1=leave current) */
  369.  
  370. void BASSDEF(BASS_GetGlobalVolumes)(DWORD *musvol, DWORD *samvol, DWORD *strvol);
  371. /* Retrive the global music/sample/stream volume levels.
  372. musvol : MOD music global volume level (NULL=don't retrieve it)
  373. samvol : Sample global volume level (NULL=don't retrieve it)
  374. strvol : Stream global volume level (NULL=don't retrieve it) */
  375.  
  376. void BASSDEF(BASS_SetLogCurves)(BOOL volume, BOOL pan);
  377. /* Make the volume/panning values translate to a logarithmic curve,
  378. or a linear "curve" (the default).
  379. volume : volume curve (FALSE=linear, TRUE=log)
  380. pan    : panning curve (FALSE=linear, TRUE=log) */
  381.  
  382. void BASSDEF(BASS_Set3DAlgorithm)(DWORD algo);
  383. /* Set the 3D algorithm for software mixed 3D channels (does not affect
  384. hardware mixed channels). Changing the mode only affects subsequently
  385. created or loaded samples/streams/musics, not those that already exist.
  386. Requires DirectX 7 or above.
  387. algo   : algorithm flag (BASS_3DALG_xxx) */
  388.  
  389. DWORD BASSDEF(BASS_ErrorGetCode)();
  390. /* Get the BASS_ERROR_xxx error code. Use this function to get the
  391. reason for an error. */
  392.  
  393.  
  394. BOOL BASSDEF(BASS_Init)(int device, DWORD freq, DWORD flags, HWND win);
  395. /* Initialize the digital output. This must be called before all following
  396. BASS functions (except CD functions). The volume is initially set to 100
  397. (the maximum), use BASS_SetVolume() to adjust it.
  398. device : Device to use (0=first, -1=default, -2=no sound)
  399. freq   : Output sample rate
  400. flags  : BASS_DEVICE_xxx flags
  401. win    : Owner window
  402.  
  403. NOTE: The "no sound" device (device=-2), allows loading and "playing"
  404. of MOD musics only (all sample/stream functions and most other functions
  405. fail). This is so that you can still use the MOD musics as synchronizers
  406. when there is no soundcard present. When using device -2, you should still
  407. set the other arguments as you would do normally. */
  408.  
  409. void BASSDEF(BASS_Free)();
  410. /* Free all resources used by the digital output, including all musics
  411. and samples. */
  412.  
  413. void *BASSDEF(BASS_GetDSoundObject)(DWORD object);
  414. /* Retrieve a pointer to a DirectSound interface. This can be used by
  415. advanced users to "plugin" external functionality.
  416. object : The interface to retrieve (BASS_OBJECT_xxx)
  417. RETURN : A pointer to the requested interface (NULL=error) */
  418.  
  419. void BASSDEF(BASS_GetInfo)(BASS_INFO *info);
  420. /* Retrieve some information on the device being used.
  421. info   : Pointer to store info at */
  422.  
  423. float BASSDEF(BASS_GetCPU)();
  424. /* Get the current CPU usage of BASS. This includes the time taken to mix
  425. the MOD musics and sample streams, and also the time taken by any user
  426. DSP functions. It does not include plain sample mixing which is done by
  427. the output device (hardware accelerated) or DirectSound (emulated). Audio
  428. CD playback requires no CPU usage.
  429. RETURN : The CPU usage percentage (floating-point) */
  430.  
  431. BOOL BASSDEF(BASS_Start)();
  432. /* Start the digital output. */
  433.  
  434. BOOL BASSDEF(BASS_Stop)();
  435. /* Stop the digital output, stopping all musics/samples/streams. */
  436.  
  437. BOOL BASSDEF(BASS_Pause)();
  438. /* Stop the digital output, pausing all musics/samples/streams. Use
  439. BASS_Start() to resume the digital output. */
  440.  
  441. BOOL BASSDEF(BASS_SetVolume)(DWORD volume);
  442. /* Set the digital output master volume.
  443. volume : Desired volume level (0-100) */
  444.  
  445. int BASSDEF(BASS_GetVolume)();
  446. /* Get the digital output master volume.
  447. RETURN : The volume level (0-100, -1=error) */
  448.  
  449. BOOL BASSDEF(BASS_Set3DFactors)(float distf, float rollf, float doppf);
  450. /* Set the factors that affect the calculations of 3D sound.
  451. distf  : Distance factor (0.0-10.0, 1.0=use meters, 0.3=use feet, <0.0=leave current)
  452.          By default BASS measures distances in meters, you can change this
  453.          setting if you are using a different unit of measurement.
  454. roolf  : Rolloff factor, how fast the sound quietens with distance
  455.          (0.0=no rolloff, 1.0=real world, 2.0=2x real... 10.0=max, <0.0=leave current)
  456. doppf  : Doppler factor (0.0=no doppler, 1.0=real world, 2.0=2x real... 10.0=max, <0.0=leave current)
  457.          The doppler effect is the way a sound appears to change frequency when it is
  458.          moving towards or away from you. The listener and sound velocity settings are
  459.          used to calculate this effect, this "doppf" value can be used to lessen or
  460.          exaggerate the effect. */
  461.  
  462. BOOL BASSDEF(BASS_Get3DFactors)(float *distf, float *rollf, float *doppf);
  463. /* Get the factors that affect the calculations of 3D sound.
  464. distf  : Distance factor (NULL=don't get it)
  465. roolf  : Rolloff factor (NULL=don't get it)
  466. doppf  : Doppler factor (NULL=don't get it) */
  467.  
  468. BOOL BASSDEF(BASS_Set3DPosition)(BASS_3DVECTOR *pos, BASS_3DVECTOR *vel, BASS_3DVECTOR *front, BASS_3DVECTOR *top);
  469. /* Set the position/velocity/orientation of the listener (ie. the player/viewer).
  470. pos    : Position of the listener (NULL=leave current)
  471. vel    : Listener's velocity, used to calculate doppler effect (NULL=leave current)
  472. front  : Direction that listener's front is pointing (NULL=leave current)
  473. top    : Direction that listener's top is pointing (NULL=leave current)
  474.          NOTE: front & top must both be set in a single call */
  475.  
  476. BOOL BASSDEF(BASS_Get3DPosition)(BASS_3DVECTOR *pos, BASS_3DVECTOR *vel, BASS_3DVECTOR *front, BASS_3DVECTOR *top);
  477. /* Get the position/velocity/orientation of the listener.
  478. pos    : Position of the listener (NULL=don't get it)
  479. vel    : Listener's velocity (NULL=don't get it)
  480. front  : Direction that listener's front is pointing (NULL=don't get it)
  481. top    : Direction that listener's top is pointing (NULL=don't get it)
  482.          NOTE: front & top must both be retrieved in a single call */
  483.  
  484. BOOL BASSDEF(BASS_Apply3D)();
  485. /* Apply changes made to the 3D system. This must be called to apply any changes
  486. made with BASS_Set3DFactors, BASS_Set3DPosition, BASS_ChannelSet3DAttributes or
  487. BASS_ChannelSet3DPosition. It improves performance to have DirectSound do all the
  488. required recalculating at the same time like this, rather than recalculating after
  489. every little change is made. NOTE: This is automatically called when starting a 3D
  490. sample with BASS_SamplePlay3D/Ex. */
  491.  
  492. BOOL BASSDEF(BASS_SetEAXParameters)(int env, float vol, float decay, float damp);
  493. /* Set the type of EAX environment and it's parameters. Obviously, EAX functions
  494. have no effect if no EAX supporting device (ie. SB Live) is used.
  495. env    : Reverb environment (EAX_ENVIRONMENT_xxx, -1=leave current)
  496. vol    : Volume of the reverb (0.0=off, 1.0=max, <0.0=leave current)
  497. decay  : Time in seconds it takes the reverb to diminish by 60dB (0.1-20.0, <0.0=leave current)
  498. damp   : The damping, high or low frequencies decay faster (0.0=high decays quickest,
  499.          1.0=low/high decay equally, 2.0=low decays quickest, <0.0=leave current) */
  500.  
  501. BOOL BASSDEF(BASS_GetEAXParameters)(DWORD *env, float *vol, float *decay, float *damp);
  502. /* Get the current EAX parameters.
  503. env    : Reverb environment (NULL=don't get it)
  504. vol    : Reverb volume (NULL=don't get it)
  505. decay  : Decay duration (NULL=don't get it)
  506. damp   : The damping (NULL=don't get it) */
  507.  
  508. BOOL BASSDEF(BASS_SetA3DResManager)(DWORD mode);
  509. /* Set the A3D resource management mode.
  510. mode   : The mode (A3D_RESMODE_OFF=disable resource management,
  511.          A3D_RESMODE_DYNAMIC=enable resource manager but looping channels are not managed,
  512.          A3D_RESMODE_DYNAMIC_LOOPERS=enable resource manager including looping channels,
  513.          A3D_RESMODE_NOTIFY=plays will fail when there are no available resources) */
  514.  
  515. DWORD BASSDEF(BASS_GetA3DResManager)();
  516. /* Get the A3D resource management mode.
  517. RETURN : The mode (0xffffffff=error) */
  518.  
  519. BOOL BASSDEF(BASS_SetA3DHFAbsorbtion)(float factor);
  520. /* Set the A3D high frequency absorbtion factor.
  521. factor  : Absorbtion factor (0.0=disabled, <1.0=diminished, 1.0=default,
  522.           >1.0=exaggerated) */
  523.  
  524. BOOL BASSDEF(BASS_GetA3DHFAbsorbtion)(float *factor);
  525. /* Retrieve the current A3D high frequency absorbtion factor.
  526. factor  : The absorbtion factor */
  527.  
  528.  
  529. HMUSIC BASSDEF(BASS_MusicLoad)(BOOL mem, void *file, DWORD offset, DWORD length, DWORD flags);
  530. /* Load a music (MO3/XM/MOD/S3M/IT/MTM). The amplification and pan
  531. seperation are initially set to 50, use BASS_MusicSetAmplify()
  532. and BASS_MusicSetPanSep() to adjust them.
  533. mem    : TRUE = Load music from memory
  534. file   : Filename (mem=FALSE) or memory location (mem=TRUE)
  535. offset : File offset to load the music from (only used if mem=FALSE)
  536. length : Data length (only used if mem=FALSE, 0=use to end of file)
  537. flags  : BASS_MUSIC_xxx flags
  538. RETURN : The loaded music's handle (NULL=error) */
  539.  
  540. void BASSDEF(BASS_MusicFree)(HMUSIC handle);
  541. /* Free a music's resources.
  542. handle : Music handle */
  543.  
  544. char *BASSDEF(BASS_MusicGetName)(HMUSIC handle);
  545. /* Retrieves a music's name.
  546. handle : Music handle
  547. RETURN : The music's name (NULL=error) */
  548.  
  549. DWORD BASSDEF(BASS_MusicGetLength)(HMUSIC handle);
  550. /* Retrieves the length of a music in patterns (ie. how many "orders"
  551. there are).
  552. handle : Music handle
  553. RETURN : The length of the music (0xFFFFFFFF=error) */
  554.  
  555. BOOL BASSDEF(BASS_MusicPlay)(HMUSIC handle);
  556. /* Play a music. Playback continues from where it was last stopped/paused.
  557. Multiple musics may be played simultaneously.
  558. handle : Handle of music to play */
  559.  
  560. BOOL BASSDEF(BASS_MusicPlayEx)(HMUSIC handle, DWORD pos, int flags, BOOL reset);
  561. /* Play a music, specifying start position and playback flags.
  562. handle : Handle of music to play
  563. pos    : Position to start playback from, LOWORD=order HIWORD=row
  564. flags  : BASS_MUSIC_xxx flags. These flags overwrite the defaults
  565.          specified when the music was loaded. (-1=use current flags)
  566. reset  : TRUE = Stop all current playing notes and reset bpm/etc... */
  567.  
  568. BOOL BASSDEF(BASS_MusicSetAmplify)(HMUSIC handle, DWORD amp);
  569. /* Set a music's amplification level.
  570. handle : Music handle
  571. amp    : Amplification level (0-100) */
  572.  
  573. BOOL BASSDEF(BASS_MusicSetPanSep)(HMUSIC handle, DWORD pan);
  574. /* Set a music's pan seperation.
  575. handle : Music handle
  576. pan    : Pan seperation (0-100, 50=linear) */
  577.  
  578. BOOL BASSDEF(BASS_MusicSetPositionScaler)(HMUSIC handle, DWORD scale);
  579. /* Set a music's "GetPosition" scaler
  580. When you call BASS_ChannelGetPosition, the "row" (HIWORD) will be
  581. scaled by this value. By using a higher scaler, you can get a more
  582. precise position indication.
  583. handle : Music handle
  584. scale  : The scaler (1-256) */
  585.  
  586.  
  587. HSAMPLE BASSDEF(BASS_SampleLoad)(BOOL mem, void *file, DWORD offset, DWORD length, DWORD max, DWORD flags);
  588. /* Load a WAV sample. If you're loading a sample with 3D functionality,
  589. then you should use BASS_GetInfo and BASS_SetInfo to set the default 3D
  590. parameters. You can also use these two functions to set the sample's
  591. default frequency/volume/pan/looping.
  592. mem    : TRUE = Load sample from memory
  593. file   : Filename (mem=FALSE) or memory location (mem=TRUE)
  594. offset : File offset to load the sample from (only used if mem=FALSE)
  595. length : Data length (only used if mem=FALSE, 0=use to end of file)
  596. max    : Maximum number of simultaneous playbacks (1-65535)
  597. flags  : BASS_SAMPLE_xxx flags (only the LOOP/3D/SOFTWARE/VAM/MUTEMAX/OVER_xxx flags are used)
  598. RETURN : The loaded sample's handle (NULL=error) */
  599.  
  600. void* BASSDEF(BASS_SampleCreate)(DWORD length, DWORD freq, DWORD max, DWORD flags);
  601. /* Create a sample. This function allows you to generate custom samples, or
  602. load samples that are not in the WAV format. A pointer is returned to the
  603. memory location at which you should write the sample's data. After writing
  604. the data, call BASS_SampleCreateDone to get the new sample's handle.
  605. length : The sample's length (in samples, NOT bytes)
  606. freq   : default sample rate
  607. max    : Maximum number of simultaneous playbacks (1-65535)
  608. flags  : BASS_SAMPLE_xxx flags
  609. RETURN : Memory location to write the sample's data (NULL=error) */
  610.  
  611. HSAMPLE BASSDEF(BASS_SampleCreateDone)();
  612. /* Finished creating a new sample.
  613. RETURN : The new sample's handle (NULL=error) */
  614.  
  615. void BASSDEF(BASS_SampleFree)(HSAMPLE handle);
  616. /* Free a sample's resources.
  617. handle : Sample handle */
  618.  
  619. BOOL BASSDEF(BASS_SampleGetInfo)(HSAMPLE handle, BASS_SAMPLE *info);
  620. /* Retrieve a sample's current default attributes.
  621. handle : Sample handle
  622. info   : Pointer to store sample info */
  623.  
  624. BOOL BASSDEF(BASS_SampleSetInfo)(HSAMPLE handle, BASS_SAMPLE *info);
  625. /* Set a sample's default attributes.
  626. handle : Sample handle
  627. info   : Sample info, only the freq/volume/pan/3D attributes and
  628.          looping/override method flags are used */
  629.  
  630. HCHANNEL BASSDEF(BASS_SamplePlay)(HSAMPLE handle);
  631. /* Play a sample, using the sample's default attributes.
  632. handle : Handle of sample to play
  633. RETURN : Handle of channel used to play the sample (NULL=error) */
  634.  
  635. HCHANNEL BASSDEF(BASS_SamplePlayEx)(HSAMPLE handle, DWORD start, int freq, int volume, int pan, BOOL loop);
  636. /* Play a sample, using specified attributes.
  637. handle : Handle of sample to play
  638. start  : Playback start position (in samples, not bytes)
  639. freq   : Playback rate (-1=default)
  640. volume : Volume (-1=default, 0=silent, 100=max)
  641. pan    : Pan position (-101=default, -100=left, 0=middle, 100=right)
  642. loop   : TRUE = Loop sample (-1=default)
  643. RETURN : Handle of channel used to play the sample (NULL=error) */
  644.  
  645. HCHANNEL BASSDEF(BASS_SamplePlay3D)(HSAMPLE handle, BASS_3DVECTOR *pos, BASS_3DVECTOR *orient, BASS_3DVECTOR *vel);
  646. /* Play a 3D sample, setting it's 3D position, orientation and velocity.
  647. handle : Handle of sample to play
  648. pos    : position of the sound (NULL = x/y/z=0.0)
  649. orient : orientation of the sound, this is irrelevant if it's an
  650.          omnidirectional sound source (NULL = x/y/z=0.0)
  651. vel    : velocity of the sound (NULL = x/y/z=0.0)
  652. RETURN : Handle of channel used to play the sample (NULL=error) */
  653.  
  654. HCHANNEL BASSDEF(BASS_SamplePlay3DEx)(HSAMPLE handle, BASS_3DVECTOR *pos, BASS_3DVECTOR *orient, BASS_3DVECTOR *vel, DWORD start, int freq, int volume, BOOL loop);
  655. /* Play a 3D sample, using specified attributes.
  656. handle : Handle of sample to play
  657. pos    : position of the sound (NULL = x/y/z=0.0)
  658. orient : orientation of the sound, this is irrelevant if it's an
  659.          omnidirectional sound source (NULL = x/y/z=0.0)
  660. vel    : velocity of the sound (NULL = x/y/z=0.0)
  661. start  : Playback start position (in samples, not bytes)
  662. freq   : Playback rate (-1=default)
  663. volume : Volume (-1=default, 0=silent, 100=max)
  664. loop   : TRUE = Loop sample (-1=default)
  665. RETURN : Handle of channel used to play the sample (NULL=error) */
  666.  
  667. BOOL BASSDEF(BASS_SampleStop)(HSAMPLE handle);
  668. /* Stops all instances of a sample. For example, if a sample is playing
  669. simultaneously 3 times, calling this function will stop all 3 of them,
  670. which is obviously simpler than calling BASS_ChannelStop() 3 times.
  671. handle : Handle of sample to stop */
  672.  
  673.  
  674. HSTREAM BASSDEF(BASS_StreamCreate)(DWORD freq, DWORD flags, STREAMPROC *proc, DWORD user);
  675. /* Create a user sample stream.
  676. freq   : Stream playback rate (100-100000)
  677. flags  : BASS_SAMPLE_xxx flags (only the 8BITS/MONO/3D flags are used)
  678. proc   : User defined stream writing function
  679. user   : The 'user' value passed to the callback function
  680. RETURN : The created stream's handle (NULL=error) */
  681.  
  682. HSTREAM BASSDEF(BASS_StreamCreateFile)(BOOL mem, void *file, DWORD offset, DWORD length, DWORD flags);
  683. /* Create a sample stream from an MP3 or WAV file.
  684. mem    : TRUE = Stream file from memory
  685. file   : Filename (mem=FALSE) or memory location (mem=TRUE)
  686. offset : File offset of the stream data
  687. length : File length (0=use whole file if mem=FALSE)
  688. flags  : BASS_SAMPLE_3D/BASS_SAMPLE_MONO/BASS_MP3_HALFRATE/BASS_MP3_SETPOS flags
  689. RETURN : The created stream's handle (NULL=error) */
  690.  
  691. void BASSDEF(BASS_StreamFree)(HSTREAM handle);
  692. /* Free a sample stream's resources.
  693. handle : Stream handle */
  694.  
  695. DWORD BASSDEF(BASS_StreamGetLength)(HSTREAM handle);
  696. /* Retrieves the playback length (in bytes) of a file stream. It's not always
  697. possible to 100% accurately guess the length of a stream, so the length returned
  698. may be only an approximation when using some WAV codecs.
  699. handle : Stream handle 
  700. RETURN : The length (0xffffffff=error) */
  701.  
  702. DWORD BASSDEF(BASS_StreamGetBlockLength)(HSTREAM handle);
  703. /* Retrieves the playback length (in bytes) of a block in a file stream.
  704. handle : Stream handle
  705. RETURN : The block length (0xffffffff=error) */
  706.  
  707. BOOL BASSDEF(BASS_StreamPlay)(HSTREAM handle, BOOL flush, DWORD flags);
  708. /* Play a sample stream, optionally flushing the buffer first.
  709. handle : Handle of stream to play
  710. flush  : Flush buffer contents. If you stop a stream and then want to
  711.          continue it from where it stopped, don't flush it. Flushing
  712.          a file stream causes it to restart from the beginning.
  713. flags  : BASS_SAMPLE_LOOP flag (only affects file streams) */
  714.  
  715.  
  716. BOOL BASSDEF(BASS_CDInit)(char *drive);
  717. /* Initialize the CD functions, must be called before any other CD
  718. functions. The volume is initially set to 100 (the maximum), use
  719. BASS_ChannelSetAttributes() to adjust it.
  720. drive  : The CD drive, for example: "d:" (NULL=use default drive) */
  721.  
  722. void BASSDEF(BASS_CDFree)();
  723. /* Free resources used by the CD */
  724.  
  725. BOOL BASSDEF(BASS_CDInDrive)();
  726. /* Check if there is a CD in the drive. */
  727.  
  728. BOOL BASSDEF(BASS_CDPlay)(DWORD track, BOOL loop, BOOL wait);
  729. /* Play a CD track.
  730. track  : Track number to play (1=first)
  731. loop   : TRUE = Loop the track
  732. wait   : TRUE = don't return until playback has started (some drives
  733.                 will always wait anyway) */
  734.  
  735.  
  736. /* A "channel" can be a playing sample (HCHANNEL), a MOD music (HMUSIC),
  737. a sample stream (HSTREAM), or the CD (CDCHANNEL). The following
  738. functions can be used with one or more of these channel types. */
  739.  
  740. BOOL BASSDEF(BASS_ChannelIsActive)(DWORD handle);
  741. /* Check if a channel is active (playing).
  742. handle : Channel handle (HCHANNEL/HMUSIC/HSTREAM, or CDCHANNEL) */
  743.  
  744. DWORD BASSDEF(BASS_ChannelGetFlags)(DWORD handle);
  745. /* Get some info about a channel.
  746. handle : Channel handle (HCHANNEL/HMUSIC/HSTREAM)
  747. RETURN : BASS_SAMPLE_xxx flags (0xffffffff=error) */
  748.  
  749. BOOL BASSDEF(BASS_ChannelStop)(DWORD handle);
  750. /* Stop a channel.
  751. handle : Channel handle (HCHANNEL/HMUSIC/HSTREAM, or CDCHANNEL) */
  752.  
  753. BOOL BASSDEF(BASS_ChannelPause)(DWORD handle);
  754. /* Pause a channel.
  755. handle : Channel handle (HCHANNEL/HMUSIC/HSTREAM, or CDCHANNEL) */
  756.  
  757. BOOL BASSDEF(BASS_ChannelResume)(DWORD handle);
  758. /* Resume a paused channel.
  759. handle : Channel handle (HCHANNEL/HMUSIC/HSTREAM, or CDCHANNEL) */
  760.  
  761. BOOL BASSDEF(BASS_ChannelSetAttributes)(DWORD handle, int freq, int volume, int pan);
  762. /* Update a channel's attributes. The actual setting may not be exactly
  763. as specified, depending on the accuracy of the device and drivers.
  764. NOTE: Only the volume can be adjusted for the CD "channel", but not all
  765. soundcards allow controlling of the CD volume level.
  766. handle : Channel handle (HCHANNEL/HMUSIC/HSTREAM, or CDCHANNEL)
  767. freq   : Playback rate (100-100000, 0=original, -1=leave current)
  768. volume : Volume (-1=leave current, 0=silent, 100=max)
  769. pan    : Pan position (-101=current, -100=left, 0=middle, 100=right)
  770.          panning has no effect on 3D channels */
  771.  
  772. BOOL BASSDEF(BASS_ChannelGetAttributes)(DWORD handle, DWORD *freq, DWORD *volume, int *pan);
  773. /* Retrieve a channel's attributes. Only the volume is available for
  774. the CD "channel" (if allowed by the soundcard/drivers).
  775. handle : Channel handle (HCHANNEL/HMUSIC/HSTREAM, or CDCHANNEL)
  776. freq   : Pointer to store playback rate (NULL=don't retrieve it)
  777. volume : Pointer to store volume (NULL=don't retrieve it)
  778. pan    : Pointer to store pan position (NULL=don't retrieve it) */
  779.  
  780. BOOL BASSDEF(BASS_ChannelSet3DAttributes)(DWORD handle, int mode, float min, float max, int iangle, int oangle, int outvol);
  781. /* Set a channel's 3D attributes.
  782. handle : Channel handle (HCHANNEL/HSTREAM/HMUSIC)
  783. mode   : BASS_3DMODE_xxx mode (-1=leave current setting)
  784. min    : minimum distance, volume stops increasing within this distance (<0.0=leave current)
  785. max    : maximum distance, volume stops decreasing past this distance (<0.0=leave current)
  786. iangle : angle of inside projection cone in degrees (360=omnidirectional, -1=leave current)
  787. oangle : angle of outside projection cone in degrees (-1=leave current)
  788.          NOTE: iangle & oangle must both be set in a single call
  789. outvol : delta-volume outside the projection cone (0=silent, 100=same as inside)
  790. The iangle/oangle angles decide how wide the sound is projected around the
  791. orientation angle. Within the inside angle the volume level is the channel
  792. level as set with BASS_ChannelSetAttributes, from the inside to the outside
  793. angles the volume gradually changes by the "outvol" setting. */
  794.  
  795. BOOL BASSDEF(BASS_ChannelGet3DAttributes)(DWORD handle, DWORD *mode, float *min, float *max, DWORD *iangle, DWORD *oangle, DWORD *outvol);
  796. /* Retrieve a channel's 3D attributes.
  797. handle : Channel handle (HCHANNEL/HSTREAM/HMUSIC)
  798. mode   : BASS_3DMODE_xxx mode (NULL=don't retrieve it)
  799. min    : minumum distance (NULL=don't retrieve it)
  800. max    : maximum distance (NULL=don't retrieve it)
  801. iangle : angle of inside projection cone (NULL=don't retrieve it)
  802. oangle : angle of outside projection cone (NULL=don't retrieve it)
  803.          NOTE: iangle & oangle must both be retrieved in a single call
  804. outvol : delta-volume outside the projection cone (NULL=don't retrieve it) */
  805.  
  806. BOOL BASSDEF(BASS_ChannelSet3DPosition)(DWORD handle, BASS_3DVECTOR *pos, BASS_3DVECTOR *orient, BASS_3DVECTOR *vel);
  807. /* Update a channel's 3D position, orientation and velocity. The velocity
  808. is only used to calculate the doppler effect.
  809. handle : Channel handle (HCHANNEL/HSTREAM/HMUSIC)
  810. pos    : position of the sound (NULL=leave current)
  811. orient : orientation of the sound, this is irrelevant if it's an
  812.          omnidirectional sound source (NULL=leave current)
  813. vel    : velocity of the sound (NULL=leave current) */
  814.  
  815. BOOL BASSDEF(BASS_ChannelGet3DPosition)(DWORD handle, BASS_3DVECTOR *pos, BASS_3DVECTOR *orient, BASS_3DVECTOR *vel);
  816. /* Retrieve a channel's current 3D position, orientation and velocity.
  817. handle : Channel handle (HCHANNEL/HSTREAM/HMUSIC)
  818. pos    : position of the sound (NULL=don't retrieve it)
  819. orient : orientation of the sound, this is irrelevant if it's an
  820.          omnidirectional sound source (NULL=don't retrieve it)
  821. vel    : velocity of the sound (NULL=don't retrieve it) */
  822.  
  823. BOOL BASSDEF(BASS_ChannelSetPosition)(DWORD handle, DWORD pos);
  824. /* Set the current playback position of a channel.
  825. handle : Channel handle (HCHANNEL/HMUSIC/HSTREAM, or CDCHANNEL)
  826. pos    : the position
  827.     if HCHANNEL: position in bytes
  828.     if HMUSIC: LOWORD=order HIWORD=row ... use MAKELONG(order,row)
  829.     if HSTREAM: position in bytes, file streams (WAV/MP3) only (MP3s require BASS_MP3_SETPOS)
  830.     if CDCHANNEL: position in milliseconds from start of track */
  831.  
  832. DWORD BASSDEF(BASS_ChannelGetPosition)(DWORD handle);
  833. /* Get the current playback position of a channel.
  834. handle : Channel handle (HCHANNEL/HMUSIC/HSTREAM, or CDCHANNEL)
  835. RETURN : the position (0xffffffff=error)
  836.     if HCHANNEL: position in bytes
  837.     if HMUSIC: LOWORD=order HIWORD=row (see BASS_MusicSetPositionScaler)
  838.     if HSTREAM: total bytes played since the stream was last flushed
  839.     if CDCHANNEL: position in milliseconds from start of track */
  840.  
  841. DWORD BASSDEF(BASS_ChannelGetLevel)(DWORD handle);
  842. /* Calculate a channel's current output level.
  843. handle : Channel handle (HMUSIC/HSTREAM)
  844. RETURN : LOWORD=left level (0-128) HIWORD=right level (0-128) (0xffffffff=error) */
  845.  
  846. DWORD BASSDEF(BASS_ChannelGetData)(DWORD handle, void *buffer, DWORD length);
  847. /* Retrieves upto "length" bytes of the channel's current sample data. This is
  848. useful if you wish to "visualize" the sound.
  849. handle : Channel handle (HMUSIC/HSTREAM)
  850. buffer : Location to write the sample data
  851. length : Number of bytes wanted
  852. RETURN : Number of bytes actually written to the buffer (0xffffffff=error) */
  853.  
  854. HSYNC BASSDEF(BASS_ChannelSetSync)(DWORD handle, DWORD type, DWORD param, SYNCPROC *proc, DWORD user);
  855. /* Setup a sync on a channel. Multiple syncs may be used per channel.
  856. handle : Channel handle
  857. type   : Sync type (BASS_SYNC_xxx type & flags)
  858. param  : Sync parameters (see the BASS_SYNC_xxx type description)
  859. proc   : User defined callback function
  860. user   : The 'user' value passed to the callback function
  861. RETURN : Sync handle (NULL=error) */
  862.  
  863. BOOL BASSDEF(BASS_ChannelRemoveSync)(DWORD handle, HSYNC sync);
  864. /* Remove a sync from a channel
  865. handle : Channel handle
  866. sync   : Handle of sync to remove */
  867.  
  868. HDSP BASSDEF(BASS_ChannelSetDSP)(DWORD handle, DSPPROC *proc, DWORD user);
  869. /* Setup a user DSP function on a channel. When multiple DSP functions
  870. are used on a channel, they are called in the order that they were added.
  871. handle : Channel handle (HMUSIC/HSTREAM)
  872. proc   : User defined callback function
  873. user   : The 'user' value passed to the callback function
  874. RETURN : DSP handle (NULL=error) */
  875.  
  876. BOOL BASSDEF(BASS_ChannelRemoveDSP)(DWORD handle, HDSP dsp);
  877. /* Remove a DSP function from a channel
  878. handle : Channel handle (HMUSIC/HSTREAM)
  879. dsp    : Handle of DSP to remove */
  880.  
  881. BOOL BASSDEF(BASS_ChannelSetEAXMix)(DWORD handle, float mix);
  882. /* Set the wet(reverb)/dry(no reverb) mix ratio on the channel. By default
  883. the distance of the sound from the listener is used to calculate the mix.
  884. NOTE: The channel must have 3D functionality enabled for the EAX environment
  885. to have any affect on it.
  886. handle : Channel handle (HCHANNEL/HSTREAM/HMUSIC)
  887. mix    : The ratio (0.0=reverb off, 1.0=max reverb, -1.0=let EAX calculate
  888.          the reverb mix based on the distance) */
  889.  
  890. BOOL BASSDEF(BASS_ChannelGetEAXMix)(DWORD handle, float *mix);
  891. /* Get the wet(reverb)/dry(no reverb) mix ratio on the channel.
  892. handle : Channel handle (HCHANNEL/HSTREAM/HMUSIC)
  893. mix    : Pointer to store the ratio at */
  894.  
  895. #ifdef __cplusplus
  896. }
  897. #endif
  898.  
  899. #endif
  900.