Recently to write a small program, used to MP3 playback; Because of the need for very complex control and function, think of Bass.dll.
I used to think Bass.dll was a library of Windows, and then I knew it was a third party: http://www.un4seen.com/.
Bass.dll has been updated, now the latest version is 2.411, download address: Http://us2.un4seen.com/files/bass24.zip
Before use in Delphi, there are three steps to be done:
1, copy Bass.dll to the system can identify the folder, such as: Windows\System32, Windows, Windows\System, can also be the system or user's environment variable Path designated any directory, but also in the program when the current directory, It's OK to put a folder in the program and then specify the path in it.
2, for Delphi write the header file Bass.pas in a directory (for example: C:\Program Files\codegear\rad studio\6.0\imports\bass24).
3, then from Delphi menu-> Tools-> Options-> library-win32-> Library path-> then Add this directory (example).
Well, write a few tests: unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
uses Bass;
procedure TForm1.FormCreate(Sender: TObject);
begin
ShowMessageFmt('%x', [BASSVERSION]); {204}
ShowMessageFmt('%x', [BASS_GetVersion]); {2040101}
if HiWord(BASS_GetVersion) <> BASSVERSION then
ShowMessage('当前 Bass.dll 版本不可用')
else
ShowMessage('OK!');
end;
end.
Program Description:
Before using the Bass, it is generally necessary to verify the version (because different versions feature a difference);
The Bass_getversion function can get the version number of the Bass.dll in the system, which is: $2040101 (hexadecimal number);
Bassversion is a constant in Bass.pas, representing the version of the Bass.pas file, here is $204;
As long as the major version number (for example, 2.4) is unified, we can use the HiWord function to