Hey RJ Thanks for quick response :-)
> but in general, could you clarify why you need to know whether or not the > engine has sync'd yet? English is not my native language, please bear with me. Every time engine syncs, it uses the last set value of scratch2 . Suppose I set a value X using scratch2. After some delay I need to set new value Y. Now, the time difference between setting these two values I want engine to sync just once, ie sync() call should be made just once. If sync() call is made more than once (say Z times), my engine has unwanted lead of (Z-1)*X. If sync() call is made not at all (yes, even this happens sometimes), this means last set value (X) has been ignored (or missed) by engine and it uses latest set value Y. To overcome multiple (or none) sync() calls, I wanted my code to see if engine is yet sync'd. If yes, set new value. If not, hold on till engine is sync'd and keep accumulating the values. Does this make any sense at all? >You add or subtract from the value of controls like wheel or scratch2, then >the engine processes them and resets them to 0 once >it has processed them. If I am getting it correctly then, this means that between 2 sync() calls if I set values X, Y, Z (via scratch2) at different instants then engine would process (X+Y+Z), and the reset scratch2 to 0, right? umm, I am afraid, my conclusions doesn't exactly suggest the same. (I cant say about other COs, but this is what happens to scratch2) 1. scratch2 is not reset by engine, when scratch2 is disabled engine simply stops using it. 2. between 2 sync() calls if I set values X, Y, Z (in order) at different instants then engine would process latest set value (Z). 3. If I set X via scratch2 then engine will continue using it in each sync(), unless a new value is set or scratch2 is disabled. This is what I learnt by doing experiments, I may be wrong. Would you like to see how I came to above conclusion? > The way you're going about it (creating a thread) is probably not the best > way to know when the engine has processed data. If >you use the controls like accumulators, then you can listen to valueChanged >signals from the engine and look for when the value >is cleared. You can use that to trigger any logic you'd like in the waveform >widgets. Even I was wondering if I am making too many assumptions. Thanks for pointer. I will change my code to use valueChanged signal from engine rather than starting a new thread :-) Btw, I have a good news, there is considerable improvement in one-on-one motion by doing some tweaks in my thread approach. I am working on code that will use signals form engine rather than a new thread to monitor scratch2 syncs. Thanks for help :-) shanx ------------------------------------------------------------------------------ Create and publish websites with WebMatrix Use the most popular FREE web apps or write code yourself; WebMatrix provides all the features you need to develop and publish your website. http://p.sf.net/sfu/ms-webmatrix-sf _______________________________________________ Mixxx-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mixxx-devel
