Conectar :       Password :       Recuerdame

Forum: Virtual DJ Plugins - Topic: How to write a CUEing plugin

Post here comments on the Virtual DJ Plugins (Audio effects, Video effects, Video transitions, Devices mapper, Tools, ...).
We remind that plugins are downloadable by registered PRO users only.
VirtualDJ Foros
Virtual DJ Plugins
How to write a...


Autor - Tema: How to write a CUEing plugin -

nzdj

Limited edition user
Mensajes Thu 04 Sep 08 @ 5:23 am
I've gone through the examples and header files but I'm still a bit lost on this

what I want to do is to make VirtualDJ interact with a DMX control appication, I've got the control part figured out, but my problem is where to start with writing the plugin for VirtualDJ

what I need is a function that is continuously called and checks for the song position which would be compared against a file with cue points for DMX effects

Which type of plugins would that fit under (e.g. sound, video, device)? and how do I go about only getting the song position?

I tried modifying the supplied brake plugin but it seems to ruin the samples, I don't want to pass any samples back I only need to read the song position and figure out which deck the slider is leaning towards so I can feed the cue list off the song playing there

any help or examples would be greatly appreciated

cheers

Sam

nzdj

Limited edition user
Mensajes Fri 05 Sep 08 @ 6:39 am
Thanks heaps for your replies I really appreciate it

I was inclined towards the 100ms option as well since I'm not too confident of my multi-threading skills :)

but are you referring to the onTimer() function in the PluginDevice class? or just a CALLBACK windows timer?

the problem is if I make the plugin inherit the Dsp2 class then it expects me to recalculate the samples otherwise it kills the audio

if I try multiple inheritance of both the dsp and the device class then it gets slightly upset with double declaration of certain things

any ideas?

Thanks again

Sam

SBDJ

VIP Member
Mensajes Fri 05 Sep 08 @ 9:15 am
Yes, use a callback timer. Don't try and declare two classes, just use the dsp class.

If you don't do anything to the buffer, then it shouldn't affect the audio.

I've just created a blank DSP project, run it, and sound was unaffected without my doing any processing...

Regards,

Scott

nzdj

Limited edition user
Mensajes Fri 05 Sep 08 @ 7:22 pm
Thanks for the info SBDJ

I found an example of CALLBACK timers posted on the forums which I've copied below, I almost got it to work but it fires only once

I declared the function outside the plugin class and I put the constructor in onLoad and the destructor in onRelease

is that correct?

* a Timer:

// Declaration
void CALLBACK TimerProc(HWND, UINT, UINT, DWORD);
UINT uTimer;
DWORD speed; // (in ms)

// Constructor
uTimer = (UINT) SetTimer(NULL, NULL, speed, (TIMERPROC)TimerProc);

// Desctructor
KillTimer(NULL, uTimer);

// Your function
void CALLBACK TimerProc(HWND, UINT, UINT, DWORD)
{
// write here to do each 'speed' ms
}

nzdj

Limited edition user
Mensajes Fri 05 Sep 08 @ 7:25 pm
ok correction now I got it to work thanks for all your help

is the structure I mentioned in my last message still correct though?

and also another problem, if I declare the CALLBACK function outside the class then I can't use the plugin functions such as GetInfo ??

nzdj

Limited edition user
Mensajes Fri 05 Sep 08 @ 10:32 pm
update: I tried writing a wrapper function for timerproc and it worked :) thanks again for your help

djcel

Senior Team
Mensajes Sun 07 Sep 08 @ 12:28 pm
You can also add the word "static" for the CALLBACK.


For example, here is a solution to include Dialog CALLBACK in a class:


class CDialog
{
public:
VOID Create();

private:
HWND hMainDlg;
static BOOL CALLBACK DialogProcStatic(HWND, UINT, WPARAM, LPARAM);
virtual BOOL DialogProc(HWND, UINT, WPARAM, LPARAM);
};

//----------------------------------------------------------------------------------------
VOID CDialog::Create()
{
hMainDlg = CreateDialogParam(hInstance, MAKEINTRESOURCE(IDD_DIALOG1), hWndParent, DialogProcStatic, (LPARAM)this);
}
//----------------------------------------------------------------------------------------
BOOL CALLBACK CDialog::DialogProcStatic(HWND hDlg,UINT message,WPARAM wParam,LPARAM lParam)
{
if (message == WM_INITDIALOG)
{
SetWindowLongPtr(hDlg, GWL_USERDATA, (LONG) lParam);
}

LPARAM pThis = GetWindowLongPtr(hDlg, GWL_USERDATA);
if (!pThis) return FALSE;

return (((CDialog*)pThis)->DialogProc(hDlg, message, wParam, lParam));
}
//----------------------------------------------------------------------------------------
BOOL CDialog::DialogProc(HWND hDlg,UINT message,WPARAM wParam,LPARAM lParam)
{
switch(message)
{
case WM_INITDIALOG:
break;

default:
return FALSE;
}
return TRUE;
}



Site map
(C)opyright Atomix Productions 2009

Programas
Hardware
VirtualDJ Pro
VirtualVinyl
Numark CUE
AtomixMP3
VDJ HomeEdition
DJC Edition
eJay DJMixStation
DJ-Box
Características
Pantallas
Versión de prueba
Plugins
Actualizaciones de Software
Material para la prensa
SDK para Desarrolladores
CD de Código de Tiempo
Skins (Pieles)
Efectos de Sonido
Efectos de Video
Samples
Idiomas
Grafx
Herramientas y Controladores
Foros
Usuarios en red
Wiki
Radio
Atomix Productions
DJs VIP
Condiciones de Uso
Haga una Pregunta
Vea sus tickets
Wiki