In this example:
Code File:
Unit unit1; interfaceuses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs, classes, comctrls, extctrls; Type tform1 = Class (tform) opendialog1: topendialog; button1: tbutton; button2: tbutton; button3: tbutton; Panel1: tpanel; Procedure processing (Sender: tobject ); procedure button3cl Ick (Sender: tobject); Procedure formdestroy (Sender: tobject); Private Procedure trackchange (Sender: tobject); end; var form1: tform1; implementation {$ R *. DFM} uses bass; var HS: hstream; {stream handle} parameq: bass_dx8_parameq; {parameter structure of the frequency balancer} FX: array [0 .. 5] of HFX; {DX effect handle} Track: array [0 .. 5] of ttrackbar; Procedure tform1.formcreate (Sender: tobject); var I: integer; begin panel1.align: = alright; panel1.bevelo Uter: = bvlowered; panel1.bevelwidth: = 2; panel1.caption: = ''; panel1.width: = 6*24 + 2; for I: = 0 to 5 do begin track [I]: = ttrackbar. create (Self); track [I]. parent: = Panel1; track [I]. orientation: = trvertical; track [I]. width: = 23; track [I]. height: = panel1.height; track [I]. showselrange: = false; track [I]. left: = I * 24 + 1; track [I]. MAX: = 15; track [I]. min: =-15; track [I]. position: = 0; tra CK [I]. tag: = I; track [I]. onchange: = self. trackchange; end; If hiword (bass_getversion) bassversion then MessageBox (0, '"Bass. the DLL file version is not suitable! ', Nil, mb_iconerror); if not bass_init (-1, 44100, 0, 0, nil) Then showmessage ('initialization error'); end; {open} procedure tform1.button1click (Sender: tobject); var mp3path: ansistring; I: integer; begin bass_streamfree (HS); opendialog1.filter: = 'mp3 file (*. MP3) | *. MP3 | WAV file (*. wav) | * WAV '; If opendialog1.execute then mp3path: = ansistring (opendialog1.filename); {You need to specify the bass_sample_fx parameter} HS: = bass_streamcreatefile (false, pansichar (mp3path), 0, 0, bass_sample_fx); if hs
Form file:
Object form1: tform1 left = 222 Top = 114 caption = 'form1' clientheight = 132 clientwidth = 254 color = clbtnface font. charset = default_charset font. color = clwindowtext font. height =-11 font. name = 'tahoma 'font. style = [] oldcreateorder = false position = podesigned oncreate = formcreate ondestroy = formdestroy pixelsperinch = 96 textheight = 13 object button1: tbutton left = 8 Top = 17 width = 75 Height = 25 caption = #25171 #24320 taborder = 0 onclick = button1click end object button2: tbutton left = 8 Top = 56 width = 75 Height = 25 caption = #25773 #25918 taborder = 1 onclick = button2click end object button3: tbutton left = 8 Top = 93 width = 75 Height = 25 caption = #26242 #20572 taborder = 2 onclick = button3click end object Panel1: tpanel left = 92 Top = 47 width = 141 Height = 41 caption = 'panel1' taborder = 3 end object opendialog1: topendialog left = 80 top = 88 endend