xDRV in VirtualDJ Plugin



  • hallo
    ich bin wenig vertraut mit c++ aber muss diese plugin möglichst schnell fertigstellen. ich habe den parallelport treiber xDRV von www.pcports.ru schon erfolgreich in einem sepearten vcpp projekt genutzt und will dies nun in mein vdj plugin einarbeiten. dabei stoße ich aber auch für mich nicht lösbare probleme.

    die wichtigen ausschnitte des codes:
    class C3 : public IVdjDsp2
    {
    public:
    HRESULT __stdcall OnLoad(TPluginInfos *PluginInfos);
    HRESULT __stdcall OnStart(int pos);
    HRESULT __stdcall OnStop(int pos);

    HRESULT __stdcall OnProvidedInterfaceInit(TProvidedInterfaceInit Init);
    HRESULT __stdcall OnButton(int button,bool down);
    HRESULT __stdcall OnSlider(int slider,int value);
    private:
    void MyInterrupt(void param);

    int stamp;
    int r1[24],r2[24];
    };

    HRESULT __stdcall C3::OnLoad(TPluginInfos *PluginInfos)
    {
    PluginInfos->PluginVersion=VDJDSP_VERSION;
    PluginInfos->Processing=PROCESSING_NONE;
    PluginInfos->Interface=INTERFACE_PROVIDED;
    // Give some infos about you and your plugin
    PluginInfos->Name="3";
    PluginInfos->Author="_put your name here_";
    // Replace the files "BITMAP.BMP" and "SELECTED.BMP" in your directory with your owns.
    PluginInfos->Bitmap=LoadBitmap(hInstance,MAKEINTRESOURCE(100));
    PluginInfos->SelectedBitmap=LoadBitmap(hInstance,MAKEINTRESOURCE(101));
    // Make any extra initialisation here
    bool res = xDRV_OpenDriver();
    if(res)
    {
    xDRV_InitInterput(MyInterrupt, nullptr);
    xDRV_Write(0x378, 0x00);
    // full Clock
    xDRV_Write(0x378+2, 0x1A);
    xDRV_Write(0x378+2, 0x1B);
    // load
    xDRV_Write(0x378+2, 0x19);
    xDRV_Write(0x378+2, 0x1B);
    }
    else
    {
    //error
    }
    return S_OK;
    }

    void MyInterrupt(void param)*
    {
    HRESULT hr;
    float beatpos;
    hr=GetParam(1,"BeatPos",&beatpos);
    //if(FAILED(hr)) return S_FALSE;
    int fbp=(int)floor(beatpos);
    if(fbp!=stamp)
    {
    xDRV_Write(0x378, 0xFF);
    stamp=fbp;
    }
    else
    {
    xDRV_Write(0x378, 0x00);
    }
    xDRV_Write(0x378+2, 0x1A);
    xDRV_Write(0x378+2, 0x1B);
    // load
    xDRV_Write(0x378+2, 0x19);
    xDRV_Write(0x378+2, 0x1B);
    //return S_OK;
    }

    (bekomme den obenstehenden code ausschnitt nicht in die c++ darstellung. konnte nicht feststellen warum)

    führen zum fehler:

    error C3867: 'C3::MyInterrupt': function call missing argument list; use '&C3::MyInterrupt' to create a pointer to member
    

    mit

    xDRV_InitInterput(&C3::MyInterrupt, nullptr);
    

    bekomme ich

    error C2664: 'xDRV_InitInterput' : cannot convert parameter 1 from 'void (__thiscall C3::* )(void *)' to 'void (__cdecl *)(void *)'
    

    habe vieles ausprobiert was ich in versch suchergebnissen gefunden habe aber wie gesagt übersteigt dies meine fähigkeiten.

    bitte um hilfe

    anbei hoffentlich alle wichtigen daten.

    doofy.speciesm.net/xdrvprob/



  • Die MyInterrupt muss statisch sein.


Anmelden zum Antworten