快速登录:  

Forum: VirtualDJ Plugins

话题: Queries used by GetInfo()

由于该帖子已年深日久,可能包含陈旧过时或描述错误的信息。

djcelPRO InfinityModeratorMember since 2004
With SDK 6 ("CLSID_VdjPlugin6") :

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);
}




 

发表时间 Sun 01 May 11 @ 2:30 pm


(陈旧帖子或论坛版块会自动关闭)