000
27.12.2009, 05:09 Uhr
tsuyo
|
Nabend. Ich versuche über ein Winamp Plugin den VuMeter von Winamp auszulesen. Mein ganzer code ist hier:
C++: |
/* Winamp generic plugin template code. This code should be just the basics needed to get a plugin up and running. You can then expand the code to build your own plugin. Updated details compiled June 2009 by culix, based on the excellent code examples and advice of forum members Kaboon, kichik, baafie, burek021, and bananskib. Thanks for the help everyone! */ #include "stdafx.h" #include <windows.h> #include "gen_vumeter.h" // these are callback functions/events which will be called by Winamp int init(void); void config(void); void quit(void);
char* (*export_sa_get)() = NULL; //Global function pointer. wchar_t msg[1024];
// this structure contains plugin information, version, name... // GPPHDR_VER is the version of the winampGeneralPurposePlugin (GPP) structure winampGeneralPurposePlugin plugin = { GPPHDR_VER, // version of the plugin, defined in "gen_myplugin.h" PLUGIN_NAME, // name/title of the plugin, defined in "gen_myplugin.h" init, // function name which will be executed on init event config, // function name which will be executed on config event quit, // function name which will be executed on quit event 0, // handle to Winamp main window, loaded by winamp when this dll is loaded 0 // hinstance to this dll, loaded by winamp when this dll is loaded };
// event functions follow int init() { //A basic messagebox that tells you the 'init' event has been triggered. //If everything works you should see this message when you start Winamp once your plugin has been installed. //You can change this later to do whatever you want (including nothing) return 0; } void config() { export_sa_get = (char *(__cdecl *)(void)) SendMessage(plugin.hwndParent, WM_WA_IPC, 0, IPC_GETSADATAFUNC); char *data= export_sa_get(); wsprintf(msg,L"%x\n", L"", data[100] ); MessageBox(plugin.hwndParent,msg,L"Winamp Version",MB_OK);
} void quit() { }
// This is an export function called by winamp which returns this plugin info. // We wrap the code in 'extern "C"' to ensure the export isn't mangled if used in a CPP file. extern "C" __declspec(dllexport) winampGeneralPurposePlugin * winampGetGeneralPurposePlugin() { return &plugin; }
|
so, ich bin noch cpp anfänger und kann relativ wenig. Bin eher im .Net bereich. In der Doku von Winamp steht:
#define IPC_GETSADATAFUNC 800 // 0: returns a char *export_sa_get() that returns 150 bytes of data // 1: returns a export_sa_setreq(int want);
Und dieses ipc dingen schick ich mit sendmessage.
Bitte helft mir
grüße |