-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBass.au3
4285 lines (4130 loc) · 220 KB
/
Bass.au3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#include-once
;Include Constants
#include "BassConstants.au3"
#include "Misc.au3"
; #INDEX# =======================================================================================================================
; Title .........: BASS.au3
; Description ...: Almost all of BASS.DLL translated ready for easy use with AutoIt
; Author ........: Brett Francis (BrettF)
;
; Special thanks go to ProgAndy for modifing this version and correcting various functions. His work is
; greatly apreciated!
; ===============================================================================================================================
; #CURRENT# =====================================================================================================================
; _BASS_SetConfig()
; _BASS_GetConfig()
; _BASS_SetConfigPtr()
; _BASS_GetConfigPtr()
; _BASS_GetVersion()
; _BASS_ErrorGetCode()
; _BASS_GetDeviceInfo()
; _BASS_Init()
; _BASS_SetDevice()
; _BASS_GetDevice()
; _BASS_Free()
; _BASS_GetDSoundObject()
; _BASS_GetInfo()
; _BASS_Update()
; _BASS_GetCPU()
; _BASS_Start()
; _BASS_Stop()
; _BASS_Pause()
; _BASS_SetVolume()
; _BASS_GetVolume()
; _BASS_PluginLoad()
; _BASS_PluginFree()
; _Bass_PluginGetInfo_Sample()
; _BASS_Set3DFactors()
; _BASS_Get3DFactors()
; _BASS_Set3DPosition()
; _BASS_Get3DPosition()
; _BASS_Apply3D()
; _BASS_SetEAXParameters()
; _BASS_GetEAXParameters()
; _BASS_MusicLoad()
; _BASS_MusicFree()
; _BASS_SampleLoad()
; _BASS_SampleCreate()
; _BASS_SampleFree()
; _BASS_SampleSetData()
; _BASS_SampleGetData()
; _BASS_SampleGetInfo()
; _BASS_SampleSetInfo()
; _BASS_SampleGetChannel()
; _BASS_SampleStop()
; _BASS_Startup()
; _BASS_StreamCreate()
; _BASS_StreamCreateFile()
; _BASS_StreamCreateURL()
; _BASS_StreamFree()
; _BASS_StreamGetFilePosition()
; _BASS_StreamPutData()
; _BASS_StreamPutFileData()
; _BASS_RecordGetDeviceInfo()
; _BASS_RecordInit()
; _BASS_RecordSetDevice()
; _BASS_RecordGetDevice()
; _BASS_RecordFree()
; _BASS_RecordGetInfo()
; _BASS_RecordGetInputName()
; _BASS_RecordSetInput()
; _BASS_RecordGetInput()
; _BASS_RecordStart()
; _BASS_ChannelBytes2Seconds()
; _BASS_ChannelSeconds2Bytes()
; _BASS_ChannelGetDevice()
; _BASS_ChannelSetDevice()
; _BASS_ChannelIsActive()
; _BASS_ChannelGetInfo()
; _BASS_ChannelGetTags()
; _BASS_ChannelFlags()
; _BASS_ChannelUpdate()
; _BASS_ChannelLock()
; _BASS_ChannelPlay()
; _BASS_ChannelStop()
; _BASS_ChannelPause()
; _BASS_ChannelSetAttribute()
; _BASS_ChannelGetAttribute()
; _BASS_ChannelSlideAttribute()
; _BASS_ChannelIsSliding()
; _BASS_ChannelGet3DAttributes()
; _BASS_ChannelSet3DAttributes()
; _BASS_ChannelSet3DPosition()
; _BASS_ChannelGet3DPosition()
; _BASS_ChannelGetLength()
; _BASS_ChannelSetPosition()
; _BASS_ChannelGetPosition()
; _BASS_ChannelGetLevel()
; _BASS_ChannelGetData()
; _BASS_ChannelSetLink()
; _BASS_ChannelRemoveLink()
; _BASS_ChannelSetFX()
; _BASS_ChannelRemoveFX()
; _BASS_SetEAXPreset()
; _BASS_ChannelSetFX()
; _BASS_ChannelRemoveFX()
; _BASS_FXGetParameters()
; _BASS_FXSetParameters()
; _BASS_ChannelSetVolume()
; _BASS_ChannelGetVolume
; ===============================================================================================================================
; #INTERNAL_USE_ONLY#============================================================================================================
; _BASS_PtrStringLen()
; _BASS_PtrStringRead()
; _LoWord()
; _LoWord()
; ===============================================================================================================================
; #INTERNAL_CONSTANTS#===========================================================================================================
; These constants should only be used internally.
; ===============================================================================================================================
Global $_ghBassDll = -1
Global $_gbBASSULONGLONGFIXED = _VersionCompare(@AutoItVersion, "3.3.0.0") = 1
Global $BASS_DWORD_ERR = 2
Global $BASS_DLL_UDF_VER = "2.4.5.0"
Global $BASS_ERR_DLL_NO_EXIST = -1
;Should be set to 0 if you wish to check the version of Bass.DLL with the version that the UDF is designed for.
GLOBAL $BASS_STARTUP_BYPASS_VERSIONCHECK = 0
; #FUNCTION# ====================================================================================================================
; Name...........: _BASS_Startup
; Description ...: Starts up BASS functions.
; Syntax.........: _BASS_Startup($sBassDLL)
; Parameters ....: - $sBassDLL - The relative path to BassCD.dll.
; Return values .: Success - Returns True
; Failure - Returns False and sets @ERROR
; @error will be set to-
; - $BASS_ERR_DLL_NO_EXIST - File could not be found.
; If the version of this UDF is not compatabile with this version of Bass, then the following
; error will be displayed to the user. This can be disabled by setting
; $BASS_STARTUP_BYPASS_VERSIONCHECK = 1
; This is the error show to the user:
; This version of Bass.au3 is not made for Bass.dll VX.X.X.X. Please update.
; Author ........: Prog@ndy
; Modified.......: Brett Francis (BrettF)
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func _BASS_Startup($sBassDLL="bass.dll")
;Check if bass has already been started up.
If $_ghBassDll <> -1 Then Return True
;Check if $sBassDLL exists.
If Not FileExists ($sBassDLL) Then Return SetError ($BASS_ERR_DLL_NO_EXIST, 0, False)
;Check to make sure that the version of Bass.DLL is compatabile with this UDF version. If not we will throw a text error.
;Then we will exit the program
If $BASS_STARTUP_BYPASS_VERSIONCHECK Then
If _VersionCompare(FileGetVersion ($sBassDLL), $BASS_DLL_UDF_VER) = -1 Then
MsgBox (0, "ERROR", "This version of BASS.au3 is made for Bass.dll V" & $BASS_DLL_UDF_VER & ". Please update")
Exit
EndIf
EndIf
;Open the DLL
$_ghBassDll = DllOpen($sBassDLL)
;Check if the DLL was opened correctly.
Return $_ghBassDll <> -1
EndFunc
; #FUNCTION# ====================================================================================================================
; Name...........: _BASS_SetConfig
; Description ...: Sets the value of a config option.
; Syntax.........: _BASS_SetConfig($option, $value)
; Parameters ....: - $option - One of the following...
; - $BASS_CONFIG_3DALGORITHM - The 3D algorithm for software mixed 3D channels.
; - $value - One of the following...
; - $BASS_3DALG_DEFAULT
; - The default algorithm. With WDM drivers, if the user has selected a
; surround sound speaker configuration (eg. 4 or 5.1) in the control
; panel, the sound is panned among the available directional speakers.
; Otherwise it equates to BASS_3DALG_OFF.
; - $BASS_3DALG_OFF
; - Uses normal left and right panning. The vertical axis is ignored except
; for scaling of volume due to distance. Doppler shift and volume scaling
; are still applied, but the 3D filtering is not performed. This is the
; most CPU efficient algorithm, but provides no virtual 3D audio effect.
; Head Related Transfer Function processing will not be done. Since only
; normal stereo panning is used, a channel using this algorithm may be
; accelerated by a 2D hardware voice if no free 3D hardware voices are
; available.
; - $BASS_3DALG_FULL
; - This algorithm gives the highest quality 3D audio effect, but uses more
; CPU. This algorithm requires WDM drivers, if it's not available then
; BASS_3DALG_OFF will automatically be used instead.
; - $BASS_3DALG_LIGHT
; - This algorithm gives a good 3D audio effect, and uses less CPU than the
; FULL algorithm. This algorithm also requires WDM drivers, if it's not
; available then BASS_3DALG_OFF will automatically be used instead.
; - $BASS_CONFIG_BUFFER - Playback buffer length.
; - $value - One of the following...
; - Buffer Length in miliseconds.
; - $BASS_CONFIG_CURVE_PAN - Panning translation curve.
; - $value - One of the following...
; - False = Linear
; - True = Logarithmic
; - $BASS_CONFIG_CURVE_VOL - Volume translation curve.
; - $value - One of the following...
; - False = Linear
; - True = Logarithmic
; - $BASS_CONFIG_FLOATDSP - Pass 32-bit floating-point sample data to all DSP functions?
; - $value - One of the following...
; - True = 32-bit floating-point sample data is passed to DSPPROC callback function.
; - False = Normal Operation.
; - $BASS_CONFIG_GVOL_MUSIC - Global MOD music volume.
; - $value - One of the following...
; - Between 0 (silent) to 10000 (full).
; - $BASS_CONFIG_GVOL_SAMPLE - Global sample volume.
; - $value - One of the following...
; - Between 0 (silent) to 10000 (full).
; - $BASS_CONFIG_GVOL_STREAM - Global stream volume.
; - $value - One of the following...
; - Between 0 (silent) to 10000 (full).
; - $BASS_CONFIG_MUSIC_VIRTUAL - IT virtual channels.
; - $value - One of the following...
; - Number of Virtual channels between 1 (min) 512 (max).
; - $BASS_CONFIG_NET_BUFFER - Internet download buffer length.
; - $value - One of the following...
; - Buffer length in milliseconds
; - $BASS_CONFIG_NET_PASSIVE - Use passive mode in FTP connections?
; - $value - One of the following...
; - True = Passive Mode is used
; - False = Normal Operation
; - $BASS_CONFIG_NET_PLAYLIST - Process URLs in playlists?
; - $value - One of the following...
; - When to process URLs in PLS and M3U playlists
; - 0 = never
; - 1 = in BASS_StreamCreateURL only
; - 2 = in BASS_StreamCreateURL, BASS_StreamCreateFile and BASS_StreamCreateFileUser.
; - $BASS_CONFIG_NET_PREBUF - Amount to pre-buffer when opening internet streams.
; - $value - One of the following...
; - Ammount (Percentage) to pre-buffer.
; - $BASS_CONFIG_NET_TIMEOUT - Time to wait for a server to respond to a connection request.
; - $value - One of the following...
; - Time to wait in milliseconds.
; - $BASS_CONFIG_PAUSE_NOPLAY - Prevent channels being played when the output is paused?
; - $value - One of the following...
; - True = Channels can't be played while the Output is paused.
; - False = Normal Operation
; - $BASS_CONFIG_REC_BUFFER - Recording buffer length.
; - $value - One of the following...
; - Buffer length in milliseconds. Between 1000 (min) - 5000 (max).
; - $BASS_CONFIG_UPDATEPERIOD - Update period of playback buffers.
; - $value - One of the following...
; - Update Period in milliseconds.
; - 0 = disable automatic updating.
; - Value has to be between 5 and 100 milliseconds.
; - $BASS_CONFIG_UPDATETHREADS - Number of update threads.
; - $value - One of the following...
; - The number of threads to use
; - 0 = disable automatic updating.
; - $BASS_CONFIG_VERIFY - File format verification length.
; - $value - One of the following...
; - The amount of data to check, in bytes... 1000 (min) to 100000 (max).
;
; Return values .: Success - Returns 1
; Failure - Returns 0 and sets @ERROR to error returned by _BASS_ErrorGetCode()
; @error will be set to-
; - $BASS_ERROR_ILLPARAM - Option is invalid.
; Author ........: Brett Francis (BrettF)
; Modified.......: Prog@ndy
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func _BASS_SetConfig($option, $value)
Local $BASS_ret_ = DllCall($_ghBassDll, "int", "BASS_SetConfig", "dword", $option, "dword", $value)
If @error Then Return SetError(1,1,0)
If $BASS_ret_[0] = 0 Then Return SetError(_BASS_ErrorGetCode(),0, 0)
Return 1
EndFunc ;==>_BASS_SetConfig
; #FUNCTION# ====================================================================================================================
; Name...........: _BASS_GetConfig
; Description ...: Retrieves the value of a config option.
; Syntax.........: _BASS_GetConfig($option)
; Parameters ....: - $option - The option to get the value of. Same as _BASS_SetConfig.
; Return values .: Success - Returns 1
; Failure - Returns 0 and sets @ERROR to error returned by _BASS_ErrorGetCode()
; @error will be set to-
; - $BASS_ERROR_ILLPARAM - option is invalid.
; Author ........: Brett Francis (BrettF)
; Modified.......: Prog@ndy
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func _BASS_GetConfig($option)
Local $BASS_ret_ = DllCall($_ghBassDll, "dword", "BASS_GetConfig", "dword", $option)
If @error Then Return SetError(1,1,0)
If $BASS_ret_[0] = $BASS_DWORD_ERR Then Return SetError(_BASS_ErrorGetCode(),0, 0)
Return $BASS_ret_[0]
EndFunc ;==>_BASS_GetConfig
; #FUNCTION# ====================================================================================================================
; Name...........: _BASS_SetConfigPtr
; Description ...: Sets the value of a pointer config option.
; Syntax.........: _BASS_SetConfigPtr($option, $value)
; Parameters ....: - $option - The option to set the value of. One of the following:
; - $BASS_CONFIG_NET_AGENT - "User-Agent" header.
; - $value is set to:
; - The "User-Agent" header.
; - $BASS_CONFIG_NET_PROXY - Proxy server settings.
; - $value is set to:
; - The proxy server settings, in the form of "user:pass@server:port"
; - NULL = don't use a proxy.
; - "" (empty string) = use the default proxy settings.
; - If only the "user:pass@" part is specified, then those authorization
; credentials are used with the default proxy server.
; - If only the "server:port" part is specified, then that proxy server
; is used without any authorization credentials.
;
; Return values .: Success - Returns 1
; Failure - Returns 0 and sets @ERROR to error returned by _BASS_ErrorGetCode()
; @error will be set to-
; - $BASS_ERROR_ILLPARAM - Option is invalid.
; Author ........: Brett Francis (BrettF)
; Modified.......: Prog@ndy
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func _BASS_SetConfigPtr($option, $value)
Local $tpVal = "ptr"
If IsString($value) Then $tpVal = "str"
Local $BASS_ret_ = DllCall($_ghBassDll, "int", "BASS_SetConfigPtr", "dword", $option, $tpVal, $value)
If @error Then Return SetError(1,1,0)
If $BASS_ret_[0] = 0 Then Return SetError(_BASS_ErrorGetCode(),0, 0)
Return 1
EndFunc ;==>_BASS_SetConfigPtr
; #FUNCTION# ====================================================================================================================
; Name...........: _BASS_GetConfigPtr
; Description ...: Retrieves the value of a pointer config option.
; Syntax.........: _BASS_GetConfigPtr($option)
; Parameters ....: - $option - The option to set the value of. Same as _BASS_SetConfigPtr.
; Return values .: Success - Returns 1
; Failure - Returns 0 and sets @ERROR to error returned by _BASS_ErrorGetCode()
; @error will be set to-
; - $BASS_ERROR_ILLPARAM - Option is invalid.
; Author ........: Brett Francis (BrettF)
; Modified.......: Prog@ndy
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func _BASS_GetConfigPtr($option)
Local $BASS_ret_ = DllCall($_ghBassDll, "ptr", "BASS_GetConfigPtr", "dword", $option)
If @error Then Return SetError(1,1,0)
If $BASS_ret_[0] = 0 Then
Local $BS_ERR = _BASS_ErrorGetCode()
If $BS_ERR <> 0 Then Return SetError($BS_ERR, "", 0)
Return SetError(0, "", $BASS_ret_[0])
EndIf
Return _BASS_PtrStringRead($BASS_ret_[0])
EndFunc ;==>_BASS_GetConfigPtr
; #FUNCTION# ====================================================================================================================
; Name...........: _BASS_GetVersion
; Description ...: Retrieves the version of BASS that is loaded.
; Syntax.........: _BASS_GetVersion()
; Parameters ....:
; Return values .: Success - Returns Version
; Failure - Returns 0 and sets @ERROR to error returned by _BASS_ErrorGetCode()
; Author ........: Brett Francis (BrettF)
; Modified.......: Prog@ndy
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func _BASS_GetVersion()
Local $BASS_ret_ = DllCall($_ghBassDll, "dword", "BASS_GetVersion")
If @error Then Return SetError(1,1,0)
Return SetError($BASS_ret_[0]=0, 0, $BASS_ret_[0])
EndFunc ;==>_BASS_GetVersion
; #FUNCTION# ====================================================================================================================
; Name...........: _BASS_ErrorGetCode
; Description ...:
; Syntax.........: _BASS_ErrorGetCode()
; Parameters ....:
; Return values .: Returns last error code. Consult the function documentation to see reasons for each error code.
; The error code will be one of the following:
; - 0 BASS_OK
; - 1 BASS_ERROR_MEM
; - 2 BASS_ERROR_FILEOPEN
; - 3 BASS_ERROR_DRIVER
; - 4 BASS_ERROR_BUFLOST
; - 5 BASS_ERROR_HANDLE
; - 6 BASS_ERROR_FORMAT
; - 7 BASS_ERROR_POSITION
; - 8 BASS_ERROR_INIT
; - 9 BASS_ERROR_START
; - 14 BASS_ERROR_ALREADY
; - 18 BASS_ERROR_NOCHAN
; - 19 BASS_ERROR_ILLTYPE
; - 20 BASS_ERROR_ILLPARAM
; - 21 BASS_ERROR_NO3D
; - 22 BASS_ERROR_NOEAX
; - 23 BASS_ERROR_DEVICE
; - 24 BASS_ERROR_NOPLAY
; - 25 BASS_ERROR_FREQ
; - 27 BASS_ERROR_NOTFILE
; - 29 BASS_ERROR_NOHW
; - 31 BASS_ERROR_EMPTY
; - 32 BASS_ERROR_NONET
; - 33 BASS_ERROR_CREATE
; - 34 BASS_ERROR_NOFX
; - 37 BASS_ERROR_NOTAVAIL
; - 38 BASS_ERROR_DECODE
; - 39 BASS_ERROR_DX
; - 40 BASS_ERROR_TIMEOUT
; - 41 BASS_ERROR_FILEFORM
; - 42 BASS_ERROR_SPEAKER
; - 43 BASS_ERROR_VERSION
; - 44 BASS_ERROR_CODEC
; - 45 BASS_ERROR_ENDED
; - -1 BASS_ERROR_UNKNOWN
; Author ........: Brett Francis (BrettF)
; Modified.......: Prog@ndy
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func _BASS_ErrorGetCode()
Local $BASS_ret_ = DllCall($_ghBassDll, "int", "BASS_ErrorGetCode")
If @error Then Return SetError(1,0,-1)
Return $BASS_ret_[0]
EndFunc ;==>_BASS_ErrorGetCode
; #FUNCTION# ====================================================================================================================
; Name...........: _BASS_GetDeviceInfo
; Description ...: Retrieves information on an output device.
; Syntax.........: _BASS_GetDeviceInfo($device)
; Parameters ....: - $device - The device to get the information of... 0 = first.
; Return values .: Success - Returns Array of Device information.
; - [0] = Name - Description of the device.
; - [1] = Driver - The filename of the driver... NULL = no driver ("no sound" device)
; - [2] = The device's current status... a combination of these flags.
; - $BASS_DEVICE_ENABLED - The device is enabled. It will not be possible to initialize
; the device if this flag is not present.
; - $BASS_DEVICE_DEFAULT - The device is the system default.
; - $BASS_DEVICE_INIT - The device is initialized, ie. BASS_Init or BASS_RecordInit
; has been called.
; Failure - Returns 0 and sets @ERROR to error returned by _BASS_ErrorGetCode()
; @error will be set to-
; - $BASS_ERROR_DEVICE device is invalid.
; Author ........: Brett Francis (BrettF)
; Modified.......: Prog@ndy
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func _BASS_GetDeviceInfo($device)
Local $aRet[3]
Local $BASS_ret_struct = DllStructCreate("ptr name;ptr driver;dword flags;")
Local $BASS_ret_ = DllCall($_ghBassDll, "int", "BASS_GetDeviceInfo", "dword", $device, "ptr", DllStructGetPtr($BASS_ret_struct))
If @error Then Return SetError(1,1,0)
If $BASS_ret_[0] = 0 Then Return SetError(_BASS_ErrorGetCode(),0,0)
$aRet[0] = _BASS_PtrStringRead(DllStructGetData($BASS_ret_struct, 1))
$aRet[1] = _BASS_PtrStringRead(DllStructGetData($BASS_ret_struct, 2))
$aRet[2] = DllStructGetData($BASS_ret_struct, 3)
Return $aRet
EndFunc ;==>_BASS_GetDeviceInfo
; #FUNCTION# ====================================================================================================================
; Name...........: _BASS_Init
; Description ...: Initializes an output device.
; Syntax.........: _BASS_Init($flags, $device = -1, $freq = 44100, $win = 0, $clsid = "")
; Parameters ....: - $flags - Any Combination of these flags...
; - $BASS_DEVICE_8BITS
; - Use 8-bit resolution, else 16-bit.
; - $BASS_DEVICE_MONO
; - Use mono, else stereo.
; - $BASS_DEVICE_3D
; - Enable 3D functionality.
; - $BASS_DEVICE_LATENCY
; - Calculates the latency of the device, that is the delay between requesting a sound to play and it
; actually being heard. A recommended minimum buffer length is also calculated. Both values are
; retrievable in the BASS_INFO structure (latency & minbuf members). These calculations can increase
; the time taken by this function by 1-3 seconds.
; - $BASS_DEVICE_CPSPEAKERS
; - Use the Windows control panel setting to detect the number of speakers. Soundcards generally have
; their own control panel to set the speaker config, so the Windows control panel setting may not be
; accurate unless it matches that. This flag has no effect on Vista, as the speakers are already
; accurately detected.
; - $BASS_DEVICE_SPEAKERS
; - Force the enabling of speaker assignment. With some devices/drivers, the number of speakers BASS
; detects may be 2, when the device in fact supports more than 2 speakers. This flag forces the
; enabling of assignment to 8 possible speakers. This flag has no effect with non-WDM drivers.
; - $BASS_DEVICE_NOSPEAKER
; - Ignore speaker arrangement. This flag tells BASS not to make any special consideration for
; speaker arrangements when using the SPEAKER flags, eg. swapping the CENLFE and REAR speaker
; channels in 5/7.1 speaker output. This flag should be used with plain multi-channel
; (rather than 5/7.1) devices.
; - $freq - Output sample rate.
; - $win - The application's main window...
; - 0 = the current foreground window (use this for console applications).
; - $clsid - Class identifier of the object to create, that will be used to initialize DirectSound...
; - NULL = use default.
; Return values .: Success - Returns 1
; Failure - Returns 0 and sets @ERROR to error returned by _BASS_ErrorGetCode()
; @error will be set to-
; - $BASS_ERROR_DEVICE - device is invalid.
; - $BASS_ERROR_ALREADY - The device has already been initialized. BASS_Free
; must be called before it can be initialized again.
; - $BASS_ERROR_DRIVER - There is no available device driver... the device
; may already be in use.
; - $BASS_ERROR_FORMAT - The specified format is not supported by the device.
; Try changing the freq and flags parameters.
; - $BASS_ERROR_MEM - There is insufficient memory.
; - $BASS_ERROR_NO3D - Could not initialize 3D support.
; - $BASS_ERROR_UNKNOWN - Some other mystery problem!
; Author ........: Brett Francis (BrettF)
; Modified.......: Prog@ndy
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func _BASS_Init($flags, $device = -1, $freq = 44100, $win = 0, $clsid = "")
Local $BASS_ret_ = DllCall($_ghBassDll, "int", "BASS_Init", "int", $device, "dword", $freq, "dword", $flags, "hwnd", $win, "hwnd", $clsid)
If @error Then Return SetError(1,1,0)
If $BASS_ret_[0] = 0 Then Return SetError(_BASS_ErrorGetCode(),0,0)
Return $BASS_ret_[0]
EndFunc ;==>_BASS_Init
; #FUNCTION# ====================================================================================================================
; Name...........: _BASS_SetDevice
; Description ...: Sets the device to use for subsequent calls in the current thread.
; Syntax.........: _BASS_SetDevice($device)
; Parameters ....: - $device - The device to use... 0 = no sound, 1 = first real output device.
; Return values .: Success - Returns 1
; Failure - Returns 0 and sets @ERROR to error returned by _BASS_ErrorGetCode()
; @error will be set to-
; - $BASS_ERROR_DEVICE - device is invalid.
; - $BASS_ERROR_INIT - The device has not been initialized.
; Author ........: Brett Francis (BrettF)
; Modified.......: Prog@ndy
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func _BASS_SetDevice($device)
Local $BASS_ret_ = DllCall($_ghBassDll, "int", "BASS_SetDevice", "dword", $device)
If @error Then Return SetError(1,1,0)
If $BASS_ret_[0] = 0 Then Return SetError(_BASS_ErrorGetCode(),0,0)
Return $BASS_ret_[0]
EndFunc ;==>_BASS_SetDevice
; #FUNCTION# ====================================================================================================================
; Name...........: _BASS_GetDevice
; Description ...: Retrieves the device setting of the current thread.
; Syntax.........: _BASS_GetDevice()
; Parameters ....:
; Return values .: Success - Returns 1
; Failure - Returns 0 and sets @ERROR to error returned by _BASS_ErrorGetCode()
; @error will be set to-
; - $BASS_ERROR_INIT - _BASS_Init has not been successfully called
; Author ........: Brett Francis (BrettF)
; Modified.......: Prog@ndy
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func _BASS_GetDevice()
Local $BASS_ret_ = DllCall($_ghBassDll, "dword", "BASS_GetDevice")
If @error Then Return SetError(1,1,0)
If $BASS_ret_[0] = $BASS_DWORD_ERR Then Return SetError(_BASS_ErrorGetCode(),0,0)
Return $BASS_ret_[0]
EndFunc ;==>_BASS_GetDevice
; #FUNCTION# ====================================================================================================================
; Name...........: _BASS_Free
; Description ...: Frees all resources used by the output device, including all its samples, streams and MOD musics.
; Syntax.........: _BASS_Free()
; Parameters ....:
; Return values .: Success - Returns 1
; Failure - Returns 0 and sets @ERROR to error returned by _BASS_ErrorGetCode()
; @error will be set to-
; - $BASS_ERROR_INIT - _BASS_Init has not been successfully called
; Author ........: Brett Francis (BrettF)
; Modified.......: Prog@ndy
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func _BASS_Free()
Local $BASS_ret_ = DllCall($_ghBassDll, "int", "BASS_Free")
If @error Then Return SetError(1,1,0)
If $BASS_ret_[0] = 0 Then Return SetError(_BASS_ErrorGetCode(),0,0)
Return $BASS_ret_[0]
EndFunc ;==>_BASS_Free
; #FUNCTION# ====================================================================================================================
; Name...........: _BASS_GetDSoundObject
; Description ...:
; Syntax.........: _BASS_GetDSoundObject($object)
; Parameters ....: - $object - Object The interface to retrieve. Can Be one of the following...
; - HCHANNEL, HMUSIC or HSTREAM handle, in which case an IDirectSoundBuffer interface is returned.
; - BASS_OBJECT_DS Retrieve the IDirectSound interface.
; - BASS_OBJECT_DS3DL Retrieve the IDirectSound3DListener interface.
; Return values .: Success - Returns a pointer to the requested object
; Failure - Returns 0 and sets @ERROR to error returned by _BASS_ErrorGetCode()
; @error will be set to-
; - $BASS_ERROR_INIT - _BASS_Init has not been successfully called.
; - $BASS_ERROR_ILLPARAM - object is invalid.
; - $BASS_ERROR_NOTAVAIL - The requested object is not available with the current device
; Author ........: Brett Francis (BrettF)
; Modified.......: Prog@ndy
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func _BASS_GetDSoundObject($object)
Local $BASS_ret_ = DllCall($_ghBassDll, "ptr", "BASS_GetDSoundObject", "dword", $object)
If @error Then Return SetError(1,1,0)
If $BASS_ret_[0] = 0 Then Return SetError(_BASS_ErrorGetCode(),0,0)
Return $BASS_ret_[0]
EndFunc ;==>_BASS_GetDSoundObject
; #FUNCTION# ====================================================================================================================
; Name...........: _BASS_GetInfo
; Description ...: Retrieves information on the device being used.
; Syntax.........: _BASS_GetInfo()
; Parameters ....:
; Return values .: Success - Returns an array containg information on the device.
; - [0] = Flags - The device's capabilities... a combination of these flags.
; - $DSCAPS_CONTINUOUSRATE
; - The device supports all sample rates between minrate and maxrate.
; - $DSCAPS_EMULDRIVER
; - The device's drivers do NOT have DirectSound support, so it is being emulated.
; Updated drivers should be installed.
; - $DSCAPS_CERTIFIED
; - The device driver has been certified by Microsoft. This flag is always set
; on WDM drivers.
; - $DSCAPS_SECONDARYMONO
; - Mono samples are supported by hardware mixing.
; - $DSCAPS_SECONDARYSTEREO
; - Stereo samples are supported by hardware mixing.
; - $DSCAPS_SECONDARY8BIT
; - 8-bit samples are supported by hardware mixing.
; - $DSCAPS_SECONDARY16BIT
; - 16-bit samples are supported by hardware mixing.
; - [1] = hwsize
; - The device's total amount of hardware memory.
; - [2] = hwfree
; - The device's amount of free hardware memory.
; - [3] = freesam
; - The number of free sample slots in the hardware.
; - [4] = free3d
; - The number of free 3D sample slots in the hardware.
; - [5] = minrate
; - The minimum sample rate supported by the hardware.
; - [6] = maxrate
; - maximum sample rate supported by the hardware.
; - [7] = eax
; - The device supports EAX and has it enabled? The device's
; "Hardware acceleration" needs to be set to "Full" in its "Advanced Properties"
; setup, else EAX is disabled. This is always FALSE if BASS_DEVICE_3D was not specified when
; BASS_Init was called.
; - [8] = minbuf
; - The minimum buffer length (rounded up to the nearest millisecond) recommended for use
; (with the BASS_CONFIG_BUFFER config option). Requires that BASS_DEVICE_LATENCY was used
; when BASS_Init was called
; - [9] = dsver
; - DirectSound version... 9 = DX9/8/7/5 features are available, 8 = DX8/7/5 features are available,
; 7 = DX7/5 features are available, 5 = DX5 features are available. 0 = none of the DX9/8/7/5
; features are available.
; - [10] = latency
; - The average delay (rounded up to the nearest millisecond) for playback of HSTREAM/HMUSIC
; channels to start and be heard. Requires that BASS_DEVICE_LATENCY was used when BASS_Init
; was called.
; - [11] = initflags
; - The flags parameter of the BASS_Init call.
; - [12] = speakers
; - The number of speakers the device/drivers supports... 2 means that there is no support for
; speaker assignment (this will always be the case with VxD drivers). It's also possible that
; it could mistakenly be 2 with some devices/drivers, when the device in fact supports more speakers.
; In that case the BASS_DEVICE_CPSPEAKERS flag can be used in the BASS_Init call to use the Windows
; control panel setting, or the BASS_DEVICE_SPEAKERS flag can be used to force the enabling of
; speaker assignment.
; - [13] = freq
; - The device's current output sample rate. This is only available on Windows Vista and OSX.
; Failure - Returns 0 and sets @ERROR to error returned by _BASS_ErrorGetCode()
; @error will be set to-
; - $
; Author ........: Brett Francis (BrettF)
; Modified.......: Prog@ndy
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func _BASS_GetInfo()
Local $aRet[14]
Local $BASS_ret_struct = DllStructCreate($BASS_INFO)
Local $BASS_ret_ = DllCall($_ghBassDll, "int", "BASS_GetInfo", "ptr", DllStructGetPtr($BASS_ret_struct))
If @error Then Return SetError(1,1,0)
If $BASS_ret_[0] = 0 Then Return SetError(_BASS_ErrorGetCode(),0,0)
For $i = 0 To 13
$aRet[$i] = DllStructGetData($BASS_ret_struct, $i + 1)
Next
Return SetError(0, "", $aRet)
EndFunc ;==>_BASS_GetInfo
; #FUNCTION# ====================================================================================================================
; Name...........: _BASS_Update
; Description ...: Manually updates the HSTREAM and HMUSIC channel playback buffers.
; Syntax.........: _BASS_Update($legnth)
; Parameters ....: - $length - The amount to render, in milliseconds.
; Return values .: Success - Returns 1
; Failure - Returns 0 and sets @ERROR to error returned by _BASS_ErrorGetCode()
; @error will be set to-
; - $BASS_ERROR_NOTAVAIL - Updating is already in progress
; Author ........: Brett Francis (BrettF)
; Modified.......: Prog@ndy
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func _BASS_Update($legnth)
Local $BASS_ret_ = DllCall($_ghBassDll, "int", "BASS_Update", "dword", $legnth)
If @error Then Return SetError(1,1,0)
If $BASS_ret_[0] = 0 Then Return SetError(_BASS_ErrorGetCode(),0,0)
Return $BASS_ret_[0]
EndFunc ;==>_BASS_Update
; #FUNCTION# ====================================================================================================================
; Name...........: _BASS_GetCPU
; Description ...: Retrieves the current CPU usage of BASS.
; Syntax.........: _BASS_GetCPU()
; Parameters ....:
; Return values .: Success - Returns the BASS CPU usage as a percentage of total CPU time
; Failure - Returns 0 and sets @ERROR to error returned by _BASS_ErrorGetCode()
; Author ........: Brett Francis (BrettF)
; Modified.......: Prog@ndy
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func _BASS_GetCPU()
Local $BASS_ret_ = DllCall($_ghBassDll, "float", "BASS_GetCPU")
If @error Then Return SetError(1,1,0)
;If $BASS_ret_[0] = 0 Then Return SetError(_BASS_ErrorGetCode(),0,0)
Return $BASS_ret_[0]
EndFunc ;==>_BASS_GetCPU
; #FUNCTION# ====================================================================================================================
; Name...........: _BASS_Start
; Description ...: Starts (or resumes) the output.
; Syntax.........: _BASS_Start()
; Parameters ....:
; Return values .: Success - Returns 1
; Failure - Returns 0 and sets @ERROR to error returned by _BASS_ErrorGetCode()
; @error will be set to-
; - $BASS_ERROR_INIT - _BASS_Init has not been successfully called.
; Author ........: Brett Francis (BrettF)
; Modified.......: Prog@ndy
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func _BASS_Start()
Local $BASS_ret_ = DllCall($_ghBassDll, "int", "BASS_Start")
If @error Then Return SetError(1,1,0)
If $BASS_ret_[0] = 0 Then Return SetError(_BASS_ErrorGetCode(),0,0)
Return $BASS_ret_[0]
EndFunc ;==>_BASS_Start
; #FUNCTION# ====================================================================================================================
; Name...........: _BASS_Stop
; Description ...: Stops the output, stopping all musics/samples/streams.
; Syntax.........: _BASS_Stop()
; Parameters ....:
; Return values .: Success - Returns 1
; Failure - Returns 0 and sets @ERROR to error returned by _BASS_ErrorGetCode()
; @error will be set to-
; - $BASS_ERROR_INIT - _BASS_Init has not been successfully called.
; Author ........: Brett Francis (BrettF)
; Modified.......: Prog@ndy
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func _BASS_Stop()
Local $BASS_ret_ = DllCall($_ghBassDll, "int", "BASS_Stop")
If @error Then Return SetError(1,1,0)
If $BASS_ret_[0] = 0 Then Return SetError(_BASS_ErrorGetCode(),0,0)
Return $BASS_ret_[0]
EndFunc ;==>_BASS_Stop
; #FUNCTION# ====================================================================================================================
; Name...........: _BASS_Pause
; Description ...: Stops the output, pausing all musics/samples/streams.
; Syntax.........: _BASS_Pause()
; Parameters ....:
; Return values .: Success - Returns 1
; Failure - Returns 0 and sets @ERROR to error returned by _BASS_ErrorGetCode()
; @error will be set to-
; - $BASS_ERROR_INIT - _BASS_Init has not been successfully called.
; Author ........: Brett Francis (BrettF)
; Modified.......: Prog@ndy
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func _BASS_Pause()
Local $BASS_ret_ = DllCall($_ghBassDll, "int", "BASS_Pause")
If @error Then Return SetError(1,1,0)
If $BASS_ret_[0] = 0 Then Return SetError(_BASS_ErrorGetCode(),0,0)
Return $BASS_ret_[0]
EndFunc ;==>_BASS_Pause
; #FUNCTION# ====================================================================================================================
; Name...........: _BASS_SetVolume
; Description ...: Sets the output master volume
; Syntax.........: _BASS_SetVolume($volume)
; Parameters ....: - $volume - The volume level... 0 (silent) to 1 (max).
; Return values .: Success - Returns 1
; Failure - Returns 0 and sets @ERROR to error returned by _BASS_ErrorGetCode()
; @error will be set to-
; - $BASS_ERROR_INIT - _BASS_Init has not been successfully called.
; - $BASS_ERROR_NOTAVAIL - There is no volume control when using the "no sound" device.
; - $BASS_ERROR_ILLPARAM - volume is invalid.
; - $BASS_ERROR_UNKNOWN - Some other mystery problem!
; Author ........: Brett Francis (BrettF)
; Modified.......: Prog@ndy
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func _BASS_SetVolume($volume)
Local $BASS_ret_ = DllCall($_ghBassDll, "int", "BASS_SetVolume", "float", $volume)
If @error Then Return SetError(1,1,0)
If $BASS_ret_[0] = 0 Then Return SetError(_BASS_ErrorGetCode(),0,0)
Return $BASS_ret_[0]
EndFunc ;==>_BASS_SetVolume
; #FUNCTION# ====================================================================================================================
; Name...........: _BASS_GetVolume
; Description ...: Retrieves the current master volume level.
; Syntax.........: _BASS_GetVolume()
; Parameters ....:
; Return values .: Success - Returns the current volume level.
; Failure - Returns 0 and sets @ERROR to error returned by _BASS_ErrorGetCode()
; @error will be set to-
; - $BASS_ERROR_INIT - _BASS_Init has not been successfully called.
; - $BASS_ERROR_NOTAVAIL - There is no volume control when using the "no sound" device.
; - $BASS_ERROR_UNKNOWN - Some other mystery problem!
; Author ........: Brett Francis (BrettF)
; Modified.......: Prog@ndy
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func _BASS_GetVolume()
Local $BASS_ret_ = DllCall($_ghBassDll, "float", "BASS_GetVolume")
If @error Then Return SetError(1,1,0)
If $BASS_ret_[0] = -1 Then Return SetError(_BASS_ErrorGetCode(),0,0)
Return $BASS_ret_[0]
EndFunc ;==>_BASS_GetVolume
; #FUNCTION# ====================================================================================================================
; Name...........: _BASS_PluginLoad
; Description ...: Plugs an "add-on" into the standard stream and sample creation functions.
; Syntax.........: _BASS_PluginLoad($filename, $flags = 0)
; Parameters ....: - $file Filename of the add-on/plugin.
; - $flags Any combination of these flags.
; - $BASS_UNICODE - file is a Unicode (UTF-16) filename.
; Return values .: Success - Returns the plugin's handle.
; Failure - Returns 0 and sets @ERROR to error returned by _BASS_ErrorGetCode()
; @error will be set to-
; - $BASS_ERROR_FILEOPEN - The file could not be opened.
; - $BASS_ERROR_FILEFORM - The file is not a plugin.
; - $BASS_ERROR_VERSION - The plugin requires a different BASS version. Due to the use of the "stdcall" calling-convention, and so risk of stack faults from unexpected API differences, an add-on won't load at all on Windows if the BASS version is unsupported, and a BASS_ERROR_FILEFORM error will be generated instead of this.
; - $BASS_ERROR_ALREADY - The plugin is already loaded.
; Author ........: Brett Francis (BrettF)
; Modified.......: Prog@ndy
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func _BASS_PluginLoad($filename, $flags = 0)
Local $BASS_ret_ = DllCall($_ghBassDll, "dword", "BASS_PluginLoad", "wstr", $filename, "dword", BitOR($flags, $BASS_UNICODE))
If @error Then Return SetError(1,1,0)
If $BASS_ret_[0] = 0 Then Return SetError(_BASS_ErrorGetCode(),0,0)
Return $BASS_ret_[0]
EndFunc ;==>_BASS_PluginLoad
; #FUNCTION# ====================================================================================================================
; Name...........: _BASS_PluginFree
; Description ...: Unplugs an add-on.
; Syntax.........: _BASS_PluginFree($handle)
; Parameters ....: - $handle - The plugin handle returned by _BASS_PluginLoad or 0 = all plugins.
; Return values .: Success - Returns 1
; Failure - Returns 0 and sets @ERROR to error returned by _BASS_ErrorGetCode()
; @error will be set to-
; - $BASS_ERROR_HANDLE - handle is not valid.
; Author ........: Brett Francis (BrettF)
; Modified.......: Prog@ndy
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func _BASS_PluginFree($handle)
Local $BASS_ret_ = DllCall($_ghBassDll, "int", "BASS_PluginFree", "dword", $handle)
If @error Then Return SetError(1,1,0)
If $BASS_ret_[0] = 0 Then Return SetError(_BASS_ErrorGetCode(),0,0)
Return $BASS_ret_[0]
EndFunc ;==>_BASS_PluginFree
; #FUNCTION# ====================================================================================================================
; Name...........: _BASS_PluginGetInfo
; Description ...: Retrieves information on a plugin.
; Syntax.........: _BASS_PluginGetInfo($handle)
; Parameters ....: - $handle - The plugin handle returned by _BASS_PluginLoad
; Return values .: Success - Returns and array containg the following data:
; - [0][0] = Number of elements.
; - [0][1] = Version
; - [1][0] = Channel type
; - [1][1] = Format description.
; - [1][2] = File extension filter, in the form of "*.ext1;*.ext2;etc...".
; - [n][0] = Channel type
; - [n][1] = Format description.
; - [n][2] = File extension filter, in the form of "*.ext1;*.ext2;etc...".
; Failure - Returns 0 and sets @ERROR to error returned by _BASS_ErrorGetCode()
; @error will be set to-
; - $BASS_ERROR_HANDLE - handle is not valid.
; Author ........: Monoceres
; Modified.......: Prog@ndy, Brett Francis (BrettF)
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func _Bass_PluginGetInfo($handle)
Local $call = DllCall($_ghBassDll, "ptr", "BASS_PluginGetInfo", "dword", $handle)
If @error Then Return SetError(1,1,0)
If $call[0] = 0 Then Return SetError(_BASS_ErrorGetCode(),0,0)
Local $bp = DllStructCreate($BASS_PLUGININFO, $call[0]) ; Create a BASS_PLUGININFO struct from pointer recieved
Local $ArrOfBASS_PLUGINFORM_TAG, $iFormatc = DllStructGetData($bp, "formatc")
; The formatc element hold how many structs we have to have
For $i = 1 To $iFormatc
$ArrOfBASS_PLUGINFORM_TAG &= $BASS_PLUGINFORM ; An array is nothing more than a series of identical structs after eachother
Next
; Create the array of structs from the string we just did and the pointer we have saved in the BASS_PLUGININFO struct
$BASSArrOfBASS_PLUGINFORM = DllStructCreate($ArrOfBASS_PLUGINFORM_TAG, DllStructGetData($bp, "formats"))
Local $aRet[$iFormatc + 1][3]
$aRet[0][0] = $iFormatc
$aRet[0][1] = DllStructGetData($bp, 'version')
For $i = 0 To $iFormatc - 1 ; Loop through each element$strstruct = DllStructCreate("char[255];", DllStructGetData($BASSArrOfBASS_PLUGINFORM, $i * 3 + 2))
;$strstruct = DllStructCreate("dword;", DllStructGetData($BASSArrOfBASS_PLUGINFORM, $i * 3 + 1))
;$aRet[$i+1][0] = DllStructGetData($strstruct, 1)
$aRet[$i + 1][0] = DllStructGetData($BASSArrOfBASS_PLUGINFORM, $i * 3 + 1)