Hi,
was ist zu tun, damit das OSD solange angezeigt wird, bis der Nutzer es abstellt? Momentan wird es nach ~120 sek. automagisch abgeschaltet, der OSD-Thread läuft aber laut DEBUG-Messages weiter...?!?
Hier der Code:
Code
class CPUosd: public cOsdObject, public cThread, public cStatus
{
private:
cOsd *osd;
static CPUosd *pInstance;
[...]
protected:
CPUosd();
CPUosd(const CPUosd&);
CPUosd& operator= (const CPUosd&);
public:
static CPUosd *Instance(cCPUUsageFetcher *pFetcher);
~CPUosd(void);
virtual void Action();
virtual void Show(void);
virtual eOSState ProcessKey(eKeys Key);
};
void CPUosd::Show(void)
{
osd = cOsdProvider::NewOsd(50,50);
if (osd)
{
tArea Areas[] = {
{0, 0, 199, 199, 4},
{0, 200, 199, 399, 4},
{200, 0, 399, 199, 4},
{200, 200, 399, 399, 4}
};
osd->CanHandleAreas(Areas,sizeof(Areas) / sizeof(tArea));
osd->SetAreas(Areas,sizeof(Areas) / sizeof(tArea));
Start();
displaying =true;
}
else
esyslog("ERROR: CPUosd::Show(): something is wrong, OSD not opened -> check cpuosd.c\n");
};
void CPUosd::Action()
{
// reset the osd area
osd->DrawRectangle(0, 0, 399, 399, clrTransparent);
// draw a plugin title
osd->DrawText(32, 2, tr("CPU Utilisation"), clrBlack, clrTransparent, font, 300, 50);
osd->DrawText(30, 0, tr("CPU Utilisation"), clrYellow, clrTransparent, font, 300, 50);
// perform a display loop
while(displaying && Running())
{
Reset();
drawBoard();
show_functions();
if(Legend)
{
deleteLegend();
drawLegend();
}
else
deleteLegend();
osd->Flush();
usleep(UPD_INTERVAL);
}
};
[...]
Alles anzeigen