Hi guys !!
I'm a c++ programmer and some of my clients use VirtualDJ to play music in his clubs. Now, they have asked me to extend the functionality of the software adding some plugins. For this, I need the plugin SDK and some source code for orientation. Actually I only can download the SDK header files, but I need more information (for example, about the commands and the info that I can exchange with VirtualDJ)
What can I do to get access to this information ?
Thanks a lot
I'm a c++ programmer and some of my clients use VirtualDJ to play music in his clubs. Now, they have asked me to extend the functionality of the software adding some plugins. For this, I need the plugin SDK and some source code for orientation. Actually I only can download the SDK header files, but I need more information (for example, about the commands and the info that I can exchange with VirtualDJ)
What can I do to get access to this information ?
Thanks a lot
Posted Wed 16 Jun 10 @ 3:51 am
Source code is only available to licensed users of VDJ who have attained the Experienced level status and above.
As indicated in the SDK, information exchange with VDJ is via the SendCommand() and GetInfo() calls. Sending "help" to GetInfo() will get you a pointer to a char containing available GetInfo() queries. SendCommand() makes use of the usual commands available to VDJ through other means.
What kind of plugins are you interested in developing?
Regards,
Scott
As indicated in the SDK, information exchange with VDJ is via the SendCommand() and GetInfo() calls. Sending "help" to GetInfo() will get you a pointer to a char containing available GetInfo() queries. SendCommand() makes use of the usual commands available to VDJ through other means.
What kind of plugins are you interested in developing?
Regards,
Scott
Posted Wed 16 Jun 10 @ 8:17 am
Thank you a lot for your answer, Scott... I'm only trying to be sending the title of the current song played to a Led panel. The part about the Led panel is not the problem, however i don't have enough information about the plugin SDK. I have already compiled a working basic plugin (non functional), and virtualDJ recognizes it (shows the pluginInfo data), but as I don't have any source code reference, I don't now how to ask VirtualDJ about the Current song title, and most important, Where to put this code, because I only can identify the onLoad and OnGetPluginInfo functions, and it doesn't seem to be here.
Any help will be appreciated.
Any help will be appreciated.
Posted Wed 16 Jun 10 @ 1:30 pm
Ideally this post should be in the plugins forum - I will move it there - but not until your next reply so I know you have seen that I'm going to move it ;)
Anyway, what class have you inherited when you created your plugin? The class you are using dictates what functions are available. If you're using the base plugin class then you will have to spawn your own thread from OnLoad(). Other plugin classes have regularly called functions as documented in their class definitions.
Quick question though - is this LED panel available as a HID device? This might possibly be an easier route than writing a plugin, since VDJ supports I/O with HID devices.
As I said in my last post the key to retrieving information from VDJ is the GetInfo() call. Passing "help" to GetInfo() will get you a list of available queries - two of which are "Author" and "Title". If you look in the vdjPlugin.h file you will see information about calling GetInfo() and the TVdjQueryResult structure. Older SDK versions worked slightly differently in this aspect.
Anyway, what class have you inherited when you created your plugin? The class you are using dictates what functions are available. If you're using the base plugin class then you will have to spawn your own thread from OnLoad(). Other plugin classes have regularly called functions as documented in their class definitions.
Quick question though - is this LED panel available as a HID device? This might possibly be an easier route than writing a plugin, since VDJ supports I/O with HID devices.
As I said in my last post the key to retrieving information from VDJ is the GetInfo() call. Passing "help" to GetInfo() will get you a list of available queries - two of which are "Author" and "Title". If you look in the vdjPlugin.h file you will see information about calling GetInfo() and the TVdjQueryResult structure. Older SDK versions worked slightly differently in this aspect.
Posted Wed 16 Jun 10 @ 7:04 pm
First of all, sorry, I didn't seen the Plugin forum until just now,so please feel free about moving this message there... :)
Second, Scott, thank you (again) for your tips, I have my own plugin now, and for the LED communication, I use a named pipe in a static thread created into the OnLoad() method. I destroy this thread into the Release() method and all seems to be OK. I have only found a "bug"... If I destroy my plugin in the Release() method, I get a Visual Studio Debugger heap fail when I disable the plugin, so I only return a 0 in the Release() method, and destroy the plugin with the natural destructor of the class. Something like this:
ULONG __stdcall ThePlugin::Release()
{
BOOL bRes=TerminateThread(hThread, 0);
LocalFree(...dinamic variables here...);
........
return 0;
}
ThePlugin::~ThePlugin () { delete this; }
Is it this OK ??
I build the plugin into the DllGetClassObject() function with this line (I'm working with the VirtualDJ Pro 5.2 version)
if(memcmp(&rclsid,&CLSID_VdjPlugin5,sizeof(GUID))!=0) return CLASS_E_CLASSNOTAVAILABLE;
*ppObject=new Cmyplugin();
Thanks a lot again, and very good work, guys
Second, Scott, thank you (again) for your tips, I have my own plugin now, and for the LED communication, I use a named pipe in a static thread created into the OnLoad() method. I destroy this thread into the Release() method and all seems to be OK. I have only found a "bug"... If I destroy my plugin in the Release() method, I get a Visual Studio Debugger heap fail when I disable the plugin, so I only return a 0 in the Release() method, and destroy the plugin with the natural destructor of the class. Something like this:
ULONG __stdcall ThePlugin::Release()
{
BOOL bRes=TerminateThread(hThread, 0);
LocalFree(...dinamic variables here...);
........
return 0;
}
ThePlugin::~ThePlugin () { delete this; }
Is it this OK ??
I build the plugin into the DllGetClassObject() function with this line (I'm working with the VirtualDJ Pro 5.2 version)
if(memcmp(&rclsid,&CLSID_VdjPlugin5,sizeof(GUID))!=0) return CLASS_E_CLASSNOTAVAILABLE;
*ppObject=new Cmyplugin();
Thanks a lot again, and very good work, guys
Posted Fri 18 Jun 10 @ 4:55 pm