////////////////////////////////////////////////////////////////////////// // // VirtualDJ / Cue // Plugin SDK // (c)Atomix Productions 2007 // ////////////////////////////////////////////////////////////////////////// // // This file defines the basic functions that are used in all plugins. // It defines the functions and variables needed to: // - load and unload a plugin // - give the infos about the plugin (name, picture, etc) // - get the parameters automatically saved and restored between loads // - interact with VirtualDJ (ask queries or send commands) // - implement a custom interface // // Other functions specific to particular types of plugin can be found // in their respective header file // ////////////////////////////////////////////////////////////////////////// #ifndef VdjPluginH #define VdjPluginH ////////////////////////////////////////////////////////////////////////// // Platform specific defines for compatibility Mac/Windows #if defined (MAC) #define VDJ_EXPORT __attribute__ ((visibility ("default"))) #define VDJ_BITMAP char * #define VDJ_HINSTANCE void * #else #define VDJ_EXPORT __declspec( dllexport ) #define VDJ_BITMAP HBITMAP #define VDJ_HINSTANCE HINSTANCE #endif ////////////////////////////////////////////////////////////////////////// // Standard structures and defines struct TVdjPluginInfo { char *PluginName; char *Author; char *Description; VDJ_BITMAP Bitmap; DWORD Flag; }; #define VDJPARAM_BUTTON 0 #define VDJPARAM_SLIDER 1 #define VDJPARAM_SWITCH 2 #define VDJPARAM_STRING 3 #define VDJPARAM_CUSTOM 4 #define VDJPARAM_RADIO 5 ////////////////////////////////////////////////////////////////////////// // Base class class IVdjPlugin { public: // Initialization virtual HRESULT __stdcall OnLoad() {return 0;} virtual HRESULT __stdcall OnGetPluginInfo(TVdjPluginInfo *infos) {return E_NOTIMPL;} virtual ULONG __stdcall Release() {delete this;return 0;} virtual ~IVdjPlugin() {} // callback functions to communicate with VirtualDJ HRESULT (__stdcall *SendCommand)(char *command,int deck); // send a command to VirtualDJ HRESULT (__stdcall *GetInfo)(char *query,void *result); // get infos from VirtualDJ // parameters stuff // call DeclareParameter() for all your variables during OnLoad() // if type=VDJPARAM_CUSTOM or VDJPARAM_STRING, defaultvalue must be set to sizeof(*parameter) HRESULT (__stdcall *DeclareParameter)(void *parameter,int type,int id,char *name,int defaultvalue); // OnParameter will be called each time a parameter is changed from within VirtualDJ virtual HRESULT __stdcall OnParameter(int id) {return 0;} // Custom user-interface // Create a Window using CreateWindow() or CreateDialog(), and send back the HWND. // If you return E_NOTIMPL, the default interface will be used. virtual HRESULT __stdcall OnGetUserInterface(HWND *hWnd) {return E_NOTIMPL;} VDJ_HINSTANCE hInstance; int Width,Height; }; ////////////////////////////////////////////////////////////////////////// // GUID definitions #ifndef VDJCLASSGUID_DEFINED #define VDJCLASSGUID_DEFINED static const GUID CLSID_VdjPlugin = { 0x2e1480fe, 0x4ff4, 0x4539, { 0x90, 0xb3, 0x64, 0x5f, 0x5d, 0x86, 0xf9, 0x3b } }; #else extern static const GUID CLSID_VdjPlugin; #endif ////////////////////////////////////////////////////////////////////////// // DLL export function #ifndef NODLLEXPORT #ifdef __cplusplus extern "C" { #endif VDJ_EXPORT HRESULT __stdcall DllGetClassObject(const GUID &rclsid,const GUID &riid,void** ppObject); #ifdef __cplusplus } #endif #endif ////////////////////////////////////////////////////////////////////////// #endif