IXix wrote:How about something like this?
Code: Select all
Work()
{
doneWork = true;
}
Tick()
{
if(doneWork == true)
{
doneWork = false;
/* set a timer here, only needs to be short */
}
}
OnTimerExpired()
{
/* reset display */
}
i think i tried something like this, but the threading got in the way iirc. since i need to read doneWork in HandleGUIMessage. The meter started to flicker..
this is what i did:
Code: Select all
bool miex::HandleGUIMessage(CMachineDataOutput *pout, CMachineDataInput *pin)
{
int request;
pin->Read(request);
switch(request)
{
case 0:
{
if (pmi->UpdateGUI == true)
{
for (dword t = 0; t < pmi->NumTracks; t++)
{
float *sw = pmi->Get_GUI_Values(t);
pout->Write((double)*sw); sw++;
pout->Write((double)*sw); sw++;
pout->Write((double)*sw); sw++;
pout->Write((double)*sw); sw++;
pout->Write((double)*sw); sw++;
pout->Write((double)*sw); sw++;
}
pmi->UpdateGUI = false;
return true;
}
else
{
//this causes flickering on the i7
//pout->Write(0.0);
//pout->Write(0.0);
//pout->Write(0.0);
//pout->Write(0.0);
//pout->Write(0.0);
//pout->Write(0.0);
//pmi->UpdateGUI = false;
//return true;
}
}
}
return false;
};
void MultiWork(float const * const *inputs, float **outputs, int numsamples)
{
....do stuff...
UpdateGUI = true;
}
this isn't logically sound, as the flickering comes from handleguimessage beeing called before another work() is done, any ideas how to solve ?