Page 1 of 1

Winamp General Purpose Plugin

Posted: Wed Dec 30, 2009 8:54 am
by criobot
Hello,
I tried to create a Winamp plugin, using the specifications of the Winamp SDK and by following the Beginner's Guide, but my plugin isn't shown in the General Purpose plugins list in Winamp. I found 2 plugin examples in the Code Archive from PureArea, but they are for Visualisation and for an Input (decoder) plugin. They work without any problem, and are actually much more complicated that the general purpose plugins. Here is my empty plugin code, which should be loaded in winamp without any problems, but it is not. :(

Code: Select all

Structure winampGeneralPurposePlugin
  version.l
  description.l
  init.l
  config.l
  quit.l
  hwndParent.l
  hDllInstance.l
EndStructure

Global PLUGIN.winampGeneralPurposePlugin

ProcedureDLL.l Init()
  ProcedureReturn 0
EndProcedure

ProcedureDLL Config()
  
EndProcedure

ProcedureDLL Quit()

EndProcedure
  
ProcedureDLL.l winampGetGeneralPurposePlugin()
  ;MessageBox_(0, "", "", #MB_OK)
  PLUGIN\version = $10
  PLUGIN\description = ?Description
  PLUGIN\init = @Init()
  PLUGIN\config = @Config()
  PLUGIN\quit= @Quit()
  PLUGIN\hDllInstance = 0
  PLUGIN\hwndParent = 0
  ProcedureReturn *PLUGIN
EndProcedure

DataSection 
  Description: 
  Data.s "Empty General Purpose Plugin" 
EndDataSection

Re: Winamp General Purpose Plugin

Posted: Wed Dec 30, 2009 10:20 am
by Fred
This line is wrong:

Code: Select all

ProcedureReturn *PLUGIN
change it to

Code: Select all

ProcedureReturn @PLUGIN
And you should use ".i" as default type for pointers, or your code won't work on x64.

Re: Winamp General Purpose Plugin

Posted: Wed Dec 30, 2009 12:49 pm
by criobot
Fred wrote:This line is wrong:

Code: Select all

ProcedureReturn *PLUGIN
change it to

Code: Select all

ProcedureReturn @PLUGIN
And you should use ".i" as default type for pointers, or your code won't work on x64.
First I used the .i type for the Structure members and the addressof (@) symbol, but it did not work. I've changed the code so much, that I've forgot how it looked like in the beginning, but perhaps I did something else wrong. Then I used the header converter from the SDK, to convert the headers from the Winamp Plugin SDK, and it put the .l type on the structure members, so I let them stay that way, because I thought it is right that way. After rewriting from scratch the whole code and consulting the "Pointers and memory access" page from the help file helped me a lot. Now the plugin is loaded into winamp's plugin list. Thank you very much for the help, Fred.

Re: Winamp General Purpose Plugin

Posted: Wed Dec 30, 2009 4:50 pm
by Rescator
You would have caught "ProcedureReturn *PLUGIN" if you had used EnableExplicit ;P

Re: Winamp General Purpose Plugin

Posted: Mon Feb 15, 2010 5:10 pm
by arjaycob
Well I just tried the procedures about Winamp General Purpose Plugin, I think something missing or errors.



_________________
outsource movie | article cycle tv | articles trader | sem philippines