| Author | - Topic: Plugins SDK for VirtualDJ v5.x and Numark CUE (PC & MAC) - |
|---|---|
Please read this topic first:
http://www.virtualdj.com/wiki/index.php/Plugin_Guide I advise you to use this file for better compatbility PC/MAC instead: vdjPlugin.h ////////////////////////////////////////////////////////////////////////// // // VirtualDJ / Cue / VirtualVinyl / PCDJ VJ // Plugin SDK for Windows / MAC OS // (c)Atomix Productions 2006-2008 // File Version: 1.3 // ////////////////////////////////////////////////////////////////////////// // // 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 VdjPlugin_H #define VdjPlugin_H ////////////////////////////////////////////////////////////////////////// // Platform specific defines for compatibility Mac/Windows #if (defined(WIN32) || defined(_WIN32) || defined(__WIN32_)) #ifndef WIN32_LEAN_AND_MEAN /* For old plugins compatibility */ #define WIN32_LEAN_AND_MEAN #include <windows.h> #endif #define VDJ_EXPORT __declspec( dllexport ) #define VDJ_API __stdcall #define VDJ_BITMAP HBITMAP #define VDJ_HINSTANCE HINSTANCE #define VDJ_WINDOW HWND #define PLUGIN_BITMAP LoadBitmap(hInstance, MAKEINTRESOURCE(100)) /* For TVdjPluginInfo->Bitmap */ #elif (defined(__APPLE__) || defined(MACOSX) || defined(__MACOSX__)) #define VDJ_EXPORT __attribute__ ((visibility ("default"))) #define VDJ_API #define VDJ_BITMAP char * #define VDJ_HINSTANCE void * #define VDJ_WINDOW WindowRef #define PLUGIN_BITMAP "bitmap.bmp" /* For TVdjPluginInfo->Bitmap */ #define S_OK ((HRESULT)0x00000000L) #define S_FALSE ((HRESULT)0x00000001L) #define E_NOTIMPL ((HRESULT)0x80004001L) #define MAKEINTRESOURCE(i) (LPSTR)((ULONG_PTR)((WORD)(i))) #define CLASS_E_CLASSNOTAVAILABLE -1 #define NO_ERROR 0 #define wsprintf sprintf #define __stdcall /* For old plugins compatibility */ typedef long HRESULT; typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[ 8 ]; } GUID; typedef unsigned long ULONG; typedef unsigned long DWORD; #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 VDJ_API OnLoad() {return S_OK;} virtual HRESULT VDJ_API OnGetPluginInfo(TVdjPluginInfo *infos) {return E_NOTIMPL;} virtual ULONG VDJ_API Release() {delete this;return 0;} virtual ~IVdjPlugin() {} // callback functions to communicate with VirtualDJ HRESULT (VDJ_API *SendCommand)(char *command,int deck); // send a command to VirtualDJ HRESULT (VDJ_API *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 (VDJ_API *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 VDJ_API OnParameter(int id) {return S_OK;} // 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 VDJ_API OnGetUserInterface(VDJ_WINDOW *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 VDJ_API DllGetClassObject(const GUID &rclsid,const GUID &riid,void** ppObject); #ifdef __cplusplus } #endif #endif ////////////////////////////////////////////////////////////////////////// #endif /* VdjPlugin_H */ You can find the old SDK for VirtualDJ v4.x and Numark CUE (only PC) here: http://www.virtualdj.com/addons/tools.html > In the old SDK, I have included a DSP example with a lot of comments and a .dll which enables you to get the whole list of queries used by the function GetInfo() ( see the post in this forum relative at the function GetInfo() ) > The actions used by the function SendCommand() are always the ones listed in the Keyboard Shortcuts in VirtualDJ > Decks in VirtualDJ: #define PLUGIN_DECK 0
#define LEFT_DECK 1 #define RIGHT DECK 2 > Frequency used in VirtualDJ: #define SAMPLING_RATE 44100
> Here is a list of the functions used in VirtualDJ v5.2: #define MAX_FUNCTIONS 219 LPCSTR g_szFuncNames[ MAX_FUNCTIONS + 1 ] = { // Default: "nothing", // Functions: "add_favoritefolder", "add_filterfolder", "add_virtualfolder", "adjust_cbg", "adjust_cbg4", "auto_crossfade", "automix", "bass", "bassfader", "beat_juggle", "beatlock", "browser_gotofolder", "browser_open", "browser_sort", "browser_switch", "browser_toplaylist", "browser_tosidelist", "browser_updown", "clone_deck", "close", "crossfader", "crossfader_behavior", "cue", "cue_stop", "delete_cue", "dmx", "dmx_black", "dmx_chase", "dmx_color", "dmx_flash", "dmx_setvalue", "dmx_strobe", "edit_bpm", "edit_comment", "edit_cuename", "effect_activate", "effect_button", "effect_redraw", "effect_select", "effect_select_multi", "effect_slider_1", "effect_slider_2", "effect_slider_3", "effect_slider_4", "effect_slider_5", "empty_buffer", "eq_reset", "file_info", "free_playlist", "free_sidelist", "gain", "goto_cue", "goto_folder", "goto_last_folder", "goto_mixpoint", "headphone_crossfader", "headphone_mix", "headphone_volume", "hide_pannel", "high", "highfader", "hold", "hotcue", "invert_icdx", "jogwheel", "key_lock", /* "key_offset", */ // removed in v5.1 "kill_bass", "kill_high", "kill_medium", "level", "load_fromplaylist", "load_fromsidelist", "load_sample", "loadsamplefile", "lock_pannel", "loop", "loop_in", "loop_length", "loop_move", "loop_out", "loop_select", "loop_shift", "master_tempo", "master_volume", "maximize", "medium", "mediumfader", "menu", "mic_volume", "minimize", "mix_now", "mix_now_nosync", "noduplicates", "nudge", "onlynew", "pannel", "pause", "pause_stop", "pitch", "pitch_bend", "pitch_reset", "play", "play_n_loop", "play_pause", "play_stutter", "playlist_options", "plugin_changepage", "randomize", "record", "record_config", "record_cut", "recurse_folder", "reloop", "repeat_playlist", "reset_xp10", "reverse", "sample_options", "sample_play", "sample_rec_jingle", "sample_rec_loop", "sample_select", "sample_stop_all", "sample_volume", "sample_volume_1", "sample_volume_2", "sample_volume_3", "sample_volume_4", "sample_volume_5", "sample_volume_6", "sample_volume_7", "sample_volume_8", "sample_volume_9", "sample_volume_10", "sample_volume_11", "sample_volume_12", "save_playlist", "save_sample", "saveregistryconfig", "scratch", /* "scratchwheel", */ // removed in v5.1 "search", "search_options", "seek", "select", "set_cue", "set_mixpoint", "set_scratchlatency", "settings", "setusercrossfade", "shortcut", "show_pannel", "skip_beat", "smart_loop", "smart_seek", "song_pos", "stop", "switch_sidelist_playlist", "sync", "sync_nocbg", "timecode_active", "timecode_bypass", "timecode_mode", "unload", "vfolder_fromplaylist", "video_crossfade", "video_fx", "video_fx_button", "video_fx_param", "video_fx_param_2", "video_fx_param_3", "video_fx_param_4", "video_fx_param_5", "video_open", "video_select_fx", "video_select_fx_multi", "video_select_trans", "video_trans", "video_trans_button", "video_trans_param", "video_trans_param_2", "video_trans_param_3", "video_trans_param_4", "video_trans_param_5", "videosound_start", "videosound_stop", "view_options", "zoom", // v5.0 rev.4 "mix_next", "mix_next_sidelist", /* "wheel", */ // removed in v5.1 /* "wheelmode", */ // removed in v5.1 "browser_tovfolder", "crash", // v5.0 rev.5 "clone_deck_nopitch", // v5.0 rev.6 "auto_mix_next", "auto_mix_next_sidelist", // v5.0 rev.7 "automix_skip", "effect_slot_activate", "effect_slot_select", "load_filepath", "master_balance", "crossfader_hamster", "video_link", "video_unlink", "log_search", "pitch_range", "multibutton", "multibutton_select", // v5.1 "beat_tap", "key", "key_smooth", "smart_play", "smart_cue", "effect_slot_scroll", "scratch_wheel", "scratchweel_touch", "vinyl_mode", // v5.2 "browser_back", "browser_enter", "effect_slot_unscroll", "video_fadetoblack", NULL }; > You can create "asynchronous" sound plugin (the sound plugin still works even if the button stop is pushed) by using the following flag: infos->Flag=VDJPLUGINFLAG_PROCESSSCRATCH;
In this case, the input audio buffer is called after the pitch instead of before. So such a plugin has directly access to the final buffer which has a constant size of "latency" samples (except during loop where the buffer size is 64 samples) |
|
In order to use the wizard in Visual Studio 2005, all you need to do is the following:
1) Install wizard (VdjDspWizard.exe) as per normal. 2) Copy the "vdjdspwizard" directory under "C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Vc7\\VCWizards" to your VS2005 installation directory, which by default is "C:\\Program Files\\Microsoft Visual Studio 8\\VC\\VCWizards". 3) Copy the "VirtualDJ" directory under "C:\\Program Files\\Microsoft Visual Studio .NET 2003\\Vc7\\VCProjects" to your VS2005 installation directory, which by default is "C:\\Program Files\\Microsoft Visual Studio 8\\VC\\vcprojects". 4) Edit the "vdjdspwizard.vsz" file ("Open with..."+NotePad) located in "C:\\Program Files\\Microsoft Visual Studio 8\\VC\\vcprojects\\VirtualDJ" and replace this line Wizard=VsWizard.VsWizardEngine.7.1
with this line : Wizard=VsWizard.VsWizardEngine.8.0
Do not modify this line: VSWIZARD 7.1
_____________________________________________________________________________________ PS: You can update the C++ files of the SDK in this folder: C:\\Program Files\\Microsoft Visual Studio 8\\VC\\VCWizards\\vdjpluginwizard\\Templates\\1036 |
|


