Old 28th March 2002, 01:41   #1
Unbeliever
Junior Member
 
Join Date: Mar 2002
Posts: 1
need a sample dll for generic plugin

Hi, Im new to dll's and winamp plugins.

I was wondering if anyone has a sample gen_plugin dll which is completely empty and doesnt do anything, just has all the necessary methods needed for winamp to register it?

Im using VS.NET, but shouldnt make a difference.

This is the main hurdle Im facing. I know how to do the rest once I have the bare bones dll to work with

Cheers.
Unbeliever is offline   Reply With Quote
Old 28th March 2002, 11:30   #2
Gourou
Senior Member
 
Gourou's Avatar
 
Join Date: Feb 2002
Location: The backside of the universe on the trailing edge of eternity
Posts: 238
I'd like to get my hands on one of those also..I'm using a wrapper which isnt very efficient, but it works
Gourou is offline   Reply With Quote
Old 18th April 2002, 18:20   #3
bananskib
Junior Member
 
Join Date: Apr 2002
Posts: 8
This can be compiled with vc++ 6.0

Put the code in two files: gen_empty.h and gen_empty.c (not *.cpp)

//-----------------------
//gen_empty.h
//-----------------------
#ifndef gen_empty_h
#define gen_empty_h

typedef struct {
int version;
char *description;
int (*init)();
void (*config)();
void (*quit)();
HWND hwndParent;
HINSTANCE hDllInstance;
} winampGeneralPurposePlugin;

#define GPPHDR_VER 0x10

extern winampGeneralPurposePlugin *gen_plugins[256];
typedef winampGeneralPurposePlugin * (*winampGeneralPurposePluginGetter)();

#endif //gen_empty_h

//-----------------------
//gen_empty.c
//-----------------------
#include <windows.h>
#include "gen_empty.h"

int init(void);
void config(void);
void quit(void);
winampGeneralPurposePlugin plugin = {
GPPHDR_VER, //
"Empty (gen_empty.dll)",// Description
init, // Initialization function
config, // Configuration function
quit // Deinitialization function
};

int init()
{
MessageBox(plugin.hwndParent,"init","",MB_OK);
return 0;
}

void config()
{
MessageBox(plugin.hwndParent,"config","",MB_OK);
}

void quit()
{
MessageBox(plugin.hwndParent,"quit","",MB_OK);
}

__declspec( dllexport ) winampGeneralPurposePlugin * winampGetGeneralPurposePlugin()
{
return &plugin;
}

//-----------------
Bananskib
bananskib is offline   Reply With Quote
Old 22nd April 2002, 19:10   #4
baafie
feminazi
(Major Dude)
 
baafie's Avatar
 
Join Date: Apr 2001
Posts: 1,767
Ah.. could you convert this to C++?
baafie is offline   Reply With Quote
Old 23rd April 2002, 07:51   #5
Thor
Major Dude
 
Thor's Avatar
 
Join Date: May 2000
Location: Gent, Belgium (Europe)
Posts: 968
Send a message via ICQ to Thor Send a message via AIM to Thor
Quote:
Originally posted by baafie
Ah.. could you convert this to C++?
OMG
What do you think this was written in???
Thor is offline   Reply With Quote
Old 23rd April 2002, 08:29   #6
bananskib
Junior Member
 
Join Date: Apr 2002
Posts: 8
My first post was written in C, not C++.

I use VC++ 6.0 - and I'm NOT AN EXPERT IN C++

I zipped the project as well :-)

I didn't find out myself - most of it has been posted before.

1. Make a new project : MFC AppWizard DLL, name it gen_test4 if you want to copy paste the code below.
2. Add the 2 header files to the project (frontend.h, gen.h) (gen.h is listed below - frontend.h: http://www.winamp.com/nsdn/winamp2x/dev/sdk/FRONTEND.H)


-- gen.h - start ---
typedef struct {
int version;
char *description;
int (*init)();
void (*config)();
void (*quit)();
HWND hwndParent;
HINSTANCE hDllInstance;
} winampGeneralPurposePlugin;

#define GPPHDR_VER 0x10

extern winampGeneralPurposePlugin *gen_plugins[256];
typedef winampGeneralPurposePlugin * (*winampGeneralPurposePluginGetter)();
-- gen.h - end ---

[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]

-- gen_test4.h - start --
#if !defined(AFX_GEN_TEST4_H__E840A61D_E8A1_49BB_8977_31A218301C01__INCLUDED_)
#define AFX_GEN_TEST4_H__E840A61D_E8A1_49BB_8977_31A218301C01__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif

#include "resource.h" // main symbols

/////////////////////////////////////////////////////////////////////////////
// CGen_test4App
// See gen_test4.cpp for the implementation of this class
//

class CGen_test4App : public CWinApp
{
public:
CGen_test4App();

int winampInit(void);
void winampConfig(void);
void winampQuit(void);

// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CGen_test4App)
//}}AFX_VIRTUAL

//{{AFX_MSG(CGen_test4App)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};


/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif
// !defined
//(AFX_GEN_TEST4_H__E840A61D_E8A1_49BB_8977_31A218301C01__INCLUDED_)

-- gen_test4.h - end --

[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][]

-- gen_test4.cpp - start --

// gen_test4.cpp : Defines the initialization routines for the DLL.
//

#include "stdafx.h"
#include "gen.h"
#include "gen_test4.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif



/////////////////////////////////////////////////////////////////////////////
// CGen_test4App

BEGIN_MESSAGE_MAP(CGen_test4App, CWinApp)
//{{AFX_MSG_MAP(CGen_test4App)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CGen_test4App construction

CGen_test4App::CGen_test4App()
{

}

int CGen_test4App::winampInit(void)
{
AfxMessageBox("winampInit()");
return 0;
}


/////////////////////////////////////////////////////////////////////////////
// Winapp methods
/////////////////////////////////////////////////////////////////////////////
void CGen_test4App::winampConfig(void)
{
AfxMessageBox("winampConfog()");
}

void CGen_test4App::winampQuit(void)
{
AfxMessageBox("winampQuit()");
}

/////////////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////////////
// The one and only CGen_test4App object

CGen_test4App theApp;

////////////////////
// Winamp Stuff
int init(void) { AFX_MANAGE_STATE(AfxGetStaticModuleState()); return theApp.winampInit(); }
void config(void) { AFX_MANAGE_STATE(AfxGetStaticModuleState()); theApp.winampConfig(); }
void quit(void) { AFX_MANAGE_STATE(AfxGetStaticModuleState()); theApp.winampQuit(); };
winampGeneralPurposePlugin plugin = {
GPPHDR_VER, //
"gen_test4 (gen_test4.dll)", // Description
init, // Initialization function
config, // Configuration function
quit // Deinitialization function
};
extern "C" {
__declspec(dllexport) winampGeneralPurposePlugin *winampGetGeneralPurposePlugin(void)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
return &plugin;
}
}
// End Winamp Stuff
///////////////////

-- gen_test4.cpp - start --


have fun,
Bananskib
bananskib is offline   Reply With Quote
Old 23rd April 2002, 08:32   #7
bananskib
Junior Member
 
Join Date: Apr 2002
Posts: 8
and the project zipped !

forgot it :-)

bananskib
Attached Files
File Type: zip gen_test4.zip (16.0 KB, 1145 views)
bananskib is offline   Reply With Quote
Old 23rd April 2002, 13:19   #8
baafie
feminazi
(Major Dude)
 
baafie's Avatar
 
Join Date: Apr 2001
Posts: 1,767
Quote:
Originally posted by Thor
OMG
What do you think this was written in???
N00b.
baafie is offline   Reply With Quote
Old 23rd April 2002, 13:22   #9
baafie
feminazi
(Major Dude)
 
baafie's Avatar
 
Join Date: Apr 2001
Posts: 1,767
Quote:
Originally posted by bananskib
My first post was written in C, not C++.
..Lots o' code
have fun,
Bananskib
Yes I have seen this before.. excellent work. it is not what I meant though. I was looking for a plugin written in C++ in the Win32 API, not MFC.
baafie is offline   Reply With Quote
Old 23rd April 2002, 15:59   #10
peter
ist death
 
peter's Avatar
 
Join Date: May 2000
Posts: 3,704
C code should compile fine in CPP after adding a few typecast fixes and extern "C" on _declspec(dllexport) function.
peter is offline   Reply With Quote
Old 3rd May 2002, 20:09   #11
paulhemmings
Junior Member
 
Join Date: May 2002
Location: la,ca
Posts: 3
also like an example Win32 project

I've managed to build a general plug in using the MFC example gen_test4 but i'd also rather build one from a stripped down Win32 dll project as well.

i've downloaded the SDK, if anyone has a Win32 project which compiles using that SDK and could zip it up and put it on this thread, it'd be very cool.

remember - VB sucks.
paulhemmings is offline   Reply With Quote
Old 4th May 2002, 21:43   #12
Gourou
Senior Member
 
Gourou's Avatar
 
Join Date: Feb 2002
Location: The backside of the universe on the trailing edge of eternity
Posts: 238
anyone got a template in VB (other than genwrapper, ick) for a plugin? I know it wont be by any means short enough to paste in here, but I would love to be able to turn all these programs I have into plugins.
Gourou is offline   Reply With Quote
Old 20th May 2002, 01:23   #13
baafie
feminazi
(Major Dude)
 
baafie's Avatar
 
Join Date: Apr 2001
Posts: 1,767
For all of you who are as dumb as myself, here it is then

gen.h
code:

typedef struct {
int version;
char *description;
int (*init)();
void (*config)();
void (*quit)();
HWND hwndParent;
HINSTANCE hDllInstance;
} winampGeneralPurposePlugin;

#define GPPHDR_VER 0x10

extern "C" winampGeneralPurposePlugin *gen_plugins[256];
typedef winampGeneralPurposePlugin * (*winampGeneralPurposePluginGetter)();



main.cpp
code:

#include <windows.h>
#include "gen.h"

#define PLUGINNAME "Empty plug-in v0.1"

BOOL APIENTRY _DllMainCRTStartup(HANDLE hMod, DWORD r, void *empty)
{
return 1;
}

extern "C" winampGeneralPurposePlugin plugin;

int init() {return 0;}
void config() {}
void quit() {}

winampGeneralPurposePlugin plugin = {
GPPHDR_VER,
PLUGINNAME,
init,
config,
quit,
0
};

extern "C" __declspec( dllexport ) winampGeneralPurposePlugin * winampGetGeneralPurposePlugin()
{
return &plugin;
}

baafie is offline   Reply With Quote
Old 20th May 2002, 22:26   #14
Aus
French Canadian
(Alumni)
 
Aus's Avatar
 
Join Date: Dec 2001
Location: A shiny Igloo.
Posts: 333
Send a message via AIM to Aus
I don't get your point, what you're writing is still C code.


Aus -- NoisePort.Org, chronicles of the french canadian alien (Temporarly down during the move).
Aus is offline   Reply With Quote
Old 21st May 2002, 12:45   #15
baafie
feminazi
(Major Dude)
 
baafie's Avatar
 
Join Date: Apr 2001
Posts: 1,767
Yes, but this way I can use C++ in my application, which is great for me because I suck at C.
baafie is offline   Reply With Quote
Old 29th May 2002, 18:19   #16
cfog88
Junior Member
 
Join Date: Sep 2001
Location: Victoria, B.C., Canada
Posts: 3
Empty DSP Plugin Code

Last summer I took the time to post the code for an empty Winamp DSP Plugin... I haven't touched it since, and I didn't post the link anywhere so it was for my eyes only... Web page HERE:

http://members.shaw.ca/cfogelklou/wi...keletondsp.htm
cfog88 is offline   Reply With Quote
Old 20th June 2002, 11:20   #17
Paikan
Member
 
Join Date: May 2002
Location: Paris
Posts: 76
Send a message via ICQ to Paikan
I'm completely new at winamp developping, i'd like to code a simple general purpose plugin to start. I want to develop it in C because i have knowledge in C unix and all i need is to open minibrowser on startup to a specified url and change the url on song change. But even if i have read this thread i still don't understand how to create my dll and everything.
First what compiler should i use i have Visual C++ 6 and dev-C++
Then what precisely should i do do create dll project ?

Thanks a lot in advance and sorry for my english and maybe my lack of knowledge too

Paikan
Paikan is offline   Reply With Quote
Old 18th August 2005, 22:05   #18
cindor
Junior Member
 
Join Date: Jan 2005
Posts: 1
hi a newbie here just want to know if there is a c# version of this general plug-in?
cindor is offline   Reply With Quote
Old 15th November 2005, 09:30   #19
mydiz
Junior Member
 
Join Date: Nov 2005
Location: Turkey
Posts: 21
Send a message via ICQ to mydiz Send a message via Yahoo to mydiz
Confused

I have really confused, i am learning ansi C in school, and i coded an plugin with Dev C++ (i used devc++ winamp plugin template for project) it is working good, but i dont have any configuration dialog on my application, so that i decided to learn Visual c++, but i confused it is really too different than c++?? there are lots of text around :P Is there any way to make dialog with Dev c++?

Or i had to learn visual c++??
mydiz is offline   Reply With Quote
Old 16th November 2005, 08:29   #20
Aarkay
Junior Member
 
Join Date: Nov 2005
Posts: 8
I downloaded the zip file and it is woring fine
Now i want to get the information about the current playing song.

Can anyone help me.
how can i get information by using above gen_test4.dll
Aarkay is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > Winamp Development

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump