Hi,
I tryed to write plugin for my VirtualVinyl, I just want to sent actually played Artist and Song to my laser software. So I downloaded SDK, but when i wrote small plugin i findout that function GetInfo doesn't work for me... Where is problem? I also try to debug this code, but result is always filled with zeroes...
I tryed to write plugin for my VirtualVinyl, I just want to sent actually played Artist and Song to my laser software. So I downloaded SDK, but when i wrote small plugin i findout that function GetInfo doesn't work for me... Where is problem? I also try to debug this code, but result is always filled with zeroes...
Quote :
#include "stdafx.h"
#include "vdjPlugin.h"
class CActualPlayed: public IVdjPlugin {
public:
HRESULT __stdcall OnLoad();
HRESULT __stdcall OnGetPluginInfo(TVdjPluginInfo *infos);
HRESULT __stdcall OnParameter(int id);
ULONG __stdcall Release();
};
HRESULT __stdcall DllGetClassObject(const GUID &rclsid,const GUID &riid,void** ppObject)
{
// This is the standard DLL loader for COM object.
// You don't need to change anything in this function.
if(memcmp(&rclsid,&CLSID_VdjPlugin6,sizeof(GUID))!=0) return CLASS_E_CLASSNOTAVAILABLE;
/* if(memcmp(&riid,&IID_IVdjPluginDsp,sizeof(GUID))!=0) return CLASS_E_CLASSNOTAVAILABLE; */
*ppObject=new CActualPlayed();
return NO_ERROR;
}
HRESULT __stdcall CActualPlayed::OnLoad()
{
FILE *logFile;
logFile = fopen("LogFile.txt","w");
TVdjQueryResult result;
GetInfo("VdjVersion",&result);
fprintf(logFile, "Result: %d\n", result.type);
fclose(logFile);
return S_OK;
}
HRESULT __stdcall CActualPlayed::OnParameter(int id)
{
return S_OK;
}
HRESULT __stdcall CActualPlayed::OnGetPluginInfo(TVdjPluginInfo *infos)
{
infos->Author="My";
infos->PluginName="SendPlayedFile";
infos->Description="This plugin sends actually played song name.";
infos->Flag=0;
return S_OK;
}
ULONG __stdcall CActualPlayed::Release()
{
delete this;
return 0;
}
#include "stdafx.h"
#include "vdjPlugin.h"
class CActualPlayed: public IVdjPlugin {
public:
HRESULT __stdcall OnLoad();
HRESULT __stdcall OnGetPluginInfo(TVdjPluginInfo *infos);
HRESULT __stdcall OnParameter(int id);
ULONG __stdcall Release();
};
HRESULT __stdcall DllGetClassObject(const GUID &rclsid,const GUID &riid,void** ppObject)
{
// This is the standard DLL loader for COM object.
// You don't need to change anything in this function.
if(memcmp(&rclsid,&CLSID_VdjPlugin6,sizeof(GUID))!=0) return CLASS_E_CLASSNOTAVAILABLE;
/* if(memcmp(&riid,&IID_IVdjPluginDsp,sizeof(GUID))!=0) return CLASS_E_CLASSNOTAVAILABLE; */
*ppObject=new CActualPlayed();
return NO_ERROR;
}
HRESULT __stdcall CActualPlayed::OnLoad()
{
FILE *logFile;
logFile = fopen("LogFile.txt","w");
TVdjQueryResult result;
GetInfo("VdjVersion",&result);
fprintf(logFile, "Result: %d\n", result.type);
fclose(logFile);
return S_OK;
}
HRESULT __stdcall CActualPlayed::OnParameter(int id)
{
return S_OK;
}
HRESULT __stdcall CActualPlayed::OnGetPluginInfo(TVdjPluginInfo *infos)
{
infos->Author="My";
infos->PluginName="SendPlayedFile";
infos->Description="This plugin sends actually played song name.";
infos->Flag=0;
return S_OK;
}
ULONG __stdcall CActualPlayed::Release()
{
delete this;
return 0;
}
Posté Wed 08 Sep 10 @ 9:02 am
Oh, and I also try to use
instead of:
but without sucess, I also try to use GetInfo for FileName, and more other, but anyone seems to work...
I use Virtual Vinyl v. 6.1.2 on Win XP 32bit and VS 6.0
Quote :
int version;
GetInfo("VdjVersion", &version);
int version;
GetInfo("VdjVersion", &version);
instead of:
Quote :
TVdjQueryResult result;
GetInfo("VdjVersion", &result);
TVdjQueryResult result;
GetInfo("VdjVersion", &result);
but without sucess, I also try to use GetInfo for FileName, and more other, but anyone seems to work...
I use Virtual Vinyl v. 6.1.2 on Win XP 32bit and VS 6.0
Posté Wed 08 Sep 10 @ 9:26 am
The old GetInfo() examples are no longer relevant.
If you look at vdjPlugin.h you will see that to use GetInfo() with the newer SDK you need to create and initialise a TVdjPluginInfo, the call GetInfo passing that. I always initialise the struct first before calling GetInfo by setting everything to a 0 or NULL value.
Also you need to be using v6 get commands now, not the older ones - for example 'get version'.
If you look at vdjPlugin.h you will see that to use GetInfo() with the newer SDK you need to create and initialise a TVdjPluginInfo, the call GetInfo passing that. I always initialise the struct first before calling GetInfo by setting everything to a 0 or NULL value.
Also you need to be using v6 get commands now, not the older ones - for example 'get version'.
Posté Wed 08 Sep 10 @ 11:13 am
Thanks for you help, the GetInfo now works for me... But I have another question... How I can get information if the deck is currently played? Is there any replacement for these:
Status(int*): return the playing status: 0 is stopped, 1 is scratching, 2 is playing.
SongStatus(int*): return the song status: 1 is loading, 2 is loaded, -1 is empty, -2 is error, -3 is bypass.
OnAir(int*): return 0 if the deck not playing, 1 if the deck is playing but VirtualDJ thinks it's not on air, and 2 if it's on air.
Because I want to know if the song is currently played, but I can't to find this information....
Thanks for answer
Status(int*): return the playing status: 0 is stopped, 1 is scratching, 2 is playing.
SongStatus(int*): return the song status: 1 is loading, 2 is loaded, -1 is empty, -2 is error, -3 is bypass.
OnAir(int*): return 0 if the deck not playing, 1 if the deck is playing but VirtualDJ thinks it's not on air, and 2 if it's on air.
Because I want to know if the song is currently played, but I can't to find this information....
Thanks for answer
Posté Thu 09 Sep 10 @ 6:41 am