Problem mit einem Winamp Plugin.



  • Hi, ich denk ich fang von ganz vorne an:
    Also, Ich bin eigentlich Vb Coder. Jedoch brauche ich für mein Programm das VU-spectrum von Winamp, da aber Vb.Net nicht das so will wie ich, muss ich ein Winamp Plugin schreiben, das den VuMeter ausließt und mir iwie zuschickt. Entweder über Adressen, dass ich es mit ReadProcessMemory auslese oder in einer Datei, da bin ich mir nicht ganz sicher.
    Nur das Problem ist halt, dass ich kaum C++ spreche und somit nicht wirklich weiter komme.
    Ich hoffe ihr könnt mir etwas Helfen und nem Armen kleinen Programierer wie mir unter die Arme greifen:)
    Mein code sieht so aus:

    /*
    
    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 GetVu(void);
    void quit(void);
    
    char* (*export_sa_get)() = NULL; //Global function pointer. 
    char *data= export_sa_get();
    
    // 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)
      GetVu();
    	return 0;
    }
    
    void config() {
      //A basic messagebox that tells you the 'config' event has been triggered.
      //You can change this later to do whatever you want (including nothing)
      wchar_t msg[1024];
    
    int version = SendMessage(plugin.hwndParent,WM_WA_IPC,0,IPC_GETVERSION);
    int majVersion = GetVu();
    int minVersion = WINAMP_VERSION_MINOR(version);
    
    wsprintf(msg,L"The version of Winamp is: %x\n"
      L"Major version: %x\nMinor version: %x\n",
      version,
      majVersion,
      minVersion
      );
    
    MessageBox(plugin.hwndParent,msg,L"Winamp Version",MB_OK);
    }
    
    void quit() {
    }
    int GetVu(){
    export_sa_get = (char *(__cdecl *)(void)) SendMessage(plugin.hwndParent,WM_WA_IPC,0,IPC_GETSADATAFUNC);
    }
    
    // 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;
    }
    

    Einige Probleme sind, es wird nicht gespeichert, nicht ausgelesen und Winamp stürzt ab, weil ich aus vb.Net nur nen timer kenne und der in c++ nicht existiert, so hab ich einfach mal ne Endlos schleife gemacht.
    Ich bin verzweifelt, bitte helft mir xD

    grüße



  • Oh, ich merk gerade das der Code doch etwas anders ist. Ich möchte natürlich jede Sekunde den neuen Spektrum haben, aber die Endlos schleife ist iwie verschwunden.


Anmelden zum Antworten