summaryrefslogtreecommitdiff
path: root/state.c
diff options
context:
space:
mode:
authormrwastl <mrwastl@users.sourceforge.net>2011-09-17 21:28:10 +0200
committermrwastl <mrwastl@users.sourceforge.net>2011-09-17 21:28:10 +0200
commit0703b948dd63eb281df5dc531abdf66818becdf7 (patch)
treeb76b3ba4634a95ed71c0dd2ab1e1a4354109870d /state.c
parent9e0f177243221e2123758d196315cb63d0f8902b (diff)
downloadvdr-plugin-graphlcd-0703b948dd63eb281df5dc531abdf66818becdf7.tar.gz
vdr-plugin-graphlcd-0703b948dd63eb281df5dc531abdf66818becdf7.tar.bz2
cExtData is now a singleton class, thus its content survives a DISCONN/CONNECT of a display; trans() now works as expected; three new tokens: 'IsMenuList', 'MenuText', 'MenuTextScroll'; support added for ':clean' and ':rest' for tokens 'MenuTitle', 'MenuCurrent', and 'MenuText'
Diffstat (limited to 'state.c')
-rw-r--r--state.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/state.c b/state.c
index ba52f3a..b2adb37 100644
--- a/state.c
+++ b/state.c
@@ -73,6 +73,8 @@ cGraphLCDState::cGraphLCDState(cGraphLCDDisplay * Display)
mOsd.message = "";
mOsd.textItem = "";
mOsd.currentItemIndex = -1;
+ mOsd.currentTextItemScroll = 0;
+ mOsd.currentTextItemScrollReset = false;
mVolume.value = -1;
mVolume.lastChange = 0;
@@ -364,6 +366,11 @@ void cGraphLCDState::Tick()
{
mutex.Lock();
+ if (mOsd.currentTextItemScrollReset) { // mOsd.currentTextItemScroll has been read since last update? -> reset to 0
+ mOsd.currentTextItemScroll = 0;
+ mOsd.currentTextItemScrollReset = false;
+ }
+
tickUsed = true;
if (mReplay.control)
@@ -400,6 +407,8 @@ void cGraphLCDState::OsdClear()
mOsd.blueButton = "";
mOsd.message = "";
mOsd.textItem = "";
+ mOsd.currentTextItemScroll = 0;
+ mOsd.currentTextItemScrollReset = false;
mutex.Unlock();
mDisplay->SetMenuClear();
@@ -556,9 +565,14 @@ void cGraphLCDState::OsdTextItem(const char * Text, bool Scroll)
if (GraphLCDSetup.PluginActive)
{
mutex.Lock();
+
if (Text)
{
mOsd.textItem = trim(Text);
+ mOsd.currentTextItemScroll = 0;
+ mOsd.currentTextItemScrollReset = false;
+ } else {
+ mOsd.currentTextItemScroll += (Scroll) ? -1 : 1;
}
mutex.Unlock();
//mDisplay->SetOsdTextItem(Text, Scroll);
@@ -863,6 +877,10 @@ tOsdState cGraphLCDState::GetOsdState()
return ret;
}
+void cGraphLCDState::ResetOsdStateScroll() {
+ mOsd.currentTextItemScrollReset = true;
+}
+
tVolumeState cGraphLCDState::GetVolumeState()
{
tVolumeState ret;