Files ยป vdr_graphlcd_rev278_dimming_support.patch
vdr-graphlcd-pre-0.2.0-skinning-branch_rev278wa/display.c 2009-06-30 00:51:57.000000000 +0200 | ||
---|---|---|
mLastState = StateNormal;
|
||
mShowVolume = false;
|
||
nCurrentBrightness = -1;
|
||
LastTimeBrightness = 0;
|
||
bBrightnessActive = true;
|
||
}
|
||
cGraphLCDDisplay::~cGraphLCDDisplay()
|
||
... | ... | |
mUpdate = true;
|
||
}
|
||
// update display if BrightnessDelay is exceeded
|
||
if ((nCurrentBrightness == GraphLCDSetup.BrightnessActive) &&
|
||
((cTimeMs::Now() - LastTimeBrightness) > (uint64_t) (GraphLCDSetup.BrightnessDelay*1000)))
|
||
{
|
||
mUpdate = true;
|
||
}
|
||
if (mUpdate)
|
||
{
|
||
mUpdateAt = 0;
|
||
... | ... | |
mLcd->SetScreen(mScreen->Data(), mScreen->Width(), mScreen->Height(), mScreen->LineSize());
|
||
mLcd->Refresh(false);
|
||
mLastTimeMs = currTimeMs;
|
||
SetBrightness();
|
||
}
|
||
else
|
||
{
|
||
... | ... | |
}
|
||
UpdateIn(100);
|
||
}
|
||
void cGraphLCDDisplay::SetBrightness()
|
||
{
|
||
//mutex.Lock();
|
||
bool bActive = bBrightnessActive
|
||
|| (mState != StateNormal)
|
||
|| (GraphLCDSetup.ShowVolume && mShowVolume)
|
||
|| (GraphLCDSetup.ShowMessages && mGraphLCDState->ShowMessage())
|
||
|| (GraphLCDSetup.BrightnessDelay == 900);
|
||
if (bActive)
|
||
{
|
||
LastTimeBrightness = cTimeMs::Now();
|
||
bBrightnessActive = false;
|
||
}
|
||
if ((bActive ? GraphLCDSetup.BrightnessActive : GraphLCDSetup.BrightnessIdle) != nCurrentBrightness)
|
||
{
|
||
if (bActive)
|
||
{
|
||
mLcd->SetBrightness(GraphLCDSetup.BrightnessActive);
|
||
nCurrentBrightness = GraphLCDSetup.BrightnessActive;
|
||
}
|
||
else
|
||
{
|
||
if (GraphLCDSetup.BrightnessDelay < 1
|
||
|| ((cTimeMs::Now() - LastTimeBrightness) > (uint64_t) (GraphLCDSetup.BrightnessDelay*1000)))
|
||
{
|
||
mLcd->SetBrightness(GraphLCDSetup.BrightnessIdle);
|
||
nCurrentBrightness = GraphLCDSetup.BrightnessIdle;
|
||
}
|
||
}
|
||
}
|
||
//mutex.Unlock();
|
||
}
|
||
void cGraphLCDDisplay::ForceUpdateBrightness() {
|
||
bBrightnessActive = true;
|
||
SetBrightness();
|
||
}
|
vdr-graphlcd-pre-0.2.0-skinning-branch_rev278wa/display.h 2009-06-30 00:51:58.000000000 +0200 | ||
---|---|---|
void SetMenuCurrent();
|
||
const GLCD::cBitmap * GetScreen() const { return mScreen; }
|
||
void ForceUpdateBrightness();
|
||
protected:
|
||
virtual void Action();
|
||
... | ... | |
bool mShowVolume;
|
||
void UpdateIn(uint64_t msec);
|
||
/** set brightness depending on user activity */
|
||
void SetBrightness();
|
||
uint64_t LastTimeBrightness;
|
||
int nCurrentBrightness;
|
||
bool bBrightnessActive;
|
||
};
|
||
#endif
|
vdr-graphlcd-pre-0.2.0-skinning-branch_rev278wa/state.c 2009-06-30 00:52:07.000000000 +0200 | ||
---|---|---|
//printf("graphlcd plugin: cGraphLCDState::OsdChannel %s\n", Text);
|
||
if (GraphLCDSetup.PluginActive)
|
||
{
|
||
mDisplay->ForceUpdateBrightness();
|
||
if (Text)
|
||
mDisplay->Update();
|
||
}
|
||
|