WinAMP (Windows Audio MPEG Player) is a program from Nullsoft that allows PC users to play audio files, particularly music, in many (but not all) popular digital audio formats, including MS-Audio, wav, and MP3. With WinAMP, it is possible to listen to SHOUTcast streaming radio broadcasts. The program allows the user to convert audio from analog tape recorders, phonographs, and other media to MP3 digital format, and it allows the user to burn MP3 files onto CDs. WinAMP can be configured to periodically scan folders on a computer hard drive for new media.

WinAMP includes various skins (graphical user interface designs) from which to choose. Users can design their own skins and publish them at the WinAMP Web site. A Macintosh version of the program, called MacAMP, is available.

Winamp supports many types of plugins: input,output,encoders, visualization, DSP, general, media library.
In this article i will try to explay how to load Winamp General Plugins in our application.

Let’s Begin.

1)First we need a translated C++ header of Winamp SDK to Delphi and extract this:

  WinampGeneralPurposePlugin = record
                     version      :Integer;
                     description  :PChar;
                     InitProc     :Function: integer; cdecl;
                     ConfigProc   :Procedure; cdecl;
                     QuitProc     :Procedure; cdecl;
                     hwndParent   :HWND;
                     hDllInstance :Thandle;
                    end;
 PWinampGeneralPurposePlugin = ^WinampGeneralPurposePlugin;
   WinampGPP=record
   header: PWinampGeneralPurposePlugin;
   Dllhandle: Thandle;
   NAME :PWideChar;
   count: integer;
   end;

2) Now we will declare as globally:

  maxinput2: integer;
  winampPlugin: function:  PWinampGeneralPurposePlugin; cdecl;
  WinampPlugins:array[0..100] of WinampGpp;

3) Function to check if a dll is a winamp general plugin

function TForm1.IsWinampGPP;
 var
   Dllhandle: Thandle;
begin
   result:=false;
   if fileexists(dll) then dllhandle:=LoadLibrary(dll) else exit;
   if dllhandle0 then
   begin
     winampPlugin:= GetProcAddress(dllhandle,'winampGetGeneralPurposePlugin');
     if assigned(winampPlugin) then result:=true;
   end;
FreeLibrary(dllhandle);
end;

4) Function to load the winamp general plugin

procedure Tform1.LoadDLL(dll: PWideChar;nr: integer);
begin
if fileexists(dll) then
WinampPlugins[nr].dllhandle:=LoadLibrary(PwideChar(dll)) else exit;
if WinampPlugins[nr].dllhandle0 then
begin
winampPlugin:= GetProcAddress(WinampPlugins[nr].dllhandle,'winampGetGeneralPurposePlugin');
   if assigned(winampPlugin) then
   begin
   WinampPlugins[nr].header:=winampplugin;
  // label1.Caption:=header.description;
   WinampPlugins[nr].header.hwndParent:=handle;
   WinampPlugins[nr].header.hDllInstance:=WinampPlugins[nr].dllhandle;
   WinampPlugins[nr].header.InitProc;
   WinampPlugins[nr].NAME:=WinampPlugins[nr].header.description;
   end;
end;
end;

That’s all. Now you can load Winamp General Plugins in your application.
Tutorial5 Source Source Member download Tutorial 5 Free download