With SDK 6 ("CLSID_VdjPlugin6") :
1) To know if the deck is playing
2) Here is an example to get the home folder of VirtualDJ with conversion in real Unicode (UTF-16):
It works with Unicode filepath in VirtualDJ (UTF-8)
3) Here is an example to get "author" from the loaded song with conversion in real Unicode (UTF-16):
It works with Unicode filename in VirtualDJ (UTF-8)
4) A way to get BeatPos
5) A way to get the HWND of the VDJ Skin
Be sure the option "Detect 64-bit Portability Issues" is set to "No" in MS Visual Studio otherwise you will have a cast Warning for HWND.
6) A way to know if the user is a premium member. It can be used to limit features to premium members only.
1) To know if the deck is playing
TVdjQueryResult qRes;
HRESULT hr;
int isPlaying;
hr=GetInfo("play",&qRes);
if(hr==S_OK)
{
isPlaying = qRes.vint;
}
2) Here is an example to get the home folder of VirtualDJ with conversion in real Unicode (UTF-16):
wchar_t str_VdjFolder[1024]= TEXT("");
TVdjQueryResult qRes;
HRESULT hr;
hr=GetInfo("get vdj_folder",&qRes);
if(hr==S_OK)
{
int len = (int) strlen(qRes.string) + 1;
MultiByteToWideChar( CP_UTF8, 0, qRes.string, len, str_VdjFolder, 1024 );
}
It works with Unicode filepath in VirtualDJ (UTF-8)
3) Here is an example to get "author" from the loaded song with conversion in real Unicode (UTF-16):
wchar_t str_author[512]= TEXT("");
TVdjQueryResult qRes;
HRESULT hr;
hr=GetInfo("get loaded_song 'author'",&qRes);
if(hr==S_OK)
{
int len = (int) strlen(qRes.string) + 1;
MultiByteToWideChar( CP_UTF8, 0, qRes.string, len, str_author, 512 );
}
It works with Unicode filename in VirtualDJ (UTF-8)
4) A way to get BeatPos
TVdjQueryResult qRes;
HRESULT hr;
float beatpos;
hr=GetInfo("get beatpos",&qRes);
if(hr!=S_OK) beatpos=1.0f;
else beatpos = qRes.vfloat;
5) A way to get the HWND of the VDJ Skin
TVdjQueryResult qRes;
HRESULT hr;
HWND hWndParent;
hr=GetInfo("get hwnd",&qRes);
if(hr!=S_OK) hWndParent=NULL;
else hWndParent = (HWND) qRes.vint;
Be sure the option "Detect 64-bit Portability Issues" is set to "No" in MS Visual Studio otherwise you will have a cast Warning for HWND.
6) A way to know if the user is a premium member. It can be used to limit features to premium members only.
TVdjQueryResult qRes;
HRESULT hr;
bool bPremiumMember;
hr=GetInfo("get membership",&qRes);
if(hr==S_OK)
{
bPremiumMember = (qRes.vint ==1);
}
Posted Sun 01 May 11 @ 2:30 pm