Quick Sign In:  

Forum: VirtualDJ Plugins

Topic: BCD2000 LED - HOW TO ?

This topic is old and might contain outdated or incorrect information.

gbehalPRO InfinityMember since 2006
Hello,

My project : I want to turn on/off led on controller Behringer BCD2000 with only "Midi Config" for use my mapper config and not "bcd 2000 mode".
I use VDJ V5.0.
I write plugin in c++ with the SDK of virtual dj.
The command for device (OnButton, SetLed) don't work in my project, maybe because i don't initialise controller (function GetDeviceType(int * type) don't understand) or other thing ... i don't know, it's my first plugin and i need some help for beginning.

I use DEV C++ with header : "vdjplugin.h" "vdjdevice.h" "bcdmapper.h".

Thanks, for help (excuse my english language)

My main c++ is :

###########################################################

define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include "vdjDevice.h"
#include "BCDmapper.h"
#include <stdio.h>
#include <time.h>
////////////////////////////////////////////////////////// DEFINITIONS
#define C_DECK -1
#define P_DECK 0
#define G_DECK 1
#define D_DECK 2

class BcdMapper : public IVdjPluginDevice
{
public:
// VdjPlugin
HRESULT OnLoad();
HRESULT __stdcall OnGetPluginInfo(TVdjPluginInfo *infos);
HRESULT __stdcall OnParameter(int id);
ULONG __stdcall Release();
// Device
HRESULT __stdcall GetDeviceType(int *type);
HRESULT __stdcall OnTimer();
HRESULT __stdcall OnReset();
HRESULT __stdcall OnButton(int chan,int button,int down);



private:
// Example: for the default interface:
int slider1;
int slider2;
int i;
char st[128];
int *type[10];

};



HRESULT __stdcall DllGetClassObject(const GUID &rclsid,const GUID &riid,void** ppObject)
{
if(memcmp(&rclsid,&CLSID_VdjPlugin,sizeof(GUID))!=0) return CLASS_E_CLASSNOTAVAILABLE;
if(memcmp(&riid,&IID_IVdjPluginDevice,sizeof(GUID))!=0) return CLASS_E_CLASSNOTAVAILABLE;
*ppObject=new BcdMapper();
return NO_ERROR;
}
//------------------------------------------------------------------------
HRESULT __stdcall BcdMapper::OnLoad()
{
//SendCommand("kill_bass",C_DECK); // interaction avec vdj OK

return S_OK;
}
HRESULT __stdcall BcdMapper::OnParameter(int id) { return S_OK; }
//------------------------------------------------------------------------
HRESULT __stdcall BcdMapper::OnGetPluginInfo(TVdjPluginInfo *infos)
{
infos->Author="Guillaume BEHAL - gbehal";
infos->PluginName="bcd 2000 Diodes";
infos->Description="Allumer les diodes";
infos->Bitmap=LoadBitmap(hInstance,MAKEINTRESOURCE(100));
infos->Flag=0;
return S_OK;
}

//------------------------------------------------------------------------
ULONG __stdcall BcdMapper::Release() { delete this; return 0; }

HRESULT __stdcall BcdMapper::OnTimer()
{
// période 100 ms pour updater les diodes
SendCommand("kill_bass",C_DECK);

}
HRESULT __stdcall BcdMapper::GetDeviceType(int *type)
{
// ??
return S_OK;
}

HRESULT __stdcall BcdMapper::OnReset() {
// ??
return 0; }

HRESULT BcdMapper::OnButton(int chan,int button,int down)
{
SendCommand("kill_bass",C_DECK);
return S_OK;
}

###########################################################
 

Posted Sun 16 Sep 07 @ 5:05 pm
GetDeviceType needs to return the correct control device number, so VDJ knows which controller the plugin is for, so you would need:

// Set device type

HRESULT __stdcall BcdMapper::GetDeviceType(int *type)
*type = PLUGINDEVICE_BCD2000;
return S_OK;
}


Also, you will need to name your .DLL correctly for VDJ to load it at automatically startup - For the BCD2000, the plugin name would either be bcd.dll or bcd2000.dll

Program code to update the status of LED's needs to go in the OnTimer() function (This is called every 1/10th of a second.)
 

Posted Sun 16 Sep 07 @ 9:02 pm
gbehalPRO InfinityMember since 2006
Ok, i write the function GetDeviceType correctly (thanks jboggis) but the result is same : the function Timer does not work, the led stay off.
For test, i add a line in function timer : SetCommand("kill_bass",1), but this line is no execute.
Thanks for the name to the dll, now it's more speed in test.
I have a bug in my source code but i don't know where.
thanks for your support
 

Posted Sun 16 Sep 07 @ 9:57 pm
ktn123Home userMember since 2011
how it use in dll?
 

Posted Mon 18 Jul 11 @ 5:34 am
SBDJPRO Infinity Member since 2006
This thread is old.

Please start a new thread and provide information as to what you are actually asking as your question doesn't really make any sense.
 

Posted Mon 18 Jul 11 @ 5:45 am


(Old topics and forums are automatically closed)