Connexion rapide:  

Forum: VirtualDJ Plugins

Sujet Access to the clock

Ce topic est ancien et peut contenir des informations obselètes ou incorrectes.

djcelPRO InfinityModeratorMember since 2004
Is it possible to have access to the clock that we can see on skins? (=fullhour)

Or is it possible to have access to the clock of Windows? (...adding new functions for windows in .h)

Endeed I would like to get the time so as to use it in plugins: something like GetParam...
 

Posté Mon 22 Nov 04 @ 12:14 pm
djcelPRO InfinityModeratorMember since 2004
I think we can use:

#include time.h

in the header of the cpp file

with symbols superior and inferior (they don't appear on the forum)
 

Posté Mon 22 Nov 04 @ 8:49 pm
djcelPRO InfinityModeratorMember since 2004
I have created a kind of wake up for VDJ but it freezes Vdj to work.

If someone knows about time program using the library time.h, reply here
(It's not only concerning program for vdj but general C, C++ programs. I mean you don't need to know how to develop plugin for vdj but only know using time.h)
 

Posté Wed 24 Nov 04 @ 2:35 am
djcelPRO InfinityModeratorMember since 2004
Here is my function:

////////////////////

#include time.h>

void wait ( int seconds )
{
clock_t endwait;
endwait = clock () + seconds * CLK_TCK ;
while (clock() < endwait) {}
}

/////////////////
For example: wait(1); equals to 1 second

The problem is that the loop while freezes VDJ. Do you have any ideas to solve that problem?
 

Posté Wed 24 Nov 04 @ 3:02 am
djcelPRO InfinityModeratorMember since 2004
Can we do multithreading with VDJ?
I mean one thread for excutions in VDJ and another thread for my function wait()
 

Posté Wed 24 Nov 04 @ 3:23 am
claxPRO InfinityMember since 2004
djcel;

I think (not sure) that you can't use clock functions in a VDJ plugin because VDJ gets samples and treat them with the plugin before playing them. (Sorry for my english)
 

Posté Wed 24 Nov 04 @ 5:06 am
djcelPRO InfinityModeratorMember since 2004
My idea is to create a new thread (an event) where I put my loop linked to the Windows time.

I have understood multithreading this night (i'm happy to have discovered that because it was very interesting :-) enough for not sleeping) and I have included this code in my plugin. However vdj always freezes but finaly execute the program like without multithreading.

 

Posté Wed 24 Nov 04 @ 5:32 am
djcel: you should NOT use a while() loop to wait out some time... this is EXTREMELY cpu intensive... I know (in C#... I'm pretty sure there is one in C++ too) there is a function to put the thread to sleep for some time, which does not use much CPU at all (thus, no freezing).

I've never done multithreading in C++ though, only in C#... Good luck ;)

macourteau
 

Posté Thu 25 Nov 04 @ 1:17 pm
djcelPRO InfinityModeratorMember since 2004
Do you talk about the function sleep(int) ?

Great idea for the moment but it's not enough for my project
 

Posté Fri 26 Nov 04 @ 1:21 am
I don't know, you should try... I don't really have time now to test this, sorry :(

macourteau
 

Posté Fri 26 Nov 04 @ 12:38 pm
djcelPRO InfinityModeratorMember since 2004
I need some help for a new plugin Wake Up:

* define 2 hours with date: one to start and the other one to stop
* when the first one is reached, automix starts + option to broadcast on the web
(vdj has to stay open of course to use the plugin ;-) )
* when the second one is reached, sound is stopped + option to close vdj

I'm calling all developers even new ones !! I can help you to adapt a wake up on VDJ if you know how to create a wake up without freezing
 

Posté Sun 09 Jan 05 @ 5:18 pm


(Les anciens sujets et forums sont automatiquement fermés)