Quick Sign In:  

Forum: VirtualDJ Plugins

Topic: Using the Plugin Wizard in VS2005

This topic is old and might contain outdated or incorrect information.

adrianhHome userMember since 2006
Hi All

In order to use the wizard in VS2005, all you need to do is the following:

1) Install wizard (VdjDspWizard.exe) as per normal.

2) Copy the "vdjdspwizard" directory under ".\\Microsoft Visual Studio .NET 2003\\Vc7\\VCWizards" to your VS2005 installation directory, which by default is ".\\Microsoft Visual Studio 8\\VC\\VCWizards".

3) Copy the "VirtualDJ" directory under ".\\Microsoft Visual Studio .NET 2003\\Vc7\\VCProjects" to your VS2005 installation directory, which by default is ".Microsoft Visual Studio 8\\VC\\VCProjects".

4) Edit the "vdjdspwizard.vsz" file located in ".\\Microsoft Visual Studio 8\\VC\\VCProjects\\VirtualDJ" and replace this line

Wizard=VsWizard.VsWizardEngine.7.1

with this line

Wizard=VsWizard.VsWizardEngine.8.0

5) Should work (holding thumbs), because mine did!
 

Posted Mon 05 Jun 06 @ 6:24 pm
djcelPRO InfinityModeratorMember since 2004
Yes it works. Sorry i could have given this before as i already use it since a long time now.
But thank again for the report
 

Posted Mon 05 Jun 06 @ 9:26 pm
Could someone PLEASE post step by step instructions, from opening Virtual studio, to build stage. All I get on the wizard is...


How would you like to process the sound ?


Don't process any sound
Normal processing
Process only fixed-width buffers
Process time-frequency datas (FFT)


What user interface will you use ?


No interface
Default interface
Custom interface


Then Finish!
Am I missing something, usually a wizard guids you through, asking more than 2 questions.
 

Posted Thu 08 Jun 06 @ 11:42 am
pernPRO InfinityMember since 2004
I use the wizzard with VS2005 also . When you press FINISH it will create a skeleton project that you have to edit/add your own code to.

Works perfect, Builds with no errors ;-)

Doesn't it create the project files for you ?
 

Posted Thu 08 Jun 06 @ 11:58 am
Ahh, Ok, well sort of. I'm trying to create a DAC2 plugin, but when I first tried the default code from here, touching the inner jog wheels would crash VDJ.
I think the SDK on the website may have been made for an older version of VDJ, as here, both the jog wheels and the pitch bend buttons would crash VDJ, Play and pause seemed to work ok though.
On further testing it seems to be all the buttons that contain +128 -128 ect. All buttons work except for the inner jog wheels, and the bend buttons, a problem in the code i feel!

The wizard is no use for the mappers i presume?
 

Posted Thu 08 Jun 06 @ 2:10 pm
pernPRO InfinityMember since 2004
Well, i'm not an expert on plugin development...

But the wizard is not a wizard that creates a ready to run application/plugin. Like a new sound effect , hardware controll mapper etc.

It just creates a minimal project that builds and is a starting point for new plugin projects.

If you just are trying to change and compile the DMC1/DAC3 default mapper source code in the SDK, then i think it's more work to use the wizard than to start from scratch. But i can be wrong.
 

Posted Thu 08 Jun 06 @ 2:57 pm
Looking at the code differences between the DAC2 mapper written in 04, compared with the DJC and the DAC3 mappers written in 05, i found that the sendaction command is missing the DOWN int at the end of all the SENDACTIONs in the DAC2, bothe the DJC and DAC3 have sendactions that look like;


SendAction("pitch_bend",channel,"+1024",down);

Whereas the DAC2 one would read;

SendAction("pitch_bend",channel,"+1024");

Could this be the problem? if so, where do I add [int, down] to fix it?
 

Posted Thu 08 Jun 06 @ 3:06 pm
pernPRO InfinityMember since 2004
Another wild guess, i'm sure someone knows this. And without internal knowledge of the VDJ code it's hard to tell.

But:

The DMC-1 is a true serial device, the DAC-2 is from a programming point a serial device. Both the DJC and the DAC-3 are true USB/HID devices.

So, my guess is that it's 2 different functions for "SendAction". So i don't think you can use the DAC-3 SendAction to DAC-2.
 

Posted Thu 08 Jun 06 @ 3:26 pm
Have tried adding it to

HRESULT (*SendAction)(char *action,char *chan,char *param,int down);

But I keep getting : error C2065: 'down' : undeclared identifier.
Anyone have any ideas, I am VERY new at all this!
 

Posted Thu 08 Jun 06 @ 3:28 pm
Quote :
Another wild guess, i'm sure someone knows this. And without internal knowledge of the VDJ code it's hard to tell.

But:

The DMC-1 is a true serial device, the DAC-2 is from a programming point a serial device. Both the DJC and the DAC-3 are true USB/HID devices.

So, my guess is that it's 2 different functions for "SendAction". So i don't think you can use the DAC-3 SendAction to DAC-2.


Ah yes, but the sendaction command is info being sent BACK to virtual DJ, and should always be the same, and we are changing the hardware, not the software. the front end of SetSymbol(i,0x08,true) is for the DAC2/DMC as case DAC3_10: is the frontend for the DAC3. But sendaction is "Talking" to virtual DJ.
 

Posted Thu 08 Jun 06 @ 3:33 pm
pernPRO InfinityMember since 2004
yes, it's one class but overloaded functions. Overloading provides a way to have multiple functions with the same name.


DMC1Mapper.h
void (*SendAction)(char *action,char *chan,char *param);

DAC3Mapper.h
HRESULT (*SendAction)(char *action,char *chan,char *param,int down);
 

Posted Thu 08 Jun 06 @ 3:42 pm
When I first starting work on the DAC-3 mapper, I found that using constant values (E.g: "+128") with SendAction() in the default DAC-3 mapper SDK causes a crash. I think this is probably due to the fact that SendAction() needs to manipulate (Write to) the string in some way for certain types of values (E.g: "+128" to split the + and 128.) A constant is supposed to be read-only and not modified, which triggers the crash.

I fixed this in the DAC-3 mapper by writing a simple function to convert a constant into a normal (Writable) char[] string:

inline char *CharStr(const char *val,char *str) { strcpy(str,val); return(str); }

(val = Value string to convert
str = Buffer char[] string for the result (Needs to be defined first.))

Then simply use this to convert the value of each SendAction() that causes a crash, e.g:

char st[128];

SendAction("scratch",channel,CharStr("+128",st),down);

(For the DAC-2 mapper, you'd need to remove the ,down off the end (This is used to tell VDJ whether the button is being pressed or released, but from the posts above, it looks like the DAC-2 mapper doesn't have this.)
 

Posted Thu 08 Jun 06 @ 4:33 pm
pernPRO InfinityMember since 2004
@jpboggis

Great Info, thanks. I guess i would have run into this also later since i'm writing a mapper for my own hardware. Any other "tips" that could be usefull when writing a mapper, or do the rest of the API work as expected ?
 

Posted Thu 08 Jun 06 @ 4:53 pm
But how is it that this code is on the VDJ website. & exactly where do I have to add these bits of code?

Does that mean that the default DAC3 SDK on the website also has the same issue?

Thanks for your help =)
 

Posted Thu 08 Jun 06 @ 5:00 pm
And how do I add it to something like this, for the jogwheels, where it seems to be a little more complex?

if(Load[chan])

{
SendAction("browser_switch","default","2");
SendAction("browser_updown","default",(velocity==0x30)?"+1":"-1");
LoadTree[chan]=0;
}
else SendAction("nudge",strchan,(velocity==0x30)?"+512":"-512");
}
else if((cmd==0x90)&&(velocity!=0)&&((note&0xE0)==0x20))
{
int chan=(note&0x10)?0:1;
int p=note&0x0F;if(p>=8) p=7-p;
if(Load[chan])
{
if((abs(p)>1)&&((p*Wheel[chan]<=0)||(abs(p)>abs(Wheel[chan]))))
{
SendAction("browser_switch","default","1");
SendAction("browser_updown","default",strparam(p));
LoadTree[chan]=1;
 

Posted Thu 08 Jun 06 @ 5:37 pm
Also just found that even just a number without the + or - will crash it, perhaps because it requires one or the other, if i leave it blank, no crash! (But no use either!)
 

Posted Thu 08 Jun 06 @ 5:58 pm
@pern:

The SendAction() crashing was the only real issue I had with with DAC-3 mapper, apart from getting it to compile successfully in the first place (Needed correct includes and project settings.)

Not sure whether you can create and use a custom mapper (Unless you develop it as a sound effect plugin) - Mappers such as DAC-3, DJC, etc. will only be loaded when this hardware is actually present and enabled in VDJ config.

@halo_djk

--- But how is it that this code is on the VDJ website.

I don't think the SDK has been tested thoroughly enough, or something may have changed in VDJ since it was written (Causing the crashing problem.) It's not too difficult for someone who knows C to work out and fix, but a real pain for someone who doesn't know it that well and just wants to make a few simple changes.

--- exactly where do I have to add these bits of code?

You need to use it as a 'wrapper' for the value parameter of SendAction() to convert any constant strings that cause crashing (E.g: "+128", "1", "default") to variable strings, i.e:

SendAction(action,channel,value)

...Becomes:

SendAction(action,channel,CharStr(value,buffer));

(buffer is a buffer variable string used for the conversion that needs to be defined first:

char buffer[128];

--- Does that mean that the default DAC3 SDK on the website also has the same issue?

Yes.

--- And how do I add it to something like this, for the jogwheels, where it seems to be a little more complex?

SendAction("browser_switch","default","2");
SendAction("browser_updown","default",(velocity==0x30)?"+1":"-1");


You need to add CharStr() to the value part of each SendAction() that causes a crash, e.g:

SendAction("browser_switch","default",CharStr("2",buffer));
SendAction("browser_updown","default",CharStr((velocity==0x30)?"+1":"-1",buffer));


You will need to define the buffer string used above too - Add this to the beginning of the OnCommand() function, e.g:

void CDefaultDMC1Mapper::OnCommand(unsigned char cmd,unsigned char note,unsigned char velocity)
{
char buffer[128];
 

Posted Sat 10 Jun 06 @ 6:57 pm
pernPRO InfinityMember since 2004
I'm creating a mapper from scratch as a sound plugin ....
 

Posted Sat 10 Jun 06 @ 7:03 pm


(Old topics and forums are automatically closed)