Accesso rapido:  

Forum: VirtualDJ Plugins

Topic: Questions about plugin development - Page: 1

Questa parte dell'argomento è obsoleta e potrebbe contenere informazioni obsolete o errate

NicotuxHome userMember since 2014
Hi,

1 - How the hell can a plugin be aware the activation button/led was pressed ? I created a button for this for now but it does not reflect the led status
Badly not found in examples

2 - Is there a way to know the folder where the plugin was installed/loaded from ?
"get vdj_folder" with some undocumented parameter ?

3 - How to know what deck the plugin is loaded on?
"get_plugindeck" seems to always return active deck number
i.e.: for a plugin loaded in master slot it returns 1 or 2 ... as well as loaded in any other deck
 

Inviato Sat 23 Feb 19 @ 5:37 am
locoDogPRO InfinityModeratorMember since 2013
3 GetInfo("get_deck", &returnDouble);
 

Inviato Sat 23 Feb 19 @ 5:41 am
AdionPRO InfinityCTOMember since 2006
1. OnStart and OnStop ?

2. Is indeed not available
 

Inviato Sat 23 Feb 19 @ 5:46 am
NicotuxHome userMember since 2014
Ok, let's give a try, thanks
 

Inviato Sat 23 Feb 19 @ 5:50 am
NicotuxHome userMember since 2014
Well i'm stuck

GetInfo("get_plugindeck", &resultdouble) and GetStringInfo("get_plugindeck", &resultstring, 256) both go on returning the deck active at the time plugin is loaded

OnStart OnStop callbacks are missing in vdjPlugin8.h I use ... maybe outdated ?

maybe something to do with "OnParameter" but seems only for custom parameters
 

Inviato Sat 23 Feb 19 @ 6:15 am
locoDogPRO InfinityModeratorMember since 2013
not get_plugindeck, just get_deck

also onStart, onStop are in vdjDSP8.h
 

Inviato Sat 23 Feb 19 @ 6:21 am
2) for windows - GetModuleFilename
https://docs.microsoft.com/en-us/windows/desktop/api/libloaderapi/nf-libloaderapi-getmodulefilenamea

onStart, OnStop also in vdjVideo8.h

to get the deck you are on:

double query;
int deck = -1;
hr = GetInfo ("get_deck 'master' ? true : false",&query);
if (hr == S_OK && query)
....deck = 0 ; // your on master
else if (GetInfo ("get_deck",&query) == S_OK )
....deck = (int)query;


get_deck 'master' without conditional does not work.

There used to be a lot of pitfalls with the above if running as a visualization and not sure if it is fixed or not.
 

Inviato Mon 25 Feb 19 @ 2:22 am
NicotuxHome userMember since 2014
I didn't know about this one "GetModuleFileNameA"
for the others .... well yes i saw this. Not in "vdjPlugin8.h" i.e. one of the ones in and out of the SDK, downloaded from VDJ wiki :(

Thanks
 

Inviato Mon 25 Feb 19 @ 2:54 am
It's really just GetModuleFilename....

It you are not using unicode it will map to GetModuleFilenameA

If you are using unicode it will map to GetModuleFilenameW

You can force either A or W versions anytime though. W is wide version.
 

Inviato Mon 25 Feb 19 @ 3:02 am
NicotuxHome userMember since 2014
I totally mess or forgotten all these functions
I do not code often at all for windows and even less using Visual Studio ....
I now remember why ^^

thanks again
 

Inviato Mon 25 Feb 19 @ 3:36 am
What system have you coded for?

When your writing a program, things don't just pop out from thin air. Does not matter about the language or OS...Some languages are easier but always with a catch. Since Windows and most operating software are written in C/C++, there is a tight linkage between that and programs written in C. With other languages like Delphi, Basic,...I can't think of any that have direct linkage to the entire Windows OS, so you may be able to do some things easier, if you don't mind them being a pain in the ass when there is no direct link to some Window function you might want to use. So with languages like those, you get some things and lose some things.

You can also use Clang and GCC. Maybe Eclipse for dev environment.. VS works for me although some of the versions got ridiculous... not sure about the latest.
 

Inviato Mon 25 Feb 19 @ 4:25 am
AdionPRO InfinityCTOMember since 2006
Strange that get_plugindeck didn't work for you.
Just tried and it correctly returns 0 when the effect is loaded on master for me.
 

Inviato Mon 25 Feb 19 @ 5:05 am
NicotuxHome userMember since 2014
Due to my age - old nerd?... Mostly Unix-es oriented and system
I always had problems with all these IDE and better use notepad and command line :/ even now I go 10 times faster typing but moving the mouse to find where/how...
and a bash script better than 1 hour of find & replace or batch modify. Not the same times, old school
No problem using some kind of language of C C/C++ Delphi and other ... and I like when I have to create direct linkage to OS.
GCC on windows i never tested, but I tryed purepascal - WITHOUT Lazarus - in delphi mode

@Adion

I used all the night within VDJartnet... :

char pathC[256];
GetStringInfo("get_vdj_folder", pathC, 256);
std::string path(pathC);
GetStringInfo("get_plugindeck", pathC, 256);
std::string deck(pathC);
#if (defined(VDJ_WIN))
#ifndef VDJ_IS_WIN64
path += std::string("\\Plugins\\AutoStart\\");
#else
path += std::string("\\Plugins64\\AutoStart\\");
path += ".conf";
#endif
#elif (defined(VDJ_MAC))
path += std::string("/Plugins64/AutoStart/");
#endif
std::string myconfigfile("VDJartnet_" + deck + ".conf");

gives me ....VDJartnet_1.conf or ....VDJartnet_2.conf depending on the one selected deck at moment the plugin is loaded... Have to see
 

Inviato Mon 25 Feb 19 @ 5:46 am
NicotuxHome userMember since 2014
oups sorry for mac users :\ will fix it now
 

Inviato Mon 25 Feb 19 @ 5:51 am
AdionPRO InfinityCTOMember since 2006
to use get_plugindeck, you should query it as a number:
double result;
GetInfo("get_plugindeck", &result);
 

Inviato Mon 25 Feb 19 @ 6:30 am
NicotuxHome userMember since 2014
That's working well
tested : -2 for mic -1 sampler 0 for Master Ok 1..6 ok

strange however 'GetStringInfo("get_plugindeck & param_cast text")' gives "1" "2"... "6" ... as well as 'GetStringInfo("get_plugindeck")'


thanks
 

Inviato Mon 25 Feb 19 @ 7:26 am
get_plugindeck works and without the nuances of get_deck. When was get_plugindeck added? Not listed in wiki.

Besides working better than get_deck, is there a difference?
 

Inviato Wed 27 Feb 19 @ 2:52 am
NicotuxHome userMember since 2014
Well, the plugin finally works by itself.... in the way VDJ API allows it ...

But the Standard interface to VDJ...^^

I really can't get this API work

- No way to know the status at startup
- Whatever the type the plugin is ... onStart() onStop() - when they exist - and destructor won't be call
- No way to use skin button to activate / desactivate the plugin, as well as custom buttons only activate the skin button, no info go to the plugin
- Standard interface buttons can't sync with skin ones these one go to the plugin but for which instance - we may only know a deck, possibly not the right one?... i even tried a thread asking for status that somehow works, but impossible to modify the status of standard interface button
- Even a simple standard button doing nothing does not reflect its own status
- Slot number the plugin is loaded can't be known
- DeclareParameterCommand() ok but command ID never issue to onParameter() / onStringParameter()
- Release() by default crashes VDJ by deleting the running plugin when it only loose its visibility on the skin abd goes background
- and finally no way to know when the plugin have to shut down thus threads goes on running when instance of IVdjPlugin8 does not exist anymore resulting in access violation i.e. calling GetInfo() . Of course i cautch this one... but it's not a way

- by the way calling SendCommand() from a vdjdsp8 plugin crashes access violation reading the callback function where the same class works fine as base plugin or video plugin

I promise I really use the VDJ SDK from the wiki... outdated 2013/2016, not RekordBox one !!
Is VDJ2018 compatible with it anymore or does it just need some true good and working documentation

Any plugin I got the sources experiment exactly the same problems, including the examples from the Wiki

and while debugging this plugin, i get the same spurious access violation from other plugins or dx3d9, which of course catch it either as I do

Please would it be possible you provide an example of base plugin with only 1 simple functional button/switch in the standard plugin config window which lights on/off when skin activate the plugin simply using this SDK or an up to date one ? I don't ever want it to do the same for each deck the plugin is activated on, not lightening all at the same time... no plugin/effect do

 

Inviato Sat 09 Mar 19 @ 11:30 pm
All of those things work but there are some things to be aware of. Maybe your samples are using VDJ 7 GUIDs ?

Post your code for DllGetClassObject, OnLoad, OnDeviceInit, OnStart

There is not slot number you can make use of... all the same instance as the deck.

You will need to deal with multiple instances. OnLoad / Release called multiple times depending on deck.

Skin interface and / or Custom interface ?

When Release is called, one instance is being destroyed.
 

Inviato Mon 11 Mar 19 @ 2:10 am
NicotuxHome userMember since 2014
"Maybe your samples are using VDJ 7 GUIDs ?"
No samples from the wiki, Spout sender & Spout Receiver all are using V8 outdated 2013-2016

"All of those things work but there are some things to be aware of."
I took an internal plugin as examle as well a
... https://pasteboard.co/I4ZAE33.png
... https://pasteboard.co/I4ZBr9v.png
... https://pasteboard.co/I4ZBUq5.png
Sorry but id seems there are rea many things to be aware of.... the main one is NONE Work even being aware of many thing is not enough

"Post your code for DllGetClassObject, OnLoad, OnDeviceInit, OnStart"
https://pastebin.com/nEEUGBfx

There is not slot number you can make use of... all the same instance as the deck.

You will need to deal with multiple instances. OnLoad / Release called multiple times depending on deck.

Skin interface and / or Custom interface ?

When Release is called, one instance is being destroyed.
 

Inviato Mon 11 Mar 19 @ 11:31 pm
91%