home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 November / CDVD1105.ISO / Software / Freeware / programare / bass / vb / Bass.bas
Encoding:
BASIC Source File  |  2005-09-27  |  48.2 KB  |  933 lines

  1. Attribute VB_Name = "modBass"
  2. 'BASS 2.2 Visual Basic API, (c) 1999-2005 Ian Luck.
  3. 'Please report bugs/suggestions/etc... to bass@un4seen.com
  4.  
  5. 'See the BASS.CHM file for detailed documentation
  6.  
  7. 'NOTE: VB does not support 64-bit integers, so VB users only have access
  8. '      to the low 32-bits of 64-bit return values. 64-bit parameters can
  9. '      be specified though, using the "64" version of the function.
  10.  
  11. 'NOTE: Use the VBStrFromAnsiPtr function to convert "char *" to VB "String".
  12.  
  13.  
  14. Global Const BASSTRUE As Long = 1   'Use this instead of VB Booleans
  15. Global Const BASSFALSE As Long = 0  'Use this instead of VB Booleans
  16.  
  17. '***********************************************
  18. '* Error codes returned by BASS_ErrorGetCode() *
  19. '***********************************************
  20. Global Const BASS_OK = 0               'all is OK
  21. Global Const BASS_ERROR_MEM = 1        'memory error
  22. Global Const BASS_ERROR_FILEOPEN = 2   'can't open the file
  23. Global Const BASS_ERROR_DRIVER = 3     'can't find a free sound driver
  24. Global Const BASS_ERROR_BUFLOST = 4    'the sample buffer was lost
  25. Global Const BASS_ERROR_HANDLE = 5     'invalid handle
  26. Global Const BASS_ERROR_FORMAT = 6     'unsupported sample format
  27. Global Const BASS_ERROR_POSITION = 7   'invalid playback position
  28. Global Const BASS_ERROR_INIT = 8       'BASS_Init has not been successfully called
  29. Global Const BASS_ERROR_START = 9      'BASS_Start has not been successfully called
  30. Global Const BASS_ERROR_ALREADY = 14   'already initialized/paused/whatever
  31. Global Const BASS_ERROR_NOPAUSE = 16   'not paused
  32. Global Const BASS_ERROR_NOCHAN = 18    'can't get a free channel
  33. Global Const BASS_ERROR_ILLTYPE = 19   'an illegal type was specified
  34. Global Const BASS_ERROR_ILLPARAM = 20  'an illegal parameter was specified
  35. Global Const BASS_ERROR_NO3D = 21      'no 3D support
  36. Global Const BASS_ERROR_NOEAX = 22     'no EAX support
  37. Global Const BASS_ERROR_DEVICE = 23    'illegal device number
  38. Global Const BASS_ERROR_NOPLAY = 24    'not playing
  39. Global Const BASS_ERROR_FREQ = 25      'illegal sample rate
  40. Global Const BASS_ERROR_NOTFILE = 27   'the stream is not a file stream
  41. Global Const BASS_ERROR_NOHW = 29      'no hardware voices available
  42. Global Const BASS_ERROR_EMPTY = 31     'the MOD music has no sequence data
  43. Global Const BASS_ERROR_NONET = 32     'no internet connection could be opened
  44. Global Const BASS_ERROR_CREATE = 33    'couldn't create the file
  45. Global Const BASS_ERROR_NOFX = 34      'effects are not available
  46. Global Const BASS_ERROR_PLAYING = 35   'the channel is playing
  47. Global Const BASS_ERROR_NOTAVAIL = 37  'requested data is not available
  48. Global Const BASS_ERROR_DECODE = 38    'the channel is a "decoding channel"
  49. Global Const BASS_ERROR_DX = 39        'a sufficient DirectX version is not installed
  50. Global Const BASS_ERROR_TIMEOUT = 40   'connection timedout
  51. Global Const BASS_ERROR_FILEFORM = 41  'unsupported file format
  52. Global Const BASS_ERROR_SPEAKER = 42   'unavailable speaker
  53. Global Const BASS_ERROR_UNKNOWN = -1   'some other mystery error
  54.  
  55. '************************
  56. '* Initialization flags *
  57. '************************
  58. Global Const BASS_DEVICE_8BITS = 1     'use 8 bit resolution, else 16 bit
  59. Global Const BASS_DEVICE_MONO = 2      'use mono, else stereo
  60. Global Const 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. Global Const BASS_DEVICE_LATENCY = 256 'calculate device latency (BASS_INFO struct)
  65. Global Const BASS_DEVICE_SPEAKERS = 2048 'force enabling of speaker assignment
  66.  
  67. '***********************************
  68. '* BASS_INFO flags (from DSOUND.H) *
  69. '***********************************
  70. Global Const DSCAPS_CONTINUOUSRATE = 16
  71. ' supports all sample rates between min/maxrate
  72. Global Const DSCAPS_EMULDRIVER = 32
  73. ' device does NOT have hardware DirectSound support
  74. Global Const DSCAPS_CERTIFIED = 64
  75. ' device driver has been certified by Microsoft
  76. ' The following flags tell what type of samples are supported by HARDWARE
  77. ' mixing, all these formats are supported by SOFTWARE mixing
  78. Global Const DSCAPS_SECONDARYMONO = 256    ' mono
  79. Global Const DSCAPS_SECONDARYSTEREO = 512  ' stereo
  80. Global Const DSCAPS_SECONDARY8BIT = 1024   ' 8 bit
  81. Global Const DSCAPS_SECONDARY16BIT = 2048  ' 16 bit
  82.  
  83. '*****************************************
  84. '* BASS_RECORDINFO flags (from DSOUND.H) *
  85. '*****************************************
  86. Global Const DSCCAPS_EMULDRIVER = DSCAPS_EMULDRIVER
  87. ' device does NOT have hardware DirectSound recording support
  88. Global Const DSCCAPS_CERTIFIED = DSCAPS_CERTIFIED
  89. ' device driver has been certified by Microsoft
  90.  
  91. '******************************************************************
  92. '* defines for formats field of BASS_RECORDINFO (from MMSYSTEM.H) *
  93. '******************************************************************
  94. Global Const WAVE_FORMAT_1M08 = &H1          ' 11.025 kHz, Mono,   8-bit
  95. Global Const WAVE_FORMAT_1S08 = &H2          ' 11.025 kHz, Stereo, 8-bit
  96. Global Const WAVE_FORMAT_1M16 = &H4          ' 11.025 kHz, Mono,   16-bit
  97. Global Const WAVE_FORMAT_1S16 = &H8          ' 11.025 kHz, Stereo, 16-bit
  98. Global Const WAVE_FORMAT_2M08 = &H10         ' 22.05  kHz, Mono,   8-bit
  99. Global Const WAVE_FORMAT_2S08 = &H20         ' 22.05  kHz, Stereo, 8-bit
  100. Global Const WAVE_FORMAT_2M16 = &H40         ' 22.05  kHz, Mono,   16-bit
  101. Global Const WAVE_FORMAT_2S16 = &H80         ' 22.05  kHz, Stereo, 16-bit
  102. Global Const WAVE_FORMAT_4M08 = &H100        ' 44.1   kHz, Mono,   8-bit
  103. Global Const WAVE_FORMAT_4S08 = &H200        ' 44.1   kHz, Stereo, 8-bit
  104. Global Const WAVE_FORMAT_4M16 = &H400        ' 44.1   kHz, Mono,   16-bit
  105. Global Const WAVE_FORMAT_4S16 = &H800        ' 44.1   kHz, Stereo, 16-bit
  106.  
  107. '*********************
  108. '* Sample info flags *
  109. '*********************
  110. Global Const BASS_SAMPLE_8BITS = 1          ' 8 bit
  111. Global Const BASS_SAMPLE_FLOAT = 256        ' 32-bit floating-point
  112. Global Const BASS_SAMPLE_MONO = 2           ' mono, else stereo
  113. Global Const BASS_SAMPLE_LOOP = 4           ' looped
  114. Global Const BASS_SAMPLE_3D = 8             ' 3D functionality enabled
  115. Global Const BASS_SAMPLE_SOFTWARE = 16      ' it's NOT using hardware mixing
  116. Global Const BASS_SAMPLE_MUTEMAX = 32       ' muted at max distance (3D only)
  117. Global Const BASS_SAMPLE_VAM = 64           ' uses the DX7 voice allocation & management
  118. Global Const BASS_SAMPLE_FX = 128           ' old implementation of DX8 effects are enabled
  119. Global Const BASS_SAMPLE_OVER_VOL = &H10000 ' override lowest volume
  120. Global Const BASS_SAMPLE_OVER_POS = &H20000 ' override longest playing
  121. Global Const BASS_SAMPLE_OVER_DIST = &H30000 ' override furthest from listener (3D only)
  122.  
  123. Global Const BASS_STREAM_PRESCAN = &H20000   ' enable pin-point seeking (MP3/MP2/MP1)
  124. Global Const BASS_MP3_SETPOS = BASS_STREAM_PRESCAN
  125. Global Const BASS_STREAM_AUTOFREE = &H40000 ' automatically free the stream when it stop/ends
  126. Global Const BASS_STREAM_RESTRATE = &H80000 ' restrict the download rate of internet file streams
  127. Global Const BASS_STREAM_BLOCK = &H100000   ' download/play internet file stream in small blocks
  128. Global Const BASS_STREAM_DECODE = &H200000  ' don't play the stream, only decode (BASS_ChannelGetData)
  129. Global Const BASS_STREAM_STATUS = &H800000  ' give server status info (HTTP/ICY tags) in DOWNLOADPROC
  130.  
  131. Global Const BASS_MUSIC_FLOAT = BASS_SAMPLE_FLOAT ' 32-bit floating-point
  132. Global Const BASS_MUSIC_MONO = BASS_SAMPLE_MONO ' force mono mixing (less CPU usage)
  133. Global Const BASS_MUSIC_LOOP = BASS_SAMPLE_LOOP ' loop music
  134. Global Const BASS_MUSIC_3D = BASS_SAMPLE_3D ' enable 3D functionality
  135. Global Const BASS_MUSIC_FX = BASS_SAMPLE_FX ' enable old implementation of DX8 effects
  136. Global Const BASS_MUSIC_AUTOFREE = BASS_STREAM_AUTOFREE ' automatically free the music when it stop/ends
  137. Global Const BASS_MUSIC_DECODE = BASS_STREAM_DECODE ' don't play the music, only decode (BASS_ChannelGetData)
  138. Global Const BASS_MUSIC_PRESCAN = BASS_STREAM_PRESCAN ' calculate playback length
  139. Global Const BASS_MUSIC_CALCLEN = BASS_MUSIC_PRESCAN
  140. Global Const BASS_MUSIC_RAMP = &H200        ' normal ramping
  141. Global Const BASS_MUSIC_RAMPS = &H400       ' sensitive ramping
  142. Global Const BASS_MUSIC_SURROUND = &H800    ' surround sound
  143. Global Const BASS_MUSIC_SURROUND2 = &H1000  ' surround sound (mode 2)
  144. Global Const BASS_MUSIC_FT2MOD = &H2000     ' play .MOD as FastTracker 2 does
  145. Global Const BASS_MUSIC_PT1MOD = &H4000     ' play .MOD as ProTracker 1 does
  146. Global Const BASS_MUSIC_NONINTER = &H10000  ' non-interpolated mixing
  147. Global Const BASS_MUSIC_POSRESET = 32768  ' stop all notes when moving position
  148. Global Const BASS_MUSIC_POSRESETEX = &H400000 ' stop all notes and reset bmp/etc when moving position
  149. Global Const BASS_MUSIC_STOPBACK = &H80000  ' stop the music on a backwards jump effect
  150. Global Const BASS_MUSIC_NOSAMPLE = &H100000 ' don't load the samples
  151.  
  152. ' Speaker assignment flags
  153. Global Const BASS_SPEAKER_FRONT = &H1000000 ' front speakers
  154. Global Const BASS_SPEAKER_REAR = &H2000000  ' rear/side speakers
  155. Global Const BASS_SPEAKER_CENLFE = &H3000000 ' center & LFE speakers (5.1)
  156. Global Const BASS_SPEAKER_REAR2 = &H4000000 ' rear center speakers (7.1)
  157. Global Const BASS_SPEAKER_LEFT = &H10000000 ' modifier: left
  158. Global Const BASS_SPEAKER_RIGHT = &H20000000 ' modifier: right
  159. Global Const BASS_SPEAKER_FRONTLEFT = BASS_SPEAKER_FRONT Or BASS_SPEAKER_LEFT
  160. Global Const BASS_SPEAKER_FRONTRIGHT = BASS_SPEAKER_FRONT Or BASS_SPEAKER_RIGHT
  161. Global Const BASS_SPEAKER_REARLEFT = BASS_SPEAKER_REAR Or BASS_SPEAKER_LEFT
  162. Global Const BASS_SPEAKER_REARRIGHT = BASS_SPEAKER_REAR Or BASS_SPEAKER_RIGHT
  163. Global Const BASS_SPEAKER_CENTER = BASS_SPEAKER_CENLFE Or BASS_SPEAKER_LEFT
  164. Global Const BASS_SPEAKER_LFE = BASS_SPEAKER_CENLFE Or BASS_SPEAKER_RIGHT
  165. Global Const BASS_SPEAKER_REAR2LEFT = BASS_SPEAKER_REAR2 Or BASS_SPEAKER_LEFT
  166. Global Const BASS_SPEAKER_REAR2RIGHT = BASS_SPEAKER_REAR2 Or BASS_SPEAKER_RIGHT
  167.  
  168. Global Const BASS_UNICODE = &H80000000
  169.  
  170. Global Const BASS_RECORD_PAUSE = 32768 ' start recording paused
  171.  
  172. '**********************************************
  173. '* BASS_StreamGetTags flags : what's returned *
  174. '**********************************************
  175. Global Const BASS_TAG_ID3 = 0   'ID3v1 tags : 128 byte block
  176. Global Const BASS_TAG_ID3V2 = 1 'ID3v2 tags : variable length block
  177. Global Const BASS_TAG_OGG = 2   'OGG comments : array of null-terminated strings
  178. Global Const BASS_TAG_HTTP = 3  'HTTP headers : array of null-terminated strings
  179. Global Const BASS_TAG_ICY = 4   'ICY headers : array of null-terminated strings
  180. Global Const BASS_TAG_META = 5  'ICY metadata : null-terminated string
  181.  
  182. '********************
  183. '* 3D channel modes *
  184. '********************
  185. Global Const BASS_3DMODE_NORMAL = 0
  186. ' normal 3D processing
  187. Global Const BASS_3DMODE_RELATIVE = 1
  188. ' The channel's 3D position (position/velocity/orientation) are relative to
  189. ' the listener. When the listener's position/velocity/orientation is changed
  190. ' with BASS_Set3DPosition, the channel's position relative to the listener does
  191. ' not change.
  192. Global Const BASS_3DMODE_OFF = 2
  193. ' Turn off 3D processing on the channel, the sound will be played
  194. ' in the center.
  195.  
  196. '****************************************************
  197. '* EAX environments, use with BASS_SetEAXParameters *
  198. '****************************************************
  199. Global Const EAX_ENVIRONMENT_GENERIC = 0
  200. Global Const EAX_ENVIRONMENT_PADDEDCELL = 1
  201. Global Const EAX_ENVIRONMENT_ROOM = 2
  202. Global Const EAX_ENVIRONMENT_BATHROOM = 3
  203. Global Const EAX_ENVIRONMENT_LIVINGROOM = 4
  204. Global Const EAX_ENVIRONMENT_STONEROOM = 5
  205. Global Const EAX_ENVIRONMENT_AUDITORIUM = 6
  206. Global Const EAX_ENVIRONMENT_CONCERTHALL = 7
  207. Global Const EAX_ENVIRONMENT_CAVE = 8
  208. Global Const EAX_ENVIRONMENT_ARENA = 9
  209. Global Const EAX_ENVIRONMENT_HANGAR = 10
  210. Global Const EAX_ENVIRONMENT_CARPETEDHALLWAY = 11
  211. Global Const EAX_ENVIRONMENT_HALLWAY = 12
  212. Global Const EAX_ENVIRONMENT_STONECORRIDOR = 13
  213. Global Const EAX_ENVIRONMENT_ALLEY = 14
  214. Global Const EAX_ENVIRONMENT_FOREST = 15
  215. Global Const EAX_ENVIRONMENT_CITY = 16
  216. Global Const EAX_ENVIRONMENT_MOUNTAINS = 17
  217. Global Const EAX_ENVIRONMENT_QUARRY = 18
  218. Global Const EAX_ENVIRONMENT_PLAIN = 19
  219. Global Const EAX_ENVIRONMENT_PARKINGLOT = 20
  220. Global Const EAX_ENVIRONMENT_SEWERPIPE = 21
  221. Global Const EAX_ENVIRONMENT_UNDERWATER = 22
  222. Global Const EAX_ENVIRONMENT_DRUGGED = 23
  223. Global Const EAX_ENVIRONMENT_DIZZY = 24
  224. Global Const EAX_ENVIRONMENT_PSYCHOTIC = 25
  225. ' total number of environments
  226. Global Const EAX_ENVIRONMENT_COUNT = 26
  227.  
  228. '**********************************************************************
  229. '* Sync types (with BASS_ChannelSetSync() "param" and SYNCPROC "data" *
  230. '* definitions) & flags.                                              *
  231. '**********************************************************************
  232. Global Const BASS_SYNC_POS = 0
  233. ' Sync when a channel reaches a position.
  234. ' param: position in bytes
  235. ' data : not used
  236. Global Const BASS_SYNC_END = 2
  237. ' Sync when a channel reaches the end.
  238. ' param: not used
  239. ' data : not used
  240. Global Const BASS_SYNC_META = 4
  241. ' Sync when metadata is received in a stream.
  242. ' param: not used
  243. ' data : pointer to the metadata
  244. Global Const BASS_SYNC_SLIDE = 5
  245. ' Sync when an attribute slide is completed.
  246. ' param: not used
  247. ' data : the type of slide completed (one of the BASS_SLIDE_xxx values)
  248. Global Const BASS_SYNC_STALL = 6
  249. ' Sync when playback has stalled.
  250. ' param: not used
  251. ' data : 0=stalled, 1=resumed
  252. Global Const BASS_SYNC_DOWNLOAD = 7
  253. ' Sync when downloading of an internet (or "buffered" user file) stream has ended.
  254. ' param: not used
  255. ' data : not used
  256. Global Const BASS_SYNC_FREE = 8
  257. ' Sync when a channel is freed.
  258. ' param: not used
  259. ' data : not used
  260. Global Const BASS_SYNC_MUSICPOS = 10
  261. ' Sync when a MOD music reaches an order:row position.
  262. ' param: LOWORD=order (0=first, -1=all) HIWORD=row (0=first, -1=all)
  263. ' data : LOWORD=order HIWORD=row
  264. Global Const BASS_SYNC_MUSICINST = 1
  265. ' Sync when an instrument (sample for the non-instrument based formats)
  266. ' is played in a MOD music (not including retrigs).
  267. ' param: LOWORD=instrument (1=first) HIWORD=note (0=c0...119=b9, -1=all)
  268. ' data : LOWORD=note HIWORD=volume (0-64)
  269. Global Const BASS_SYNC_MUSICFX = 3
  270. ' Sync when the "sync" effect (XM/MTM/MOD: E8x/Wxx, IT/S3M: S2x) is used.
  271. ' param: 0:data=pos, 1:data="x" value
  272. ' data : param=0: LOWORD=order HIWORD=row, param=1: "x" value
  273. Global Const BASS_SYNC_MESSAGE = &H20000000 ' FLAG: post a Windows message (instead of callback)
  274. ' When using a window message "callback", the message to post is given in the "proc"
  275. ' parameter of BASS_ChannelSetSync, and is posted to the window specified in the BASS_Init
  276. ' call. The message parameters are: WPARAM = data, LPARAM = user.
  277. Global Const BASS_SYNC_MIXTIME = &H40000000 ' FLAG: sync at mixtime, else at playtime
  278. Global Const BASS_SYNC_ONETIME = &H80000000 ' FLAG: sync only once, else continuously
  279.  
  280. ' BASS_ChannelIsActive return values
  281. Global Const BASS_ACTIVE_STOPPED = 0
  282. Global Const BASS_ACTIVE_PLAYING = 1
  283. Global Const BASS_ACTIVE_STALLED = 2
  284. Global Const BASS_ACTIVE_PAUSED = 3
  285.  
  286. ' BASS_ChannelIsSliding return flags
  287. Global Const BASS_SLIDE_FREQ = 1
  288. Global Const BASS_SLIDE_VOL = 2
  289. Global Const BASS_SLIDE_PAN = 4
  290.  
  291. ' BASS_ChannelGetData flags
  292. Global Const BASS_DATA_AVAILABLE = 0         ' query how much data is buffered
  293. Global Const BASS_DATA_FLOAT = &H40000000    ' flag: return floating-point sample data
  294. Global Const BASS_DATA_FFT512 = &H80000000   ' 512 sample FFT
  295. Global Const BASS_DATA_FFT1024 = &H80000001  ' 1024 FFT
  296. Global Const BASS_DATA_FFT2048 = &H80000002  ' 2048 FFT
  297. Global Const BASS_DATA_FFT4096 = &H80000003  ' 4096 FFT
  298. Global Const BASS_DATA_FFT_INDIVIDUAL = &H10 ' FFT flag: FFT for each channel, else all combined
  299. Global Const BASS_DATA_FFT_NOWINDOW = &H20   ' FFT flag: no Hanning window
  300.  
  301. ' BASS_RecordSetInput flags
  302. Global Const BASS_INPUT_OFF = &H10000
  303. Global Const BASS_INPUT_ON = &H20000
  304. Global Const BASS_INPUT_LEVEL = &H40000
  305.  
  306. Global Const BASS_INPUT_TYPE_MASK = &HFF000000
  307. Global Const BASS_INPUT_TYPE_UNDEF = &H0
  308. Global Const BASS_INPUT_TYPE_DIGITAL = &H1000000
  309. Global Const BASS_INPUT_TYPE_LINE = &H2000000
  310. Global Const BASS_INPUT_TYPE_MIC = &H3000000
  311. Global Const BASS_INPUT_TYPE_SYNTH = &H4000000
  312. Global Const BASS_INPUT_TYPE_CD = &H5000000
  313. Global Const BASS_INPUT_TYPE_PHONE = &H6000000
  314. Global Const BASS_INPUT_TYPE_SPEAKER = &H7000000
  315. Global Const BASS_INPUT_TYPE_WAVE = &H8000000
  316. Global Const BASS_INPUT_TYPE_AUX = &H9000000
  317. Global Const BASS_INPUT_TYPE_ANALOG = &HA000000
  318.  
  319. ' BASS_MusicSet/GetAttribute options
  320. Global Const BASS_MUSIC_ATTRIB_AMPLIFY = 0
  321. Global Const BASS_MUSIC_ATTRIB_PANSEP = 1
  322. Global Const BASS_MUSIC_ATTRIB_PSCALER = 2
  323. Global Const BASS_MUSIC_ATTRIB_BPM = 3
  324. Global Const BASS_MUSIC_ATTRIB_SPEED = 4
  325. Global Const BASS_MUSIC_ATTRIB_VOL_GLOBAL = 5
  326. Global Const BASS_MUSIC_ATTRIB_VOL_CHAN = &H100 ' + channel #
  327. Global Const BASS_MUSIC_ATTRIB_VOL_INST = &H200 ' + instrument #
  328.  
  329. ' BASS_Set/GetConfig options
  330. Global Const BASS_CONFIG_BUFFER = 0
  331. Global Const BASS_CONFIG_UPDATEPERIOD = 1
  332. Global Const BASS_CONFIG_MAXVOL = 3
  333. Global Const BASS_CONFIG_GVOL_SAMPLE = 4
  334. Global Const BASS_CONFIG_GVOL_STREAM = 5
  335. Global Const BASS_CONFIG_GVOL_MUSIC = 6
  336. Global Const BASS_CONFIG_CURVE_VOL = 7
  337. Global Const BASS_CONFIG_CURVE_PAN = 8
  338. Global Const BASS_CONFIG_FLOATDSP = 9
  339. Global Const BASS_CONFIG_3DALGORITHM = 10
  340. Global Const BASS_CONFIG_NET_TIMEOUT = 11
  341. Global Const BASS_CONFIG_NET_BUFFER = 12
  342. Global Const BASS_CONFIG_PAUSE_NOPLAY = 13
  343. Global Const BASS_CONFIG_NET_NOPROXY = 14
  344. Global Const BASS_CONFIG_NET_PREBUF = 15
  345. Global Const BASS_CONFIG_NET_AGENT = 16
  346.  
  347. ' BASS_StreamGetFilePosition modes
  348. Global Const BASS_FILEPOS_CURRENT = 0
  349. Global Const BASS_FILEPOS_DECODE = BASS_FILEPOS_CURRENT
  350. Global Const BASS_FILEPOS_DOWNLOAD = 1
  351. Global Const BASS_FILEPOS_END = 2
  352. Global Const BASS_FILEPOS_START = 3
  353.  
  354. ' STREAMFILEPROC actions
  355. Global Const BASS_FILE_CLOSE = 0
  356. Global Const BASS_FILE_READ = 1
  357. Global Const BASS_FILE_LEN = 3
  358. Global Const BASS_FILE_SEEK = 4
  359.  
  360. Global Const BASS_STREAMPROC_END = &H80000000 ' end of user stream flag
  361.  
  362. '**************************************************************
  363. '* DirectSound interfaces (for use with BASS_GetDSoundObject) *
  364. '**************************************************************
  365. Global Const BASS_OBJECT_DS = 1                     ' DirectSound
  366. Global Const BASS_OBJECT_DS3DL = 2                  'IDirectSound3DListener
  367.  
  368. '******************************
  369. '* DX7 voice allocation flags *
  370. '******************************
  371. ' Play the sample in hardware. If no hardware voices are available then
  372. ' the "play" call will fail
  373. Global Const BASS_VAM_HARDWARE = 1
  374. ' Play the sample in software (ie. non-accelerated). No other VAM flags
  375. 'may be used together with this flag.
  376. Global Const BASS_VAM_SOFTWARE = 2
  377.  
  378. '******************************
  379. '* DX7 voice management flags *
  380. '******************************
  381. ' These flags enable hardware resource stealing... if the hardware has no
  382. ' available voices, a currently playing buffer will be stopped to make room for
  383. ' the new buffer. NOTE: only samples loaded/created with the BASS_SAMPLE_VAM
  384. ' flag are considered for termination by the DX7 voice management.
  385.  
  386. ' If there are no free hardware voices, the buffer to be terminated will be
  387. ' the one with the least time left to play.
  388. Global Const BASS_VAM_TERM_TIME = 4
  389. ' If there are no free hardware voices, the buffer to be terminated will be
  390. ' one that was loaded/created with the BASS_SAMPLE_MUTEMAX flag and is beyond
  391. ' it 's max distance. If there are no buffers that match this criteria, then the
  392. ' "play" call will fail.
  393. Global Const BASS_VAM_TERM_DIST = 8
  394. ' If there are no free hardware voices, the buffer to be terminated will be
  395. ' the one with the lowest priority.
  396. Global Const BASS_VAM_TERM_PRIO = 16
  397.  
  398. '**********************************************************************
  399. '* software 3D mixing algorithm modes (used with BASS_Set3DAlgorithm) *
  400. '**********************************************************************
  401. ' default algorithm (currently translates to BASS_3DALG_OFF)
  402. Global Const BASS_3DALG_DEFAULT = 0
  403. ' Uses normal left and right panning. The vertical axis is ignored except for
  404. 'scaling of volume due to distance. Doppler shift and volume scaling are still
  405. 'applied, but the 3D filtering is not performed. This is the most CPU efficient
  406. 'software implementation, but provides no virtual 3D audio effect. Head Related
  407. 'Transfer Function processing will not be done. Since only normal stereo panning
  408. 'is used, a channel using this algorithm may be accelerated by a 2D hardware
  409. 'voice if no free 3D hardware voices are available.
  410. Global Const BASS_3DALG_OFF = 1
  411. ' This algorithm gives the highest quality 3D audio effect, but uses more CPU.
  412. ' Requires Windows 98 2nd Edition or Windows 2000 that uses WDM drivers, if this
  413. ' mode is not available then BASS_3DALG_OFF will be used instead.
  414. Global Const BASS_3DALG_FULL = 2
  415. ' This algorithm gives a good 3D audio effect, and uses less CPU than the FULL
  416. ' mode. Requires Windows 98 2nd Edition or Windows 2000 that uses WDM drivers, if
  417. ' this mode is not available then BASS_3DALG_OFF will be used instead.
  418. Global Const BASS_3DALG_LIGHT = 3
  419.  
  420. Type BASS_INFO
  421.     flags As Long         ' device capabilities (DSCAPS_xxx flags)
  422.     hwsize As Long        ' size of total device hardware memory
  423.     hwfree As Long        ' size of free device hardware memory
  424.     freesam As Long       ' number of free sample slots in the hardware
  425.     free3d As Long        ' number of free 3D sample slots in the hardware
  426.     minrate As Long       ' min sample rate supported by the hardware
  427.     maxrate As Long       ' max sample rate supported by the hardware
  428.     eax As Long           ' device supports EAX? (always BASSFALSE if BASS_DEVICE_3D was not used)
  429.     minbuf As Long        ' recommended minimum buffer length in ms (requires BASS_DEVICE_LATENCY)
  430.     dsver As Long         ' DirectSound version
  431.     latency As Long       ' delay (in ms) before start of playback (requires BASS_DEVICE_LATENCY)
  432.     initflags As Long     ' "flags" parameter of BASS_Init call
  433.     speakers As Long      ' number of speakers available
  434.     driver As Long        ' driver
  435. End Type
  436.  
  437. Type BASS_RECORDINFO
  438.     flags As Long         ' device capabilities (DSCCAPS_xxx flags)
  439.     formats As Long       ' supported standard formats (WAVE_FORMAT_xxx flags)
  440.     inputs As Long        ' number of inputs
  441.     singlein As Long      ' BASSTRUE = only 1 input can be set at a time
  442.     driver As Long        ' driver
  443. End Type
  444.  
  445. Type BASS_SAMPLE
  446.     freq As Long          ' default playback rate
  447.     volume As Long        ' default volume (0-100)
  448.     pan As Long           ' default pan (-100=left, 0=middle, 100=right)
  449.     flags As Long         ' BASS_SAMPLE_xxx flags
  450.     length As Long        ' length (in samples, not bytes)
  451.     max As Long           ' maximum simultaneous playbacks
  452.     origres As Long       ' original resolution
  453.     chans As Long         ' number of channels
  454.     ' The following are the sample's default 3D attributes (if the sample
  455.     ' is 3D, BASS_SAMPLE_3D is in flags) see BASS_ChannelSet3DAttributes
  456.     mode3d As Long        ' BASS_3DMODE_xxx mode
  457.     mindist As Single     ' minimum distance
  458.     MAXDIST As Single     ' maximum distance
  459.     iangle As Long        ' angle of inside projection cone
  460.     oangle As Long        ' angle of outside projection cone
  461.     outvol As Long        ' delta-volume outside the projection cone
  462.     ' The following are the defaults used if the sample uses the DirectX 7
  463.     ' voice allocation/management features.
  464.     vam As Long           ' voice allocation/management flags (BASS_VAM_xxx)
  465.     priority As Long      ' priority (0=lowest, &Hffffffff=highest)
  466. End Type
  467.  
  468. Type BASS_CHANNELINFO
  469.     freq As Long          ' default playback rate
  470.     chans As Long         ' channels
  471.     flags As Long         ' BASS_SAMPLE/STREAM/MUSIC/SPEAKER flags
  472.     ctype As Long         ' type of channel
  473.     origres As Long       ' original resolution
  474. End Type
  475.  
  476. ' BASS_CHANNELINFO types
  477. Global Const BASS_CTYPE_SAMPLE = 1
  478. Global Const BASS_CTYPE_RECORD = 2
  479. Global Const BASS_CTYPE_STREAM = &H10000
  480. Global Const BASS_CTYPE_STREAM_WAV = &H10001
  481. Global Const BASS_CTYPE_STREAM_OGG = &H10002
  482. Global Const BASS_CTYPE_STREAM_MP1 = &H10003
  483. Global Const BASS_CTYPE_STREAM_MP2 = &H10004
  484. Global Const BASS_CTYPE_STREAM_MP3 = &H10005
  485. Global Const BASS_CTYPE_STREAM_AIFF = &H10006
  486. Global Const BASS_CTYPE_MUSIC_MOD = &H20000
  487. Global Const BASS_CTYPE_MUSIC_MTM = &H20001
  488. Global Const BASS_CTYPE_MUSIC_S3M = &H20002
  489. Global Const BASS_CTYPE_MUSIC_XM = &H20003
  490. Global Const BASS_CTYPE_MUSIC_IT = &H20004
  491. Global Const BASS_CTYPE_MUSIC_MO3 = &H100    ' mo3 flag
  492.  
  493. '********************************************************
  494. '* 3D vector (for 3D positions/velocities/orientations) *
  495. '********************************************************
  496. Type BASS_3DVECTOR
  497.     X As Single           ' +=right, -=left
  498.     Y As Single           ' +=up, -=down
  499.     z As Single           ' +=front, -=behind
  500. End Type
  501.  
  502. ' DX8 effect types, use with BASS_ChannelSetFX
  503. Global Const BASS_FX_CHORUS = 0         ' GUID_DSFX_STANDARD_CHORUS
  504. Global Const BASS_FX_COMPRESSOR = 1     ' GUID_DSFX_STANDARD_COMPRESSOR
  505. Global Const BASS_FX_DISTORTION = 2     ' GUID_DSFX_STANDARD_DISTORTION
  506. Global Const BASS_FX_ECHO = 3           ' GUID_DSFX_STANDARD_ECHO
  507. Global Const BASS_FX_FLANGER = 4        ' GUID_DSFX_STANDARD_FLANGER
  508. Global Const BASS_FX_GARGLE = 5         ' GUID_DSFX_STANDARD_GARGLE
  509. Global Const BASS_FX_I3DL2REVERB = 6    ' GUID_DSFX_STANDARD_I3DL2REVERB
  510. Global Const BASS_FX_PARAMEQ = 7        ' GUID_DSFX_STANDARD_PARAMEQ
  511. Global Const BASS_FX_REVERB = 8         ' GUID_DSFX_WAVES_REVERB
  512.  
  513. Type BASS_FXCHORUS              ' DSFXChorus
  514.     fWetDryMix As Single
  515.     fDepth As Single
  516.     fFeedback As Single
  517.     fFrequency As Single
  518.     lWaveform As Long   ' 0=triangle, 1=sine
  519.     fDelay As Single
  520.     lPhase As Long              ' BASS_FX_PHASE_xxx
  521. End Type
  522.  
  523. Type BASS_FXCOMPRESSOR  ' DSFXCompressor
  524.     fGain As Single
  525.     fAttack As Single
  526.     fRelease As Single
  527.     fThreshold As Single
  528.     fRatio As Single
  529.     fPredelay As Single
  530. End Type
  531.  
  532. Type BASS_FXDISTORTION  ' DSFXDistortion
  533.     fGain As Single
  534.     fEdge As Single
  535.     fPostEQCenterFrequency As Single
  536.     fPostEQBandwidth As Single
  537.     fPreLowpassCutoff As Single
  538. End Type
  539.  
  540. Type BASS_FXECHO                ' DSFXEcho
  541.     fWetDryMix As Single
  542.     fFeedback As Single
  543.     fLeftDelay As Single
  544.     fRightDelay As Single
  545.     lPanDelay As Long
  546. End Type
  547.  
  548. Type BASS_FXFLANGER             ' DSFXFlanger
  549.     fWetDryMix As Single
  550.     fDepth As Single
  551.     fFeedback As Single
  552.     fFrequency As Single
  553.     lWaveform As Long   ' 0=triangle, 1=sine
  554.     fDelay As Single
  555.     lPhase As Long              ' BASS_FX_PHASE_xxx
  556. End Type
  557.  
  558. Type BASS_FXGARGLE              ' DSFXGargle
  559.     dwRateHz As Long               ' Rate of modulation in hz
  560.     dwWaveShape As Long            ' 0=triangle, 1=square
  561. End Type
  562.  
  563. Type BASS_FXI3DL2REVERB ' DSFXI3DL2Reverb
  564.     lRoom As Long                    ' [-10000, 0]      default: -1000 mB
  565.     lRoomHF As Long                  ' [-10000, 0]      default: 0 mB
  566.     flRoomRolloffFactor As Single    ' [0.0, 10.0]      default: 0.0
  567.     flDecayTime As Single            ' [0.1, 20.0]      default: 1.49s
  568.     flDecayHFRatio As Single         ' [0.1, 2.0]       default: 0.83
  569.     lReflections As Long             ' [-10000, 1000]   default: -2602 mB
  570.     flReflectionsDelay As Single     ' [0.0, 0.3]       default: 0.007 s
  571.     lReverb As Long                  ' [-10000, 2000]   default: 200 mB
  572.     flReverbDelay As Single          ' [0.0, 0.1]       default: 0.011 s
  573.     flDiffusion As Single            ' [0.0, 100.0]     default: 100.0 %
  574.     flDensity As Single              ' [0.0, 100.0]     default: 100.0 %
  575.     flHFReference As Single          ' [20.0, 20000.0]  default: 5000.0 Hz
  576. End Type
  577.  
  578. Type BASS_FXPARAMEQ             ' DSFXParamEq
  579.     fCenter As Single
  580.     fBandwidth As Single
  581.     fGain As Single
  582. End Type
  583.  
  584. Type BASS_FXREVERB              ' DSFXWavesReverb
  585.     fInGain As Single                ' [-96.0,0.0]            default: 0.0 dB
  586.     fReverbMix As Single             ' [-96.0,0.0]            default: 0.0 db
  587.     fReverbTime As Single            ' [0.001,3000.0]         default: 1000.0 ms
  588.     fHighFreqRTRatio As Single       ' [0.001,0.999]          default: 0.001
  589. End Type
  590.  
  591. Global Const BASS_FX_PHASE_NEG_180 = 0
  592. Global Const BASS_FX_PHASE_NEG_90 = 1
  593. Global Const BASS_FX_PHASE_ZERO = 2
  594. Global Const BASS_FX_PHASE_90 = 3
  595. Global Const BASS_FX_PHASE_180 = 4
  596.  
  597. Type GUID       ' used with BASS_Init - use VarPtr(guid) in clsid parameter
  598.     Data1 As Long
  599.     Data2 As Integer
  600.     Data3 As Integer
  601.     Data4(7) As Byte
  602. End Type
  603.  
  604.  
  605. Declare Function BASS_SetConfig Lib "bass.dll" (ByVal opt As Long, ByVal value As Long) As Long
  606. Declare Function BASS_GetConfig Lib "bass.dll" (ByVal opt As Long) As Long
  607. Declare Function BASS_GetVersion Lib "bass.dll" () As Long
  608. Declare Function BASS_GetDeviceDescription Lib "bass.dll" (ByVal device As Long) As Long
  609. Declare Function BASS_ErrorGetCode Lib "bass.dll" () As Long
  610. Declare Function BASS_Init Lib "bass.dll" (ByVal device As Long, ByVal freq As Long, ByVal flags As Long, ByVal win As Long, ByVal clsid As Long) As Long
  611. Declare Function BASS_SetDevice Lib "bass.dll" (ByVal device As Long) As Long
  612. Declare Function BASS_GetDevice Lib "bass.dll" () As Long
  613. Declare Function BASS_Free Lib "bass.dll" () As Long
  614. Declare Function BASS_GetDSoundObject Lib "bass.dll" (ByVal object As Long) As Long
  615. Declare Function BASS_GetInfo Lib "bass.dll" (ByRef info As BASS_INFO) As Long
  616. Declare Function BASS_Update Lib "bass.dll" () As Long
  617. Declare Function BASS_GetCPU Lib "bass.dll" () As Single
  618. Declare Function BASS_Start Lib "bass.dll" () As Long
  619. Declare Function BASS_Stop Lib "bass.dll" () As Long
  620. Declare Function BASS_Pause Lib "bass.dll" () As Long
  621. Declare Function BASS_SetVolume Lib "bass.dll" (ByVal volume As Long) As Long
  622. Declare Function BASS_GetVolume Lib "bass.dll" () As Long
  623.  
  624. Declare Function BASS_PluginLoad Lib "bass.dll" (ByVal f As String) As Long
  625. Declare Function BASS_PluginFree Lib "bass.dll" (ByVal handle As Long) As Long
  626.  
  627. Declare Function BASS_Set3DFactors Lib "bass.dll" (ByVal distf As Single, ByVal rollf As Single, ByVal doppf As Single) As Long
  628. Declare Function BASS_Get3DFactors Lib "bass.dll" (ByRef distf As Single, ByRef rollf As Single, ByRef doppf As Single) As Long
  629. Declare Function BASS_Set3DPosition Lib "bass.dll" (ByRef pos As Any, ByRef vel As Any, ByRef front As Any, ByRef top As Any) As Long
  630. Declare Function BASS_Get3DPosition Lib "bass.dll" (ByRef pos As Any, ByRef vel As Any, ByRef front As Any, ByRef top As Any) As Long
  631. Declare Function BASS_Apply3D Lib "bass.dll" () As Long
  632. Declare Function BASS_SetEAXParameters Lib "bass.dll" (ByVal env As Long, ByVal vol As Single, ByVal decay As Single, ByVal damp As Single) As Long
  633. Declare Function BASS_GetEAXParameters Lib "bass.dll" (ByRef env As Long, ByRef vol As Single, ByRef decay As Single, ByRef damp As Single) As Long
  634.  
  635. Declare Function BASS_MusicLoad Lib "bass.dll" (ByVal mem As Long, ByVal f As Any, ByVal offset As Long, ByVal length As Long, ByVal flags As Long, ByVal freq As Long) As Long
  636. Declare Function BASS_MusicFree Lib "bass.dll" (ByVal handle As Long) As Long
  637. Declare Function BASS_MusicSetAttribute Lib "bass.dll" (ByVal handle As Long, ByVal attrib As Long, ByVal value As Long) As Long
  638. Declare Function BASS_MusicGetAttribute Lib "bass.dll" (ByVal handle As Long, ByVal attrib As Long) As Long
  639. Declare Function BASS_MusicGetName Lib "bass.dll" (ByVal handle As Long) As Long
  640. Declare Function BASS_MusicGetOrders Lib "bass.dll" (ByVal handle As Long) As Long
  641. Declare Function BASS_MusicGetOrderPosition Lib "bass.dll" (ByVal handle As Long) As Long
  642.  
  643. Declare Function BASS_SampleLoad Lib "bass.dll" (ByVal mem As Long, ByVal f As Any, ByVal offset As Long, ByVal length As Long, ByVal max As Long, ByVal flags As Long) As Long
  644. Declare Function BASS_SampleCreate Lib "bass.dll" (ByVal length As Long, ByVal freq As Long, ByVal chans As Long, ByVal max As Long, ByVal flags As Long) As Long
  645. Declare Function BASS_SampleCreateDone Lib "bass.dll" () As Long
  646. Declare Function BASS_SampleFree Lib "bass.dll" (ByVal handle As Long) As Long
  647. Declare Function BASS_SampleGetInfo Lib "bass.dll" (ByVal handle As Long, ByRef info As BASS_SAMPLE) As Long
  648. Declare Function BASS_SampleSetInfo Lib "bass.dll" (ByVal handle As Long, ByRef info As BASS_SAMPLE) As Long
  649. Declare Function BASS_SampleGetChannel Lib "bass.dll" (ByVal handle As Long, ByVal onlynew As Long) As Long
  650. Declare Function BASS_SampleStop Lib "bass.dll" (ByVal handle As Long) As Long
  651.  
  652. Declare Function BASS_StreamCreate Lib "bass.dll" (ByVal freq As Long, ByVal chans As Long, ByVal flags As Long, ByVal proc As Long, ByVal user As Long) As Long
  653. Declare Function BASS_StreamCreateFile Lib "bass.dll" (ByVal mem As Long, ByVal f As Any, ByVal offset As Long, ByVal length As Long, ByVal flags As Long) As Long
  654. Declare Function BASS_StreamCreateURL Lib "bass.dll" (ByVal url As String, ByVal offset As Long, ByVal flags As Long, ByVal proc As Long, ByVal user As Long) As Long
  655. Declare Function BASS_StreamCreateFileUser Lib "bass.dll" (ByVal buffered As Long, ByVal flags As Long, ByVal proc As Long, ByVal user As Long) As Long
  656. Declare Function BASS_StreamFree Lib "bass.dll" (ByVal handle As Long) As Long
  657. Declare Function BASS_StreamGetTags Lib "bass.dll" (ByVal handle As Long, ByVal tags As Long) As Long
  658. Declare Function BASS_StreamGetFilePosition Lib "bass.dll" (ByVal handle As Long, ByVal mode As Long) As Long
  659.  
  660. Declare Function BASS_RecordGetDeviceDescription Lib "bass.dll" (ByVal device As Long) As Long
  661. Declare Function BASS_RecordInit Lib "bass.dll" (ByVal device As Long) As Long
  662. Declare Function BASS_RecordSetDevice Lib "bass.dll" (ByVal device As Long) As Long
  663. Declare Function BASS_RecordGetDevice Lib "bass.dll" () As Long
  664. Declare Function BASS_RecordFree Lib "bass.dll" () As Long
  665. Declare Function BASS_RecordGetInfo Lib "bass.dll" (ByRef info As BASS_RECORDINFO) As Long
  666. Declare Function BASS_RecordGetInputName Lib "bass.dll" (ByVal inputn As Long) As Long
  667. Declare Function BASS_RecordSetInput Lib "bass.dll" (ByVal inputn As Long, ByVal setting As Long) As Long
  668. Declare Function BASS_RecordGetInput Lib "bass.dll" (ByVal inputn As Long) As Long
  669. Declare Function BASS_RecordStart Lib "bass.dll" (ByVal freq As Long, ByVal chans As Long, ByVal flags As Long, ByVal proc As Long, ByVal user As Long) As Long
  670.  
  671. Private Declare Function BASS_ChannelBytes2Seconds64 Lib "bass.dll" Alias "BASS_ChannelBytes2Seconds" (ByVal handle As Long, ByVal pos As Long, ByVal poshigh As Long) As Single
  672. Declare Function BASS_ChannelSeconds2Bytes Lib "bass.dll" (ByVal handle As Long, ByVal pos As Single) As Long
  673. Declare Function BASS_ChannelGetDevice Lib "bass.dll" (ByVal handle As Long) As Long
  674. Declare Function BASS_ChannelIsActive Lib "bass.dll" (ByVal handle As Long) As Long
  675. Declare Function BASS_ChannelGetInfo Lib "bass.dll" (ByVal handle As Long, ByRef info As BASS_CHANNELINFO) As Long
  676. Declare Function BASS_ChannelSetFlags Lib "bass.dll" (ByVal handle As Long, ByVal flags As Long) As Long
  677. Declare Function BASS_ChannelPreBuf Lib "bass.dll" (ByVal handle As Long, ByVal length As Long) As Long
  678. Declare Function BASS_ChannelPlay Lib "bass.dll" (ByVal handle As Long, ByVal restart As Long) As Long
  679. Declare Function BASS_ChannelStop Lib "bass.dll" (ByVal handle As Long) As Long
  680. Declare Function BASS_ChannelPause Lib "bass.dll" (ByVal handle As Long) As Long
  681. Declare Function BASS_ChannelSetAttributes Lib "bass.dll" (ByVal handle As Long, ByVal freq As Long, ByVal volume As Long, ByVal pan As Long) As Long
  682. Declare Function BASS_ChannelGetAttributes Lib "bass.dll" (ByVal handle As Long, ByRef freq As Long, ByRef volume As Long, ByRef pan As Long) As Long
  683. Declare Function BASS_ChannelSlideAttributes Lib "bass.dll" (ByVal handle As Long, ByVal freq As Long, ByVal volume As Long, ByVal pan As Long, ByVal time As Long) As Long
  684. Declare Function BASS_ChannelIsSliding Lib "bass.dll" (ByVal handle As Long) As Long
  685. Declare Function BASS_ChannelSet3DAttributes Lib "bass.dll" (ByVal handle As Long, ByVal mode As Long, ByVal min As Single, ByVal max As Single, ByVal iangle As Long, ByVal oangle As Long, ByVal outvol As Long) As Long
  686. Declare Function BASS_ChannelGet3DAttributes Lib "bass.dll" (ByVal handle As Long, ByRef mode As Long, ByRef min As Single, ByRef max As Single, ByRef iangle As Long, ByRef oangle As Long, ByRef outvol As Long) As Long
  687. Declare Function BASS_ChannelSet3DPosition Lib "bass.dll" (ByVal handle As Long, ByRef pos As Any, ByRef orient As Any, ByRef vel As Any) As Long
  688. Declare Function BASS_ChannelGet3DPosition Lib "bass.dll" (ByVal handle As Long, ByRef pos As Any, ByRef orient As Any, ByRef vel As Any) As Long
  689. Declare Function BASS_ChannelGetLength Lib "bass.dll" (ByVal handle As Long) As Long
  690. Private Declare Function BASS_ChannelSetPosition64 Lib "bass.dll" Alias "BASS_ChannelSetPosition" (ByVal handle As Long, ByVal pos As Long, ByVal poshigh As Long) As Long
  691. Declare Function BASS_ChannelGetPosition Lib "bass.dll" (ByVal handle As Long) As Long
  692. Declare Function BASS_ChannelGetLevel Lib "bass.dll" (ByVal handle As Long) As Long
  693. Declare Function BASS_ChannelGetData Lib "bass.dll" (ByVal handle As Long, ByRef buffer As Any, ByVal length As Long) As Long
  694. Private Declare Function BASS_ChannelSetSync64 Lib "bass.dll" Alias "BASS_ChannelSetSync" (ByVal handle As Long, ByVal atype As Long, ByVal param As Long, ByVal paramhigh As Long, ByVal proc As Long, ByVal user As Long) As Long
  695. Declare Function BASS_ChannelRemoveSync Lib "bass.dll" (ByVal handle As Long, ByVal sync As Long) As Long
  696. Declare Function BASS_ChannelSetDSP Lib "bass.dll" (ByVal handle As Long, ByVal proc As Long, ByVal user As Long, ByVal priority As Long) As Long
  697. Declare Function BASS_ChannelRemoveDSP Lib "bass.dll" (ByVal handle As Long, ByVal dsp As Long) As Long
  698. Declare Function BASS_ChannelSetEAXMix Lib "bass.dll" (ByVal handle As Long, ByVal mix As Single) As Long
  699. Declare Function BASS_ChannelGetEAXMix Lib "bass.dll" (ByVal handle As Long, ByRef mix As Single) As Long
  700. Declare Function BASS_ChannelSetLink Lib "bass.dll" (ByVal handle As Long, ByVal chan As Long) As Long
  701. Declare Function BASS_ChannelRemoveLink Lib "bass.dll" (ByVal handle As Long, ByVal chan As Long) As Long
  702. Declare Function BASS_ChannelSetFX Lib "bass.dll" (ByVal handle As Long, ByVal atype As Long, ByVal priority As Long) As Long
  703. Declare Function BASS_ChannelRemoveFX Lib "bass.dll" (ByVal handle As Long, ByVal fx As Long) As Long
  704. Declare Function BASS_FXSetParameters Lib "bass.dll" (ByVal handle As Long, ByRef par As Any) As Long
  705. Declare Function BASS_FXGetParameters Lib "bass.dll" (ByVal handle As Long, ByRef par As Any) As Long
  706.  
  707. Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (ByRef Destination As Any, ByRef Source As Any, ByVal length As Long)
  708. Private Declare Function lstrlen Lib "kernel32" Alias "lstrlenA" (ByVal lpString As Long) As Long
  709.  
  710. Public Function BASS_SPEAKER_N(ByVal n As Long) As Long
  711. BASS_SPEAKER_N = n * (2 ^ 24)
  712. End Function
  713.  
  714. Public Function MAKEMUSICPOS(ByVal order As Long, ByVal row As Long) As Long
  715. MAKEMUSICPOS = &H80000000 Or MakeLong(order, row)
  716. End Function
  717.  
  718. '*******************************************
  719. ' 32-bit wrappers for 64-bit BASS functions
  720. '*******************************************
  721. Function BASS_ChannelBytes2Seconds(ByVal handle As Long, ByVal pos As Long) As Single
  722. BASS_ChannelBytes2Seconds = BASS_ChannelBytes2Seconds64(handle, pos, 0)
  723. End Function
  724.  
  725. Function BASS_ChannelSetPosition(ByVal handle As Long, ByVal pos As Long) As Long
  726. BASS_ChannelSetPosition = BASS_ChannelSetPosition64(handle, pos, 0)
  727. End Function
  728.  
  729. Function BASS_ChannelSetSync(ByVal handle As Long, ByVal atype As Long, ByVal param As Long, ByVal proc As Long, ByVal user As Long) As Long
  730. BASS_ChannelSetSync = BASS_ChannelSetSync64(handle, atype, param, 0, proc, user)
  731. End Function
  732.  
  733.  
  734. Function STREAMPROC(ByVal handle As Long, ByVal buffer As Long, ByVal length As Long, ByVal user As Long) As Long
  735.     
  736.     'CALLBACK FUNCTION !!!
  737.     
  738.     ' User stream callback function
  739.     ' NOTE: A stream function should obviously be as quick
  740.     ' as possible, other streams (and MOD musics) can't be mixed until it's finished.
  741.     ' handle : The stream that needs writing
  742.     ' buffer : Buffer to write the samples in
  743.     ' length : Number of bytes to write
  744.     ' user   : The 'user' parameter value given when calling BASS_StreamCreate
  745.     ' RETURN : Number of bytes written. Set the BASS_STREAMPROC_END flag to end
  746.     '          the stream.
  747.     
  748. End Function
  749.  
  750. Function STREAMFILEPROC(ByVal action As Long, ByVal param1 As Long, ByVal param2 As Long, ByVal user As Long) As Long
  751.     
  752.     'CALLBACK FUNCTION !!!
  753.     
  754.     ' User file stream callback function.
  755.     ' action : The action to perform, one of BASS_FILE_xxx values.
  756.     ' param1 : Depends on "action"
  757.     ' param2 : Depends on "action"
  758.     ' user   : The 'user' parameter value given when calling BASS_StreamCreate
  759.     ' RETURN : Depends on "action"
  760.     
  761. End Function
  762.  
  763. Sub DOWNLOADPROC(ByVal buffer As Long, ByVal length As Long, ByVal user As Long)
  764.     
  765.     'CALLBACK FUNCTION !!!
  766.  
  767.     ' Internet stream download callback function.
  768.     ' buffer : Buffer containing the downloaded data... NULL=end of download
  769.     ' length : Number of bytes in the buffer
  770.     ' user   : The 'user' parameter given when calling BASS_StreamCreateURL
  771.     
  772. End Sub
  773.  
  774. Sub SYNCPROC(ByVal handle As Long, ByVal channel As Long, ByVal data As Long, ByVal user As Long)
  775.     
  776.     'CALLBACK FUNCTION !!!
  777.     
  778.     'Similarly in here, write what to do when sync function
  779.     'is called, i.e screen flash etc.
  780.     
  781.     ' NOTE: a sync callback function should be very quick as other
  782.     ' syncs cannot be processed until it has finished.
  783.     ' handle : The sync that has occured
  784.     ' channel: Channel that the sync occured in
  785.     ' data   : Additional data associated with the sync's occurance
  786.     ' user   : The 'user' parameter given when calling BASS_ChannelSetSync */
  787.     
  788. End Sub
  789.  
  790. Sub DSPPROC(ByVal handle As Long, ByVal channel As Long, ByVal buffer As Long, ByVal length As Long, ByVal user As Long)
  791.  
  792.     'CALLBACK FUNCTION !!!
  793.  
  794.     ' VB doesn't support pointers, so you should copy the buffer into an array,
  795.     ' process it, and then copy it back into the buffer.
  796.  
  797.     ' DSP callback function. NOTE: A DSP function should obviously be as quick as
  798.     ' possible... other DSP functions, streams and MOD musics can not be processed
  799.     ' until it's finished.
  800.     ' handle : The DSP handle
  801.     ' channel: Channel that the DSP is being applied to
  802.     ' buffer : Buffer to apply the DSP to
  803.     ' length : Number of bytes in the buffer
  804.     ' user   : The 'user' parameter given when calling BASS_ChannelSetDSP
  805.     
  806. End Sub
  807.  
  808. Function RECORDPROC(ByVal handle As Long, ByVal buffer As Long, ByVal length As Long, ByVal user As Long) As Long
  809.  
  810.     'CALLBACK FUNCTION !!!
  811.  
  812.     ' Recording callback function.
  813.     ' handle : The recording handle
  814.     ' buffer : Buffer containing the recorded samples
  815.     ' length : Number of bytes
  816.     ' user   : The 'user' parameter value given when calling BASS_RecordStart
  817.     ' RETURN : BASSTRUE = continue recording, BASSFALSE = stop
  818.  
  819. End Function
  820.  
  821.  
  822. Function BASS_GetDeviceDescriptionString(ByVal device As Long) As String
  823. Dim pstring As Long
  824. Dim sstring As String
  825. On Error Resume Next
  826. pstring = BASS_GetDeviceDescription(device)
  827. If pstring Then
  828.     sstring = VBStrFromAnsiPtr(pstring)
  829. End If
  830. BASS_GetDeviceDescriptionString = sstring
  831. End Function
  832.  
  833. Public Function BASS_MusicGetNameString(ByVal handle As Long) As String
  834. Dim pstring As Long
  835. Dim sstring As String
  836. On Error Resume Next
  837. pstring = BASS_MusicGetName(handle)
  838. If pstring Then
  839.     sstring = VBStrFromAnsiPtr(pstring)
  840. End If
  841. BASS_MusicGetNameString = sstring
  842. End Function
  843.  
  844. Function BASS_SetEAXPreset(Preset) As Long
  845. ' This function is a workaround, because VB doesn't support multiple comma seperated
  846. ' paramaters for each Global Const, simply pass the EAX_ENVIRONMENT_xxx value to this function
  847. ' instead of BASS_SetEAXParameters as you would do in C++
  848. Select Case Preset
  849.     Case EAX_ENVIRONMENT_GENERIC
  850.         BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_GENERIC, 0.5, 1.493, 0.5)
  851.     Case EAX_ENVIRONMENT_PADDEDCELL
  852.         BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_PADDEDCELL, 0.25, 0.1, 0)
  853.     Case EAX_ENVIRONMENT_ROOM
  854.         BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_ROOM, 0.417, 0.4, 0.666)
  855.     Case EAX_ENVIRONMENT_BATHROOM
  856.         BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_BATHROOM, 0.653, 1.499, 0.166)
  857.     Case EAX_ENVIRONMENT_LIVINGROOM
  858.         BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_LIVINGROOM, 0.208, 0.478, 0)
  859.     Case EAX_ENVIRONMENT_STONEROOM
  860.         BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_STONEROOM, 0.5, 2.309, 0.888)
  861.     Case EAX_ENVIRONMENT_AUDITORIUM
  862.         BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_AUDITORIUM, 0.403, 4.279, 0.5)
  863.     Case EAX_ENVIRONMENT_CONCERTHALL
  864.         BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_CONCERTHALL, 0.5, 3.961, 0.5)
  865.     Case EAX_ENVIRONMENT_CAVE
  866.         BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_CAVE, 0.5, 2.886, 1.304)
  867.     Case EAX_ENVIRONMENT_ARENA
  868.         BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_ARENA, 0.361, 7.284, 0.332)
  869.     Case EAX_ENVIRONMENT_HANGAR
  870.         BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_HANGAR, 0.5, 10, 0.3)
  871.     Case EAX_ENVIRONMENT_CARPETEDHALLWAY
  872.         BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_CARPETEDHALLWAY, 0.153, 0.259, 2)
  873.     Case EAX_ENVIRONMENT_HALLWAY
  874.         BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_HALLWAY, 0.361, 1.493, 0)
  875.     Case EAX_ENVIRONMENT_STONECORRIDOR
  876.         BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_STONECORRIDOR, 0.444, 2.697, 0.638)
  877.     Case EAX_ENVIRONMENT_ALLEY
  878.         BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_ALLEY, 0.25, 1.752, 0.776)
  879.     Case EAX_ENVIRONMENT_FOREST
  880.         BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_FOREST, 0.111, 3.145, 0.472)
  881.     Case EAX_ENVIRONMENT_CITY
  882.         BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_CITY, 0.111, 2.767, 0.224)
  883.     Case EAX_ENVIRONMENT_MOUNTAINS
  884.         BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_MOUNTAINS, 0.194, 7.841, 0.472)
  885.     Case EAX_ENVIRONMENT_QUARRY
  886.         BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_QUARRY, 1, 1.499, 0.5)
  887.     Case EAX_ENVIRONMENT_PLAIN
  888.         BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_PLAIN, 0.097, 2.767, 0.224)
  889.     Case EAX_ENVIRONMENT_PARKINGLOT
  890.         BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_PARKINGLOT, 0.208, 1.652, 1.5)
  891.     Case EAX_ENVIRONMENT_SEWERPIPE
  892.         BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_SEWERPIPE, 0.652, 2.886, 0.25)
  893.     Case EAX_ENVIRONMENT_UNDERWATER
  894.         BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_UNDERWATER, 1, 1.499, 0)
  895.     Case EAX_ENVIRONMENT_DRUGGED
  896.         BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_DRUGGED, 0.875, 8.392, 1.388)
  897.     Case EAX_ENVIRONMENT_DIZZY
  898.         BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_DIZZY, 0.139, 17.234, 0.666)
  899.     Case EAX_ENVIRONMENT_PSYCHOTIC
  900.         BASS_SetEAXPreset = BASS_SetEAXParameters(EAX_ENVIRONMENT_PSYCHOTIC, 0.486, 7.563, 0.806)
  901. End Select
  902. End Function
  903.  
  904. Public Function HiWord(lparam As Long) As Long
  905. ' This is the HIWORD of the lParam:
  906. HiWord = lparam \ &H10000 And &HFFFF&
  907. End Function
  908. Public Function LoWord(lparam As Long) As Long
  909. ' This is the LOWORD of the lParam:
  910. LoWord = lparam And &HFFFF&
  911. End Function
  912. Function MakeLong(LoWord As Long, HiWord As Long) As Long
  913. 'Replacement for the c++ Function MAKELONG
  914. MakeLong = (LoWord And &HFFFF&) Or (HiWord * &H10000)
  915. End Function
  916.  
  917. Public Function VBStrFromAnsiPtr(ByVal lpStr As Long) As String
  918. Dim bStr() As Byte
  919. Dim cChars As Long
  920. On Error Resume Next
  921. ' Get the number of characters in the buffer
  922. cChars = lstrlen(lpStr)
  923.  
  924. ' Resize the byte array
  925. ReDim bStr(0 To cChars - 1) As Byte
  926.  
  927. ' Grab the ANSI buffer
  928. Call CopyMemory(bStr(0), ByVal lpStr, cChars)
  929.  
  930. ' Now convert to a VB Unicode string
  931. VBStrFromAnsiPtr = StrConv(bStr, vbUnicode)
  932. End Function
  933.