nobody...one thing, you have posted a lot, so i guess it should be only fair to register now...
As to your code, this is all you need...
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, bass, TFlatButtonUnit, TFlatCheckBoxUnit, SkinCtrls;
type
TForm1 = class(TForm)
s1: TspSkinTrackBar;
s2: TspSkinTrackBar;
s3: TspSkinTrackBar;
s4: TspSkinTrackBar;
s5: TspSkinTrackBar;
s6: TspSkinTrackBar;
s7: TspSkinTrackBar;
s8: TspSkinTrackBar;
s9: TspSkinTrackBar;
s10: TspSkinTrackBar;
enable_eq_cb: TFlatCheckBox;
load_song_btn: TFlatButton;
procedure FormCreate(Sender: TObject);
procedure load_song_btnClick(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure upeq(bar_to_upt : integer; bar_val : single);
procedure s1Change(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
streamh : hstream;
eq_handles : array[0..9] of BASS_FXPARAMEQ; // array of actual eq objects
eq_ch_handles : array[0..9] of DWORD; // eq channel handles
eq_settings : array[0..9, 0..2] of single; // inter song eq settings
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
Bass_Init(-1, 44100, 0, Form1.handle); //Init bass on default device
Bass_Start; // Start Bass
for i := 0 to 9 do // Set virtual bandwidth and gains
begin
eq_settings[i, 1] := 7; //bandwidth for all bands = 7
eq_settings[i, 2] := 0; // initial gain on all bands is 0
end;
eq_settings[0, 0] := 80; // Some center freqs i made up
eq_settings[1, 0] := 170;
eq_settings[2, 0] := 310;
eq_settings[3, 0] := 600;
eq_settings[4, 0] := 1000;
eq_settings[5, 0] := 3000;
eq_settings[6, 0] := 6000;
eq_settings[7, 0] := 10000;
eq_settings[8, 0] := 12000;
eq_settings[9, 0] := 14000;
end;
procedure TForm1.load_song_btnClick(Sender: TObject);
var
i : integer;
begin
Bass_StreamFree(streamh); // free any song if playing
Bass_Stop(); // Stop Bass
Bass_Start; // Start Bass
song := Bass_StreamCreateFile(FALSE, pChar('one.mp3'), 0, 0, 0); // Load a mp3
Bass_StreamPlay(streamh, FALSE, 0); // Play the mp3
for i := 0 to 9 do eq_ch_handles[i] := BASS_ChannelSetFX(streamh, BASS_FX_PARAMEQ); // Get handles for all bands
s1Change(nil);
for i := 0 to 9 do // 0-9 = 10 bands
begin
eq_handles[i].fCenter := eq_settings[i, 0]; // Copy over eq settings to actual eq objects
eq_handles[i].fBandwidth := eq_settings[i, 1]; // Same Again
eq_handles[i].fGain := eq_settings[i, 2]; // Same Again
BASS_FXSetParameters(eq_ch_handles[i], @eq_handles[i]); // Actually set the parameters
end;
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
Bass_Stop();
Bass_Free();
end;
procedure TForm1.upeq(bar_to_upt : integer; bar_val : single);
begin
eq_settings[bar_to_upt, 0] := bar_val; // Write gain to settings array for later use, etc
eq_handles[bar_to_upt].fGain := eq_settings[bar_to_upt, 0]; //Write eq object property settings from eq_settings array
BASS_FXSetParameters(eq_ch_handles[bar_to_upt], @eq_handles[bar_to_upt]); //Actually set the parameters
end;
procedure TForm1.s1Change(Sender: TObject);
begin
upeq(1, + s1.value); // Update eq band 1 with the slider value;
upeq(2, + s2.Value);
upeq(3, + s3.Value);
upeq(4, + s4.Value);
upeq(5, + s5.Value);
upeq(6, + s6.Value);
upeq(7, + s7.Value);
upeq(8, + s8.Value);
upeq(9, + s9.Value);
upeq(10, + s10.Value);
end;
end.
This is your code modified, try this one..it will work..