diff options
36 files changed, 633 insertions, 39 deletions
@@ -1,8 +1 @@ -- add missing objects like textbox, scrollbar -- add dynamic behaviour to objects like scrolling and blinking -- add special objects for external data so that other plugins can draw text and bitmaps on an area of the display that will be defined in the skin. This could be used p.e. for a spectrum analyzer or displaying id3 tags. -- add service interface for external data objects -- make skin variables more dynamic, p.e. evaluate positions while displaying, not only during skin loading. This should make it easier to support several display sizes with one skin. -- DOCUMENTATION, DOCUMENTATION, DOCUMENTATION -- fix all the small bugs that were introduced -- all the stuff I forgot :-) +for skin-related TODOs: see TODO in graphlcd-base @@ -7,8 +7,8 @@ * to the COPYING file distributed with this package. * * (c) 2001-2004 Carsten Siebholz <c.siebholz AT t-online.de> - * (c) 2004 Andreas Regel <andreas.regel AT powarman.de> - * (c) 2010 Wolfgang Astleitner <mrwastl AT users sourceforge net> + * (c) 2004-2010 Andreas Regel <andreas.regel AT powarman.de> + * (c) 2010-2011 Wolfgang Astleitner <mrwastl AT users sourceforge net> */ #include <stdlib.h> @@ -29,6 +29,8 @@ #include <vdr/tools.h> #include <vdr/menu.h> +#include <vdr/remote.h> + cGraphLCDDisplay::cGraphLCDDisplay() : cThread("glcd_display"), mLcd(NULL), @@ -43,6 +45,9 @@ cGraphLCDDisplay::cGraphLCDDisplay() mState = StateNormal; mLastState = StateNormal; + + mDisplayMode = DisplayModeNormal; + LastTimeDisplayMode = 0; mShowVolume = false; @@ -119,7 +124,8 @@ void cGraphLCDDisplay::Action(void) } skinFileName = mSkinConfig->SkinPath() + "/" + mSkinConfig->SkinName() + ".skin"; - mSkin = GLCD::XmlParse(*mSkinConfig, mSkinConfig->SkinName(), skinFileName); + std::string errorString = ""; + mSkin = GLCD::XmlParse(*mSkinConfig, mSkinConfig->SkinName(), skinFileName, errorString); if (!mSkin) { int skipx = mLcd->Width() >> 3; @@ -127,13 +133,42 @@ void cGraphLCDDisplay::Action(void) esyslog("graphlcd plugin: ERROR loading skin\n"); - // draw an 'X' to inform the user that there was a problem with loading the skin - // (better than just leaving an empty screen ...) mLcd->Clear(); + // clear the screen with a filled rectangle using a defined colour to guarantee visible text or 'X' +#ifdef GRAPHLCD_CBITMAP_ARGB + mScreen->DrawRectangle(0, 0, mLcd->Width()-1, mLcd->Height()-1, GLCD::cColor::Black, true); +#else mScreen->DrawRectangle(0, 0, mLcd->Width()-1, mLcd->Height()-1, GLCD::clrBlack, true); - mScreen->DrawLine(skipx, skipy, mLcd->Width()-1-skipx, mLcd->Height()-1-skipy, GLCD::clrWhite); - mScreen->DrawLine(mLcd->Width()-1-skipx, skipy, skipx, mLcd->Height()-1-skipy, GLCD::clrWhite); +#endif + + GLCD::cFont * font = new GLCD::cFont(); + if ( font->LoadFNT( mSkinConfig->FontPath() + "/" + "f8n.fnt") ) { + std::vector <std::string> lines; + font->WrapText(mLcd->Width()-10, mLcd->Height()-1, errorString, lines); + int lh = font->LineHeight(); + for (size_t i = 0; i < lines.size(); i++) { +#ifdef GRAPHLCD_CBITMAP_ARGB + mScreen->DrawText(3, 1+i*lh, mLcd->Width()-1, lines[i], font, GLCD::cColor::White); +#else + mScreen->DrawText(3, 1+i*lh, mLcd->Width()-1, lines[i], font, GLCD::clrWhite); +#endif + } + } else { + // draw an 'X' to inform the user that there was a problem with loading the skin + // (better than just leaving an empty screen ...) +#ifdef GRAPHLCD_CBITMAP_ARGB + mScreen->DrawLine(skipx, skipy, mLcd->Width()-1-skipx, mLcd->Height()-1-skipy, GLCD::cColor::White); + mScreen->DrawLine(mLcd->Width()-1-skipx, skipy, skipx, mLcd->Height()-1-skipy, GLCD::cColor::White); +#else + mScreen->DrawLine(skipx, skipy, mLcd->Width()-1-skipx, mLcd->Height()-1-skipy, GLCD::clrWhite); + mScreen->DrawLine(mLcd->Width()-1-skipx, skipy, skipx, mLcd->Height()-1-skipy, GLCD::clrWhite); +#endif + } +#ifdef GRAPHLCD_CBITMAP_ARGB + mLcd->SetScreen(mScreen->Data(), mScreen->Width(), mScreen->Height()); +#else mLcd->SetScreen(mScreen->Data(), mScreen->Width(), mScreen->Height(), mScreen->LineSize()); +#endif mLcd->Refresh(true); return; } @@ -143,11 +178,15 @@ void cGraphLCDDisplay::Action(void) mLcd->Refresh(true); mUpdate = true; + uint64_t lastEventMs = 0; +#define MIN_EVENT_DELAY 500 + while (Running()) { if (GraphLCDSetup.PluginActive) { uint64_t currTimeMs = cTimeMs::Now(); + GLCD::cSkinDisplay * display = NULL; if (mUpdateAt != 0) { @@ -185,27 +224,31 @@ void cGraphLCDDisplay::Action(void) } } - { - GLCD::cSkinDisplay * display = NULL; + /* display mode (normal or interactive): reset after 10 secs if not normal */ + if ( (mDisplayMode != DisplayModeNormal) && ( (uint32_t)(currTimeMs - LastTimeDisplayMode) > (uint32_t)(10000)) ) { + mDisplayMode = DisplayModeNormal; + LastTimeDisplayMode = currTimeMs; + mUpdate = true; + } + + if (mState == StateNormal) + display = mSkin->GetDisplay("normal"); + else if (mState == StateReplay) + display = mSkin->GetDisplay("replay"); + else if (mState == StateMenu) + display = mSkin->GetDisplay("menu"); + if (display && display->NeedsUpdate(currTimeMs ) ) + mUpdate = true; - if (mState == StateNormal) - display = mSkin->GetDisplay("normal"); - else if (mState == StateReplay) - display = mSkin->GetDisplay("replay"); - else if (mState == StateMenu) - display = mSkin->GetDisplay("menu"); - if (display && display->NeedsUpdate(currTimeMs ) ) - mUpdate = true; - } // update Display every minute - if (mState == StateNormal && currTimeMs/60000 != mLastTimeMs/60000) + if (mState == StateNormal && (currTimeMs/60000 != mLastTimeMs/60000)) { mUpdate = true; } // update Display every second in replay state - if (mState == StateReplay && currTimeMs/1000 != mLastTimeMs/1000) + if (mState == StateReplay && (currTimeMs/1000 != mLastTimeMs/1000)) { mUpdate = true; } @@ -219,7 +262,7 @@ void cGraphLCDDisplay::Action(void) // update display if BrightnessDelay is exceeded if (bActive && (nCurrentBrightness == GraphLCDSetup.BrightnessActive) && - ((int)((cTimeMs::Now() - LastTimeBrightness)) > (GraphLCDSetup.BrightnessDelay*1000))) + ((uint32_t)((cTimeMs::Now() - LastTimeBrightness)) > (uint32_t)(GraphLCDSetup.BrightnessDelay*1000))) { mUpdate = true; } @@ -232,6 +275,29 @@ void cGraphLCDDisplay::Action(void) } + // check event + GLCD::cGLCDEvent * ev = mSkin->Config().GetDriver()->GetEvent(); + if (ev && display && ((uint32_t)(currTimeMs-lastEventMs) > (uint32_t)(MIN_EVENT_DELAY) )) { + std::string rv = ""; + + if ( (rv = display->CheckAction(ev) ) != "") { + if (rv.substr(0,4) == "Key.") { + cRemote::Put(cKey::FromString(rv.substr(4).c_str()), true); + LastTimeDisplayMode = currTimeMs; /* if interactive mode: extend it */ + } else if (rv.substr(0,5) == "Mode.") { + if (rv.substr(5) == "Interactive") { + mDisplayMode = DisplayModeInteractive; + LastTimeDisplayMode = currTimeMs; + } else if (rv.substr(5) == "Normal") { + mDisplayMode = DisplayModeNormal; + LastTimeDisplayMode = currTimeMs; + } + mUpdate = true; + } + lastEventMs = currTimeMs; + } + } + if (mUpdate) { mUpdateAt = 0; @@ -239,7 +305,8 @@ void cGraphLCDDisplay::Action(void) mGraphLCDState->Update(); - mScreen->Clear(); + mScreen->Clear(mSkin->GetBackgroundColor()); + GLCD::cSkinDisplay * display = NULL; if (mState == StateNormal) @@ -262,13 +329,33 @@ void cGraphLCDDisplay::Action(void) if (display) display->Render(mScreen); } +#ifdef GRAPHLCD_CBITMAP_ARGB + mLcd->SetScreen(mScreen->Data(), mScreen->Width(), mScreen->Height()); +#else mLcd->SetScreen(mScreen->Data(), mScreen->Width(), mScreen->Height(), mScreen->LineSize()); +#endif mLcd->Refresh(false); mLastTimeMs = currTimeMs; SetBrightness(); + + // flush events + mSkin->Config().GetDriver()->GetEvent(); } else { +#if 0 + GLCD::cGLCDEvent * ev = mSkin->Config().GetDriver()->GetEvent(); + if (ev && display && ((uint32_t)(currTimeMs-lastEventMs) > (uint32_t)(MIN_EVENT_DELAY) )) { + std::string rv = ""; + + if ( (rv = display->CheckAction(ev) ) != "") { + if (rv.substr(0,4) == "Key.") { + cRemote::Put(cKey::FromString(rv.substr(4).c_str()), true); + } + lastEventMs = currTimeMs; + } + } +#endif cCondWait::SleepMs(100); } } @@ -381,7 +468,7 @@ void cGraphLCDDisplay::SetBrightness() else { if (GraphLCDSetup.BrightnessDelay < 1 - || ((int)(cTimeMs::Now() - LastTimeBrightness) > (GraphLCDSetup.BrightnessDelay*1000))) + || ((unsigned int)(cTimeMs::Now() - LastTimeBrightness) > (unsigned int)(GraphLCDSetup.BrightnessDelay*1000))) { mLcd->SetBrightness(GraphLCDSetup.BrightnessIdle); nCurrentBrightness = GraphLCDSetup.BrightnessIdle; @@ -7,8 +7,8 @@ * to the COPYING file distributed with this package. * * (c) 2001-2004 Carsten Siebholz <c.siebholz AT t-online.de> - * (c) 2004 Andreas Regel <andreas.regel AT powarman.de> - * (c) 2010 Wolfgang Astleitner <mrwastl AT users sourceforge net> + * (c) 2004-2010 Andreas Regel <andreas.regel AT powarman.de> + * (c) 2010-2011 Wolfgang Astleitner <mrwastl AT users sourceforge net> */ #ifndef _GRAPHLCD_DISPLAY_H_ @@ -40,6 +40,13 @@ enum eThreadState StateMenu }; +// state of current display mode (interesting for displays w/ touchpads) +enum eDisplayMode +{ + DisplayModeNormal, + DisplayModeInteractive +}; + // Display update Thread class cGraphLCDDisplay : public cThread { @@ -59,6 +66,10 @@ public: void ForceUpdateBrightness(); const cGraphLCDService * GetServiceObject() const { return mService; } + + GLCD::cDriver * GetDriver() const { return mLcd; } + + const eDisplayMode GetDisplayMode() const { return mDisplayMode; } protected: virtual void Action(); @@ -89,6 +100,9 @@ private: bool bBrightnessActive; /* external services */ cGraphLCDService * mService; + /* display mode (normal or interactive) */ + eDisplayMode mDisplayMode; + uint64_t LastTimeDisplayMode; }; #endif diff --git a/graphlcd/skins/touchcol/images/arrow.pbm b/graphlcd/skins/touchcol/images/arrow.pbm Binary files differnew file mode 100644 index 0000000..2ea2c0f --- /dev/null +++ b/graphlcd/skins/touchcol/images/arrow.pbm diff --git a/graphlcd/skins/touchcol/images/arrow_small.pbm b/graphlcd/skins/touchcol/images/arrow_small.pbm new file mode 100644 index 0000000..b02a42b --- /dev/null +++ b/graphlcd/skins/touchcol/images/arrow_small.pbm @@ -0,0 +1,4 @@ +P4 +# Created by Paint Shop Pro 5 +8 7 +
\ No newline at end of file diff --git a/graphlcd/skins/touchcol/images/message.pbm b/graphlcd/skins/touchcol/images/message.pbm Binary files differnew file mode 100644 index 0000000..a8ff675 --- /dev/null +++ b/graphlcd/skins/touchcol/images/message.pbm diff --git a/graphlcd/skins/touchcol/images/mute.pbm b/graphlcd/skins/touchcol/images/mute.pbm new file mode 100644 index 0000000..f19b0fa --- /dev/null +++ b/graphlcd/skins/touchcol/images/mute.pbm @@ -0,0 +1,4 @@ +P4 +# Created by Paint Shop Pro 5 +23 22 +`00
`a}Al88l}A@
`a00`
\ No newline at end of file diff --git a/graphlcd/skins/touchcol/symbols/dolby.pbm b/graphlcd/skins/touchcol/symbols/dolby.pbm new file mode 100644 index 0000000..7273c86 --- /dev/null +++ b/graphlcd/skins/touchcol/symbols/dolby.pbm @@ -0,0 +1,4 @@ +P4 +# Created by Paint Shop Pro 5 +15 11 +
\ No newline at end of file diff --git a/graphlcd/skins/touchcol/symbols/dolby_small.pbm b/graphlcd/skins/touchcol/symbols/dolby_small.pbm new file mode 100644 index 0000000..a4a72f9 --- /dev/null +++ b/graphlcd/skins/touchcol/symbols/dolby_small.pbm @@ -0,0 +1,4 @@ +P4 +# Created by Paint Shop Pro 5 +11 7 +???
\ No newline at end of file diff --git a/graphlcd/skins/touchcol/symbols/empty.pbm b/graphlcd/skins/touchcol/symbols/empty.pbm new file mode 100644 index 0000000..2fbee34 --- /dev/null +++ b/graphlcd/skins/touchcol/symbols/empty.pbm @@ -0,0 +1,4 @@ +P4 +# Created by Paint Shop Pro 5 +15 11 +
\ No newline at end of file diff --git a/graphlcd/skins/touchcol/symbols/empty_small.pbm b/graphlcd/skins/touchcol/symbols/empty_small.pbm new file mode 100644 index 0000000..fe8389b --- /dev/null +++ b/graphlcd/skins/touchcol/symbols/empty_small.pbm @@ -0,0 +1,4 @@ +P4 +# Created by Paint Shop Pro 5 +11 7 +???97
\ No newline at end of file diff --git a/graphlcd/skins/touchcol/symbols/multilanguage.pbm b/graphlcd/skins/touchcol/symbols/multilanguage.pbm new file mode 100644 index 0000000..0b6c317 --- /dev/null +++ b/graphlcd/skins/touchcol/symbols/multilanguage.pbm @@ -0,0 +1,4 @@ +P4 +# Created by Paint Shop Pro 5 +15 11 +rڢڜr
\ No newline at end of file diff --git a/graphlcd/skins/touchcol/symbols/multilanguage_small.pbm b/graphlcd/skins/touchcol/symbols/multilanguage_small.pbm new file mode 100644 index 0000000..3435bfd --- /dev/null +++ b/graphlcd/skins/touchcol/symbols/multilanguage_small.pbm @@ -0,0 +1,4 @@ +P4 +# Created by Paint Shop Pro 5 +11 7 +??
\ No newline at end of file diff --git a/graphlcd/skins/touchcol/symbols/mute.pbm b/graphlcd/skins/touchcol/symbols/mute.pbm new file mode 100644 index 0000000..d88a206 --- /dev/null +++ b/graphlcd/skins/touchcol/symbols/mute.pbm @@ -0,0 +1,4 @@ +P4 +# Created by Paint Shop Pro 5 +15 11 +v0
0v
\ No newline at end of file diff --git a/graphlcd/skins/touchcol/symbols/mute_small.pbm b/graphlcd/skins/touchcol/symbols/mute_small.pbm new file mode 100644 index 0000000..f86fc93 --- /dev/null +++ b/graphlcd/skins/touchcol/symbols/mute_small.pbm @@ -0,0 +1,4 @@ +P4 +# Created by Paint Shop Pro 5 +11 7 +G_)%)G_
\ No newline at end of file diff --git a/graphlcd/skins/touchcol/symbols/recording.pbm b/graphlcd/skins/touchcol/symbols/recording.pbm new file mode 100644 index 0000000..b13c220 --- /dev/null +++ b/graphlcd/skins/touchcol/symbols/recording.pbm @@ -0,0 +1,4 @@ +P4 +# Created by Paint Shop Pro 5 +15 11 +ff
\ No newline at end of file diff --git a/graphlcd/skins/touchcol/symbols/recording2.pbm b/graphlcd/skins/touchcol/symbols/recording2.pbm new file mode 100644 index 0000000..569dc17 --- /dev/null +++ b/graphlcd/skins/touchcol/symbols/recording2.pbm @@ -0,0 +1,4 @@ +P4 +# Created by Paint Shop Pro 5 +15 11 +n~
\ No newline at end of file diff --git a/graphlcd/skins/touchcol/symbols/recording2_small.pbm b/graphlcd/skins/touchcol/symbols/recording2_small.pbm new file mode 100644 index 0000000..b52adb7 --- /dev/null +++ b/graphlcd/skins/touchcol/symbols/recording2_small.pbm @@ -0,0 +1,4 @@ +P4 +# Created by Paint Shop Pro 5 +11 7 +?
\ No newline at end of file diff --git a/graphlcd/skins/touchcol/symbols/recording3.pbm b/graphlcd/skins/touchcol/symbols/recording3.pbm new file mode 100644 index 0000000..af1e5da --- /dev/null +++ b/graphlcd/skins/touchcol/symbols/recording3.pbm @@ -0,0 +1,4 @@ +P4 +# Created by Paint Shop Pro 5 +15 11 +nn
\ No newline at end of file diff --git a/graphlcd/skins/touchcol/symbols/recording3_small.pbm b/graphlcd/skins/touchcol/symbols/recording3_small.pbm new file mode 100644 index 0000000..1383772 --- /dev/null +++ b/graphlcd/skins/touchcol/symbols/recording3_small.pbm @@ -0,0 +1,4 @@ +P4 +# Created by Paint Shop Pro 5 +11 7 +
\ No newline at end of file diff --git a/graphlcd/skins/touchcol/symbols/recording4.pbm b/graphlcd/skins/touchcol/symbols/recording4.pbm new file mode 100644 index 0000000..cfc18b7 --- /dev/null +++ b/graphlcd/skins/touchcol/symbols/recording4.pbm @@ -0,0 +1,4 @@ +P4 +# Created by Paint Shop Pro 5 +15 11 +~^
\ No newline at end of file diff --git a/graphlcd/skins/touchcol/symbols/recording4_small.pbm b/graphlcd/skins/touchcol/symbols/recording4_small.pbm new file mode 100644 index 0000000..33300e6 --- /dev/null +++ b/graphlcd/skins/touchcol/symbols/recording4_small.pbm @@ -0,0 +1,4 @@ +P4 +# Created by Paint Shop Pro 5 +11 7 +?
\ No newline at end of file diff --git a/graphlcd/skins/touchcol/symbols/recording_small.pbm b/graphlcd/skins/touchcol/symbols/recording_small.pbm new file mode 100644 index 0000000..b378aae --- /dev/null +++ b/graphlcd/skins/touchcol/symbols/recording_small.pbm @@ -0,0 +1,4 @@ +P4 +# Created by Paint Shop Pro 5 +11 7 +??
\ No newline at end of file diff --git a/graphlcd/skins/touchcol/symbols/replay-fast-fwd.pbm b/graphlcd/skins/touchcol/symbols/replay-fast-fwd.pbm Binary files differnew file mode 100644 index 0000000..a5dfa47 --- /dev/null +++ b/graphlcd/skins/touchcol/symbols/replay-fast-fwd.pbm diff --git a/graphlcd/skins/touchcol/symbols/replay-fast-rwd.pbm b/graphlcd/skins/touchcol/symbols/replay-fast-rwd.pbm Binary files differnew file mode 100644 index 0000000..bccfb9c --- /dev/null +++ b/graphlcd/skins/touchcol/symbols/replay-fast-rwd.pbm diff --git a/graphlcd/skins/touchcol/symbols/replay-pause.pbm b/graphlcd/skins/touchcol/symbols/replay-pause.pbm Binary files differnew file mode 100644 index 0000000..5a45410 --- /dev/null +++ b/graphlcd/skins/touchcol/symbols/replay-pause.pbm diff --git a/graphlcd/skins/touchcol/symbols/replay-play.pbm b/graphlcd/skins/touchcol/symbols/replay-play.pbm Binary files differnew file mode 100644 index 0000000..9808fa2 --- /dev/null +++ b/graphlcd/skins/touchcol/symbols/replay-play.pbm diff --git a/graphlcd/skins/touchcol/symbols/replay-slow-fwd.pbm b/graphlcd/skins/touchcol/symbols/replay-slow-fwd.pbm Binary files differnew file mode 100644 index 0000000..5187921 --- /dev/null +++ b/graphlcd/skins/touchcol/symbols/replay-slow-fwd.pbm diff --git a/graphlcd/skins/touchcol/symbols/replay-slow-rwd.pbm b/graphlcd/skins/touchcol/symbols/replay-slow-rwd.pbm Binary files differnew file mode 100644 index 0000000..a069fa4 --- /dev/null +++ b/graphlcd/skins/touchcol/symbols/replay-slow-rwd.pbm diff --git a/graphlcd/skins/touchcol/symbols/scrambled.pbm b/graphlcd/skins/touchcol/symbols/scrambled.pbm new file mode 100644 index 0000000..50d6fd1 --- /dev/null +++ b/graphlcd/skins/touchcol/symbols/scrambled.pbm @@ -0,0 +1,4 @@ +P4 +# Created by Paint Shop Pro 5 +15 11 +rڿژr
\ No newline at end of file diff --git a/graphlcd/skins/touchcol/symbols/scrambled_small.pbm b/graphlcd/skins/touchcol/symbols/scrambled_small.pbm new file mode 100644 index 0000000..56c7af7 --- /dev/null +++ b/graphlcd/skins/touchcol/symbols/scrambled_small.pbm @@ -0,0 +1,4 @@ +P4 +# Created by Paint Shop Pro 5 +11 7 +??
\ No newline at end of file diff --git a/graphlcd/skins/touchcol/symbols/teletext.pbm b/graphlcd/skins/touchcol/symbols/teletext.pbm new file mode 100644 index 0000000..c1bfccd --- /dev/null +++ b/graphlcd/skins/touchcol/symbols/teletext.pbm @@ -0,0 +1,4 @@ +P4 +# Created by Paint Shop Pro 5 +15 11 +
\ No newline at end of file diff --git a/graphlcd/skins/touchcol/symbols/teletext_small.pbm b/graphlcd/skins/touchcol/symbols/teletext_small.pbm new file mode 100644 index 0000000..825ce98 --- /dev/null +++ b/graphlcd/skins/touchcol/symbols/teletext_small.pbm @@ -0,0 +1,4 @@ +P4 +# Created by Paint Shop Pro 5 +11 7 +???
\ No newline at end of file diff --git a/graphlcd/skins/touchcol/touchcol.skin b/graphlcd/skins/touchcol/touchcol.skin new file mode 100644 index 0000000..a6d7141 --- /dev/null +++ b/graphlcd/skins/touchcol/touchcol.skin @@ -0,0 +1,389 @@ +<?xml version="1.0"?> + +<skin version="1.1" name="touchcol" enable="touchscreen"> + + <font id="FontTimes" url="fnt:verdana-018.fnt"/> + <!--font id="FontTitle" url="fnt:verdana-022.fnt"/--> + <font id="FontTitle" url="ft2:VeraBd.ttf:24"/> + <font id="FontTitleSmall" url="ft2:VeraBd.ttf:18"/> + <!--font id="FontChannel" url="fnt:verdana-022.fnt"/--> + <!--font id="FontMenuButton" url="ft2:VeraBd.ttf:12" condition="#UseTouchscreen"/--> + <!--font id="FontMenuButton" url="ft2:DejaVuSans.ttf:9" condition="#UseTouchscreen"/--> + <!--font id="FontMenuButton" url="fnt:verdanab-009.fnt"/--> + + <font id="FontInfoSmall" url="ft2:Vera.ttf:12"/> + <font id="FontInfoSmall2" url="ft2:Vera.ttf:10"/> + <font id="FontInfoFollowing" url="ft2:VeraBd.ttf:9"/> + <font id="FontInfoFollowingShort" url="ft2:Vera.ttf:9"/> + <!--font id="FontMenuTitle" url="ft2:VeraBd.ttf:13"/--> + <!--font id="FontMenuItem" url="ft2:Vera.ttf:9"/--> + <font id="FontMenuTitle" url="ft2:DejaVuSans-Bold.ttf:13"/> + <font id="FontMenuItem" url="ft2:DejaVuSansCondensed.ttf:9"/> + <font id="FontMenuButton" url="ft2:VeraBd.ttf:9"/> + + <font id="FontInfo" url="ft2:VeraBd.ttf:16"/> + <font id="FontChannel" url="ft2:VeraBd.ttf:24"/> + + <font id="FontInfoSignal" url="fnt:f8n.fnt"/> + + <variable id="UseTouchscreen" value="1" condition="QueryFeature('touchscreen')" default="0"/> + + <!-- COLOURS --> + <!-- defines --> + <variable id="ColMonoFG" value="'white'"/> + <variable id="ColMonoBG" value="'black'"/> + + <condblock condition="QueryFeature('iscolour')"> + <!-- display id normal --> + <variable id="ColChannelBG" value="'0x300060'" default="#ColMonoBG" /> + <variable id="ColChannelInfo" value="'white'" default="#ColMonoFG" /> + <variable id="ColDateTime" value="'white'" default="#ColMonoFG" /> + <variable id="ColBorder" value="'blue'" default="#ColMonoFG" /> + <variable id="ColLogoBG" value="'black'" default="#ColMonoBG" /> + <variable id="ColLogoFG" value="'cyan'" default="#ColMonoFG" /> + <variable id="ColSymbol" value="'yellow'" default="#ColMonoFG" /> + <variable id="ColPresProgrText" value="'0xFF777700'" default="#ColMonoFG" /> + <variable id="ColPresProgrBar" value="'white'" default="#ColMonoFG" /> + <variable id="ColPresentTitle" value="'0x77C077'" default="#ColMonoFG" /> + <variable id="ColPresentShort" value="'0x77C077'" default="#ColMonoFG" /> + <variable id="ColFollowingTitle" value="'0x00C0C0'" default="#ColMonoFG" /> + <variable id="ColFollowingShort" value="'0x00C0C0'" default="#ColMonoFG" /> + <variable id="ColRecSymbol" value="'magenta'" default="#ColMonoFG" /> + <variable id="ColRecText" value="'magenta'" default="#ColMonoFG" /> + <variable id="ColFemonBar" value="'cyan'" default="#ColMonoFG" /> + <variable id="ColFemonText" value="'white'" default="#ColMonoFG" /> + <!-- display id volume --> + <variable id="ColVolumeBG" value="'black'" default="#ColMonoBG" /> + <variable id="ColVolumeFG" value="'white'" default="#ColMonoFG" /> + <variable id="ColVolumeBar" value="'green'" default="#ColMonoFG" /> + <!-- display id message --> + <variable id="ColMessageBG" value="'black'" default="#ColMonoBG" /> + <variable id="ColMessageFG" value="'red'" default="#ColMonoFG" /> + <variable id="ColMessageIcon" value="'red'" default="#ColMonoFG" /> + <variable id="ColMessageText" value="'white'" default="#ColMonoFG" /> + <!-- display id replay --> + <variable id="ColReplayBorder" value="#ColBorder" default="#ColBorder" /> <!-- --> + <variable id="ColReplayLogo" value="'cyan'" default="#ColMonoFG" /> + <variable id="ColReplayText" value="'white'" default="#ColMonoFG" /> + <variable id="ColReplaySymbol" value="'yellow'" default="#ColMonoFG" /> + <variable id="ColReplayBar" value="'magenta'" default="#ColMonoFG" /> + <variable id="ColReplayTime" value="'white'" default="#ColMonoFG" /> + <!-- display id menu --> + <!--variable id="ColMenuHeaderBG" value="'yellow'" condition="QueryFeature('iscolour')"/--> + <variable id="ColMenuHeaderBG" value="#ColChannelBG" default="#ColChannelBG"/> <!-- --> + <variable id="ColMenuHeaderFG" value="'white'" default="#ColMonoFG" /> + <variable id="ColMenuBorder" value="#ColMenuHeaderBG" default="#ColBorder" /> + <variable id="ColMenuEntryCurr" value="'yellow'" default="#ColMonoFG" /> + <variable id="ColMenuEntryMarker" value="'yellow'" default="#ColMonoFG" /> + <variable id="ColMenuEntry" value="'white'" default="#ColMonoFG" /> + <variable id="ColMenuButtonRBG" value="'red'" default="#ColMonoFG" /> + <variable id="ColMenuButtonRFG" value="'white'" default="#ColMonoBG" /> + <variable id="ColMenuButtonGBG" value="'green'" default="#ColMonoFG" /> + <variable id="ColMenuButtonGFG" value="'black'" default="#ColMonoBG" /> + <variable id="ColMenuButtonYBG" value="'yellow'" default="#ColMonoFG" /> + <variable id="ColMenuButtonYFG" value="'black'" default="#ColMonoBG" /> + <variable id="ColMenuButtonBBG" value="'blue'" default="#ColMonoFG" /> + <variable id="ColMenuButtonBFG" value="'white'" default="#ColMonoBG" /> + <variable id="ColMenuButtonBG" value="'0xEEEEEE'" default="#ColMonoFG" /> + <variable id="ColMenuButtonFG" value="'black'" default="#ColMonoBG" /> + </condblock> + + <variable id="LineThickness" value="2"/> + + <variable id="LogoW" value="64"/> + <variable id="LogoH" value="48"/> + <variable id="LogoX" value="mul(-1,#LogoW)"/> + <variable id="ChannelLogo" value="'{ConfigPath}/logos/channels/{ChannelAlias}_l.glcd'"/> + + <variable id="SymbolW" value="ImageWidth('symbols/empty.pbm')"/> + <variable id="SymbolH" value="ImageHeight('symbols/empty.pbm')"/> + <variable id="SymbolPitch" value="add(#SymbolW,1)"/> + <variable id="SymbolTeletext" value="'symbols/teletext.pbm'"/> + <variable id="SymbolDolby" value="'symbols/dolby.pbm'"/> + <variable id="SymbolScrambled" value="'symbols/scrambled.pbm'"/> + <variable id="SymbolMute" value="'symbols/mute.pbm'"/> + <variable id="SymbolRecording" value="'symbols/recording.pbm'"/> + + <!-- button dimensions --> + <variable id="ButtonPitch3W" value="div({ScreenWidth},3)"/> + <variable id="ButtonPitch4W" value="div({ScreenWidth},4)"/> + <variable id="ButtonPitch5W" value="div({ScreenWidth},5)"/> + <variable id="ButtonPitchH" value="div({ScreenHeight},5)" condition="#UseTouchscreen" + default="add(FontLineHeight('FontMenuButton'),2)" /> + + <variable id="ButtonWidth3" value="sub(#ButtonPitch3W,2)"/> + <variable id="ButtonWidth4" value="sub(#ButtonPitch4W,2)"/> + <variable id="ButtonWidth5" value="sub(#ButtonPitch5W,2)"/> + <variable id="ButtonHeight" value="sub(#ButtonPitchH,2)"/> + <!-- menu dimensions --> + <variable id="MenuHeaderW" value="sub({ScreenWidth},mul(#ButtonPitch5W,2),2)" condition="#UseTouchscreen" + default="sub({ScreenWidth},0)" /> + <variable id="MenuHeaderH" value="sub(#ButtonHeight,2)" condition="#UseTouchscreen" + default="FontLineHeight('FontMenuTitle')" /> + + + <display id="normal"> + + <block condition="equal({DisplayMode},'Normal')"> + <variable id="TimeBarW" value="FontTextWidth('FontTimes','00:00 - 00:00')"/> + <variable id="TimeBarY" value="add(#LogoH,#LineThickness,FontLineHeight('FontTimes'),18)"/> + + <item x1="0" y1="0" width="mul(div({ScreenWidth},3),2)" height="mul(div({ScreenHeight},5),4)" action="Mode.Interactive"/> + + <rectangle x1="0" y1="0" width="add({ScreenWidth},0)" height="#LogoH" color="#ColChannelBG" filled="yes"/> + + <text x1="1" y1="0" width="sub({ScreenWidth},2)" color="#ColChannelInfo" bgcolor="#ColChannelBG" align="left" font="FontChannel" scrollmode="never"> + {ChannelNumber} | {ChannelName} + </text> + <text x1="1" y1="sub(#LogoH,FontLineHeight('FontInfo'))" color="#ColDateTime" bgcolor="#ColChannelBG" align="left" font="FontInfo"> + {DateTime:%a %d.%m.} + </text> + <text x1="1" y1="sub(#LogoH,FontLineHeight('FontInfo'))" x2="sub({ScreenWidth},1)" color="#ColDateTime" bgcolor="#ColChannelBG" align="right" font="FontInfo"> + {DateTime:%H\:%M} + </text> + <rectangle x1="0" x2="-1" y1="#LogoH" height="#LineThickness" color="#ColBorder" filled="yes"/> + <!--rectangle x1="0" x2="-1" y1="#LogoH" height="#LineThickness" color="black" filled="yes"/--> + <block condition="{SettingShowChannelLogo}"> + <rectangle x1="sub(#LogoX,#LineThickness)" width="#LineThickness" y1="add(#LogoH,#LineThickness)" height="#LogoH" color="#ColBorder" filled="yes"/> + <rectangle x1="#LogoX" y1="add(#LogoH,#LineThickness)" width="#LogoW" height="#LogoH" color="#ColLogoBG" filled="yes"/> + <image x="#LogoX" y="add(#LogoH,#LineThickness)" color="#ColLogoFG" path="#ChannelLogo"/> + <rectangle x1="sub(#LogoX,#LineThickness)" x2="-1" y1="add(add(#LogoH,#LineThickness),#LogoH)" height="#LineThickness" color="#ColBorder" filled="yes"/> + </block> + <block condition="{SettingShowSymbols}"> + <image x="mul(-4,#SymbolPitch)" y="mul(add(#LogoH,#LineThickness,1),2)" color="#ColSymbol" path="#SymbolTeletext" condition="{ChannelHasTeletext}"/> + <image x="mul(-3,#SymbolPitch)" y="mul(add(#LogoH,#LineThickness,1),2)" color="#ColSymbol" path="#SymbolDolby" condition="{ChannelHasDolby}"/> + <image x="mul(-2,#SymbolPitch)" y="mul(add(#LogoH,#LineThickness,1),2)" color="#ColSymbol" path="#SymbolScrambled" condition="{ChannelIsEncrypted}"/> + <image x="mul(-1,#SymbolPitch)" y="mul(add(#LogoH,#LineThickness,1),2)" color="#ColSymbol" path="#SymbolMute" condition="{VolumeIsMute}"/> + </block> + <block condition="{SettingShowTimebar}"> + <block condition="{PresentValid}"> + <text x1="0" x2="-1" y1="add(add(#LogoH,#LineThickness),15)" y2="-1" color="#ColPresProgrText" align="left" font="FontTimes"> + {PresentStartDateTime:%H\:%M} - {FollowingStartDateTime:%H\:%M} + </text> + <rectangle x1="0" width="#TimeBarW" y1="#TimeBarY" height="12" color="#ColPresProgrBar"/> + <progress x1="4" width="sub(#TimeBarW,8)" y1="add(#TimeBarY,4)" height="4" color="#ColPresProgrBar" direction="0" current="{PresentProgress}" total="{PresentDuration}"/> + </block> + </block> + + <variable id="FemonBarY" value="sub(#TimeBarY,10)"/> + <block condition="{ServiceIsAvailable:femon}"> + <rectangle x1="add(#TimeBarW,20)" width="74" y1="#FemonBarY" height="6" color="#ColFemonBar"/> + <progress x1="add(#TimeBarW,22)" width="70" y1="add(#FemonBarY,2)" height="2" color="#ColFemonBar" direction="0" current="{ServiceItem:femon,signal}" total="65536"/> + <rectangle x1="add(#TimeBarW,20)" width="74" y1="#TimeBarY" height="6" color="#ColFemonBar"/> + <progress x1="add(#TimeBarW,22)" width="70" y1="add(#TimeBarY,2)" height="2" color="#ColFemonBar" direction="0" current="{ServiceItem:femon,snr}" total="65536"/> + <text x1="add(#TimeBarW,98)" width="16" y1="sub(#FemonBarY,2)" y2="-1" color="#ColFemonText" align="right" scrollmode="never" font="FontInfoSignal"> + {ServiceItem:femon,percent_signal}% + </text> + <text x1="add(#TimeBarW,98)" width="16" y1="sub(#TimeBarY,2)" y2="-1" color="#ColFemonText" align="right" scrollmode="never" font="FontInfoSignal"> + {ServiceItem:femon,percent_snr}% + </text> + <!--text x1="add(#TimeBarW,20)" width="74" y1="sub(#FemonBarY,12)" y2="-1" color="$ColFemonText" align="left" scrollmode="never" font="FontInfoSignal" altcondition="{IsRadio}" alttext="ABR: {ServiceItem:femon,abr,%2.2f,1024} k/s"> + VBR: {ServiceItem:femon,vbr,%2.2f,1048576} M/s + </text--> + </block> + + <variable id="RecordingsTextY" value="mul(-1,FontLineHeight('FontTimes'))"/> + <variable id="RecordingsLineY" value="sub(sub(#RecordingsTextY,#LineThickness),1)"/> + <variable id="RecordingsSymbolY" value="add(#RecordingsTextY,div(sub(FontLineHeight('FontTimes'),#SymbolH),2))"/> + <variable id="FollowingShortTextY" value="sub(sub(#RecordingsLineY,FontLineHeight('FontInfoSmall2')),2)"/> + <variable id="FollowingTextY" value="sub(sub(#FollowingShortTextY,FontLineHeight('FontInfoSmall')),2)"/> + <variable id="PresentShortTextY" value="sub(sub(#FollowingTextY,FontLineHeight('FontTitleSmall')),4)"/> + <variable id="PresentTextY" value="sub(sub(#PresentShortTextY,FontLineHeight('FontTitle')),2)"/> + + <text x1="0" x2="-1" y1="#PresentTextY" height="FontLineHeight('FontTitle')" color="#ColPresentTitle" align="left" font="FontTitle" altcondition="and(not({PresentTitle}),{ServiceIsAvailable:radio})" alttext="{ServiceItem:radio}"> + {PresentTitle} + </text> + <text x1="0" x2="-1" y1="#PresentShortTextY" height="FontLineHeight('FontTitleSmall')" color="#ColPresentShort" align="left" font="FontTitleSmall" altcondition="and({PresentTitle},{ServiceIsAvailable:radio})" alttext="{ServiceItem:radio}"> + {PresentShortText} + </text> + + <block condition="{FollowingValid}"> + <text x1="0" x2="-1" y1="#FollowingTextY" height="FontLineHeight('FontInfoSmall')" color="#ColFollowingTitle" align="left" font="FontInfoSmall"> + {FollowingStartDateTime:%H\:%M} + </text> + <text x1="80" x2="-1" y1="#FollowingTextY" height="FontLineHeight('FontInfoSmall')" color="#ColFollowingTitle" align="left" font="FontInfoSmall"> + {FollowingTitle} + </text> + <text x1="80" x2="-1" y1="#FollowingShortTextY" height="FontLineHeight('FontInfoSmall2')" color="#ColFollowingShort" align="left" font="FontInfoSmall2"> + {FollowingShortText} + </text> + </block> + + <block condition="{Recordings}"> + <rectangle x1="0" x2="-1" y1="#RecordingsLineY" height="#LineThickness" color="#ColBorder" filled="yes"/> + <image x="0" y="#RecordingsSymbolY" color="#ColRecSymbol" path="#SymbolRecording" condition="{IsRecording}"/> + <text x1="add(#SymbolW,2)" x2="-1" y1="#RecordingsTextY" height="FontLineHeight('FontTimes')" color="#ColRecText" align="left" font="FontTimes"> + {Recordings} + </text> + </block> + </block> + + <block condition="equal({DisplayMode},'Interactive')"> + <variable id="IVolumeBarX" value="0"/> + <variable id="IVolumeBarW" value="sub(mul(#ButtonWidth3,2),0)"/> + <variable id="IVolumeBarH" value="30"/> + <variable id="IVolumeBarY" value="add(mul(#ButtonPitchH,2),1)"/> + <variable id="IMuteImage" value="'images/mute.pbm'"/> + <variable id="IMuteImageW" value="ImageWidth(#IMuteImage)"/> + <variable id="IMuteImageH" value="ImageHeight(#IMuteImage)"/> + + + <button action="Mode.Normal" x1="1" y1="0" width="mul(#ButtonWidth3,2)" height="add(#MenuHeaderH,2)" color="#ColMenuHeaderBG" labelcolor="#ColMenuHeaderFG" font="FontMenuButton" radius="0">Back</button> + <button action="Key.Menu" x1="sub({ScreenWidth},mul(#ButtonPitch3W,1))" y1="add(mul(#ButtonPitchH,0),1)" width="#ButtonWidth3" height="#ButtonHeight" color="#ColMenuButtonBG" labelcolor="#ColMenuButtonFG" font="FontMenuButton" radius="2">Menu</button> + <button action="Key.Up" x1="sub({ScreenWidth},mul(#ButtonPitch3W,1))" y1="add(mul(#ButtonPitchH,1),1)" width="#ButtonWidth3" height="#ButtonHeight" color="#ColMenuButtonBG" labelcolor="#ColMenuButtonFG" font="FontMenuButton" radius="2">Ch+</button> + <button action="Key.Down" x1="sub({ScreenWidth},mul(#ButtonPitch3W,1))" y1="add(mul(#ButtonPitchH,2),1)" width="#ButtonWidth3" height="#ButtonHeight" color="#ColMenuButtonBG" labelcolor="#ColMenuButtonFG" font="FontMenuButton" radius="2">Ch-</button> + <button action="Key.Mute" x1="sub({ScreenWidth},mul(#ButtonPitch3W,3))" y1="add(mul(#ButtonPitchH,3),1)" width="#ButtonWidth3" height="#ButtonHeight" color="#ColMenuButtonBG" labelcolor="#ColMenuButtonFG" font="FontMenuButton" radius="2">Mute</button> + <button action="Key.Volume-" x1="sub({ScreenWidth},mul(#ButtonPitch3W,2))" y1="add(mul(#ButtonPitchH,3),1)" width="#ButtonWidth3" height="#ButtonHeight" color="#ColMenuButtonBG" labelcolor="#ColMenuButtonFG" font="FontMenuButton" radius="2">Vol-</button> + <button action="Key.Volume+" x1="sub({ScreenWidth},mul(#ButtonPitch3W,1))" y1="add(mul(#ButtonPitchH,3),1)" width="#ButtonWidth3" height="#ButtonHeight" color="#ColMenuButtonBG" labelcolor="#ColMenuButtonFG" font="FontMenuButton" radius="2">Vol+</button> + + + <text x1="1" y1="add(mul(#ButtonPitchH,1),1)" width="mul(#ButtonWidth3,2)" color="#ColChannelInfo" align="left" font="FontChannel" scrollmode="never"> + {ChannelNumber} | {ChannelName} + </text> + <rectangle x1="#IVolumeBarX" y1="#IVolumeBarY" width="#IVolumeBarW" height="#IVolumeBarH" color="#ColVolumeBG" filled="yes" radius="3"/> + <rectangle x1="add(#IVolumeBarX,2)" y1="add(#IVolumeBarY,2)" width="sub(#IVolumeBarW,4)" height="sub(#IVolumeBarH,4)" color="#ColVolumeFG" radius="2"/> + <block condition="not({VolumeIsMute})"> + <progress x1="add(#IVolumeBarX,4)" y1="add(#IVolumeBarY,4)" width="sub(#IVolumeBarW,8)" height="sub(#IVolumeBarH,8)" color="#ColVolumeBar" direction="0" current="{VolumeCurrent}" total="{VolumeTotal}"/> + </block> + <block condition="{VolumeIsMute}"> + <image x="add(#IVolumeBarX,div(#IVolumeBarW,2))" y="add(#IVolumeBarY,4)" color="#ColVolumeBar" path="#IMuteImage"/> + </block> + </block> + </display> + + <display id="volume"> + + <variable id="VolumeBarX" value="20" /> + <variable id="VolumeBarW" value="sub({ScreenWidth},mul(2,#VolumeBarX))" /> + <variable id="VolumeBarH" value="30" /> + <variable id="VolumeBarY" value="div(sub({ScreenHeight},#VolumeBarH),2)" /> + + <variable id="MuteImage" value="'images/mute.pbm'"/> + <variable id="MuteImageW" value="ImageWidth(#MuteImage)"/> + <variable id="MuteImageH" value="ImageHeight(#MuteImage)"/> + + <block condition="equal({DisplayMode},'Normal')"> + <rectangle x1="#VolumeBarX" y1="#VolumeBarY" width="#VolumeBarW" height="#VolumeBarH" color="#ColVolumeBG" filled="yes" radius="3"/> + <rectangle x1="add(#VolumeBarX,2)" y1="add(#VolumeBarY,2)" width="sub(#VolumeBarW,4)" height="sub(#VolumeBarH,4)" color="#ColVolumeFG" radius="2"/> + <block condition="not({VolumeIsMute})"> + <progress x1="add(#VolumeBarX,4)" y1="add(#VolumeBarY,4)" width="sub(#VolumeBarW,8)" height="sub(#VolumeBarH,8)" color="#ColVolumeBar" direction="0" current="{VolumeCurrent}" total="{VolumeTotal}"/> + </block> + <block condition="{VolumeIsMute}"> + <image x="div(sub({ScreenWidth},#MuteImageW),2)" y="div(sub({ScreenHeight},#MuteImageH),2)" color="#ColVolumeBar" path="#MuteImage"/> + </block> + </block> + </display> + + + <display id="message"> + <variable id="MessageX" value="10"/> + <variable id="MessageW" value="sub({ScreenWidth},mul(2,#MessageX))"/> + <variable id="MessageTextH" value="mul(4,FontLineHeight('FontInfo'))"/> + <variable id="MessageH" value="add(#MessageTextH,8)"/> + <variable id="MessageY" value="div(sub({ScreenHeight},#MessageH),2)"/> + <variable id="MessageBitmap" value="'images/message.pbm'"/> + <variable id="MessageBitmapW" value="ImageWidth(#MessageBitmap)"/> + <variable id="MessageBitmapH" value="ImageHeight(#MessageBitmap)"/> + + <rectangle x1="#MessageX" y1="#MessageY" width="#MessageW" height="#MessageH" color="#ColMessageBG" filled="yes" radius="3"/> + <rectangle x1="add(#MessageX,2)" y1="add(#MessageY,2)" width="sub(#MessageW,4)" height="sub(#MessageH,4)" color="#ColMessageFG" radius="2"/> + <block condition="lt(#MessageBitmapH,sub(#MessageH,12))"> + <image x1="add(#MessageX,6)" y1="add(#MessageY,6)" color="#ColMessageIcon" path="#MessageBitmap"/> + <text x1="add(add(#MessageX,10),#MessageBitmapW)" y1="add(#MessageY,4)" width="sub(sub(#MessageW,14),#MessageBitmapW)" height="#MessageTextH" color="#ColMessageText" align="left" multiline="yes" font="FontInfo"> + {Message} + </text> + </block> + <block condition="ge(#MessageBitmapH,sub(#MessageH,12))"> + <text x1="add(#MessageX,4)" y1="add(#MessageY,4)" width="sub(#MessageW,8)" height="#MessageTextH" color="#ColMessageText" align="left" multiline="yes" font="FontInfo"> + {Message} + </text> + </block> + </display> + + + <display id="replay"> + <variable id="ReplayProgressH" value="14"/> + <variable id="ReplayProgressGap" value="1"/> + <variable id="ReplayTimeY" value="mul(FontLineHeight('FontInfo'),-1)"/> + <variable id="ReplayProgressY" value="sub(#ReplayTimeY,#ReplayProgressH,#ReplayProgressGap)"/> + <variable id="ReplayLogo" value="'{ConfigPath}/logos/replay/replay-{ReplayMode}_m.glcd'" condition="le({ScreenHeight},64)" + default="'{ConfigPath}/logos/replay/replay-{ReplayMode}_l.glcd'"/> + + <item x1="0" y1="0" height="div({ScreenWidth},3)" width="div({ScreenHeight},5)" action="Key.Back"/> + <item x1="mul(div({ScreenWidth},3),2)" y1="0" height="mul(div({ScreenHeight},5),2)" action="Key.Up"/> + <item x1="mul(div({ScreenWidth},3),2)" y1="mul(div({ScreenHeight},5),2)" height="mul(div({ScreenHeight},5),2)" action="Key.Down"/> + <item x1="0" y1="mul(div({ScreenHeight},5),4)" width="div({ScreenWidth},3)" height="div({ScreenHeight},5)" action="Key.Volume-"/> + <item x1="div({ScreenWidth},3)" y1="mul(div({ScreenHeight},5),4)" width="div({ScreenWidth},3)" height="div({ScreenHeight},5)" action="Key.Mute"/> + <item x1="mul(div({ScreenWidth},3),2)" y1="mul(div({ScreenHeight},5),4)" width="div({ScreenWidth},3)" height="div({ScreenHeight},5)" action="Key.Volume+"/> + + <block condition="{SettingShowReplayLogo}"> + <image x="#LogoX" y="0" color="#ColReplayLogo" path="#ReplayLogo"/> + <rectangle x1="sub(#LogoX,#LineThickness)" width="#LineThickness" y1="0" height="#LogoH" color="#ColReplayBorder" filled="yes"/> + <rectangle x1="sub(#LogoX,#LineThickness)" x2="-1" y1="#LogoH" height="#LineThickness" color="#ColReplayBorder" filled="yes"/> + <text x1="0" x2="sub(#LogoX,#LineThickness,2)" y1="0" y2="#ReplayProgressY" color="#ColReplayText" align="left" multiline="yes" font="FontInfo"> + {ReplayTitle} + </text> + </block> + <block condition="not({SettingShowReplayLogo})"> + <text x1="0" x2="-1" y1="0" y2="#ReplayProgressY" color="#ColReplayText" align="left" multiline="yes" font="FontInfo"> + {ReplayTitle} + </text> + </block> + <rectangle x1="0" y1="#ReplayProgressY" width="15" height="14" color="#ColReplayBorder"/> + <image x="1" y="add(#ReplayProgressY,1)" color="#ColReplaySymbol" path="symbols/replay-play.pbm" condition="{ReplayIsPlaying}"/> + <image x="1" y="add(#ReplayProgressY,1)" color="#ColReplaySymbol" path="symbols/replay-pause.pbm" condition="{ReplayIsPausing}"/> + <image x="1" y="add(#ReplayProgressY,1)" color="#ColReplaySymbol" path="symbols/replay-fast-fwd.pbm" condition="{ReplayIsFastForward}"/> + <image x="1" y="add(#ReplayProgressY,1)" color="#ColReplaySymbol" path="symbols/replay-fast-rwd.pbm" condition="{ReplayIsFastRewind}"/> + <image x="1" y="add(#ReplayProgressY,1)" color="#ColReplaySymbol" path="symbols/replay-slow-fwd.pbm" condition="{ReplayIsSlowForward}"/> + <image x="1" y="add(#ReplayProgressY,1)" color="#ColReplaySymbol" path="symbols/replay-slow-rwd.pbm" condition="{ReplayIsSlowRewind}"/> + <rectangle x1="14" x2="-1" y1="#ReplayProgressY" height="#ReplayProgressH" color="#ColReplayBar"/> + <progress x1="16" x2="-3" y1="add(#ReplayProgressY,2)" height="sub(#ReplayProgressH,4)" color="#ColReplayBar" direction="0" current="{ReplayPosition}" total="{ReplayDuration}"/> + <text x1="0" x2="-1" y1="#ReplayTimeY" y2="-1" color="#ColReplayTime" align="left" font="FontInfo"> + {ReplayPositionIndex:%H\:%M\:%S} + </text> + <text x1="0" x2="-1" y1="#ReplayTimeY" y2="-1" color="#ColReplayTime" align="right" font="FontInfo"> + {ReplayDurationIndex:%H\:%M\:%S} + </text> + </display> + + + <display id="menu"> + <variable id="ButtonY" value="mul(#ButtonHeight,-1)"/> + <variable id="ButtonTextY" value="mul(#ButtonHeight,-1)"/> + <variable id="ItemHeight" value="FontLineHeight('FontMenuItem')"/> + <variable id="ArrowBitmap" value="'images/arrow_small.pbm'" condition="le({ScreenHeight},64)" + default="'images/arrow.pbm'" /> + <variable id="ArrowWidth" value="ImageWidth(#ArrowBitmap)"/> + <variable id="ArrowHeight" value="ImageHeight(#ArrowBitmap)"/> + <variable id="ArrowY" value="div(sub(#ItemHeight,#ArrowHeight),2)" condition="le({ScreenHeight},64)" + default="add(div(sub(#ItemHeight,#ArrowHeight),2),2)" /> + + <variable id="MenuContentW" value="sub({ScreenWidth},#ButtonPitch5W,#ArrowWidth,6)" condition="#UseTouchscreen" + default="sub({ScreenWidth},0)" /> + + <item x1="0" y1="0" height="#MenuHeaderH" width="#ButtonWidth5" action="Key.Back"/> + + <rectangle x1="0" y1="0" width="#MenuHeaderW" height="add(#MenuHeaderH,1)" color="#ColMenuHeaderBG" filled="yes"/> + <text x1="0" x2="-1" height="#MenuHeaderH" width="#MenuHeaderW" color="#ColMenuHeaderFG" bgcolor="#ColMenuHeaderBG" multiline="yes" valign="middle" font="FontMenuTitle">{MenuTitle}</text> + <rectangle x1="0" y1="add(#MenuHeaderH,1)" width="#MenuHeaderW" x2="-1" height="#LineThickness" color="#ColMenuBorder" filled="yes"/> + <list x1="0" y1="add(#MenuHeaderH,4)" x2="-1" y2="#ButtonY"> + <item height="#ItemHeight"/> + <text x1="add(#ArrowWidth,2)" x2="-1" y1="0" height="#ItemHeight" width="#MenuContentW" color="#ColMenuEntryCurr" font="FontMenuItem" scrollmode="once">{MenuCurrent}</text> + <image x="0" y="#ArrowY" width="#ArrowWidth" height="#ArrowHeight" color="#ColMenuEntryMarker" path="#ArrowBitmap" condition="{IsMenuCurrent}"/> + <text x1="add(#ArrowWidth,2)" x2="-1" y1="0" color="#ColMenuEntry" height="#ItemHeight" width="#MenuContentW" font="FontMenuItem">{MenuItem}</text> + </list> + + <button condition="{ButtonRed}" action="Key.Red" x1="add(mul(#ButtonPitch4W,0),1)" y1="#ButtonY" width="#ButtonWidth4" height="#ButtonHeight" color="#ColMenuButtonRBG" labelcolor="#ColMenuButtonRFG" font="FontMenuButton" radius="2">{ButtonRed}</button> + <button condition="{ButtonGreen}" action="Key.Green" x1="add(mul(#ButtonPitch4W,1),1)" y1="#ButtonY" width="#ButtonWidth4" height="#ButtonHeight" color="#ColMenuButtonGBG" labelcolor="#ColMenuButtonGFG" font="FontMenuButton" radius="2">{ButtonGreen}</button> + <button condition="{ButtonYellow}" action="Key.Yellow" x1="add(mul(#ButtonPitch4W,2),1)" y1="#ButtonY" width="#ButtonWidth4" height="#ButtonHeight" color="#ColMenuButtonYBG" labelcolor="#ColMenuButtonYFG" font="FontMenuButton" radius="2">{ButtonYellow}</button> + <button condition="{ButtonBlue}" action="Key.Blue" x1="add(mul(#ButtonPitch4W,3),1)" y1="#ButtonY" width="#ButtonWidth4" height="#ButtonHeight" color="#ColMenuButtonBBG" labelcolor="#ColMenuButtonBFG" font="FontMenuButton" radius="2">{ButtonBlue}</button> + <!-- navigation buttons if touchscreen is available --> + <block condition="#UseTouchscreen"> + <button action="Key.Left" x1="sub({ScreenWidth},mul(#ButtonPitch5W,2))" y1="add(mul(#ButtonPitchH,0),1)" width="#ButtonWidth5" height="#ButtonHeight" color="#ColMenuButtonBG" labelcolor="#ColMenuButtonFG" font="FontMenuButton" radius="2"><</button> + <button action="Key.Right" x1="sub({ScreenWidth},mul(#ButtonPitch5W,1))" y1="add(mul(#ButtonPitchH,0),1)" width="#ButtonWidth5" height="#ButtonHeight" color="#ColMenuButtonBG" labelcolor="#ColMenuButtonFG" font="FontMenuButton" radius="2">></button> + <button action="Key.Up" x1="sub({ScreenWidth},mul(#ButtonPitch5W,1))" y1="add(mul(#ButtonPitchH,1),1)" width="#ButtonWidth5" height="#ButtonHeight" color="#ColMenuButtonBG" labelcolor="#ColMenuButtonFG" font="FontMenuButton" radius="2">/\</button> + <button action="Key.Down" x1="sub({ScreenWidth},mul(#ButtonPitch5W,1))" y1="add(mul(#ButtonPitchH,2),1)" width="#ButtonWidth5" height="#ButtonHeight" color="#ColMenuButtonBG" labelcolor="#ColMenuButtonFG" font="FontMenuButton" radius="2">\/</button> + <button action="Key.Ok" x1="sub({ScreenWidth},mul(#ButtonPitch5W,1))" y1="add(mul(#ButtonPitchH,3),1)" width="#ButtonWidth5" height="#ButtonHeight" color="#ColMenuButtonBG" labelcolor="#ColMenuButtonFG" font="FontMenuButton" radius="2">OK</button> + </block> + </display> +</skin> diff --git a/skinconfig.c b/skinconfig.c index 8537eaf..89ff8a4 100644 --- a/skinconfig.c +++ b/skinconfig.c @@ -6,7 +6,8 @@ * This file is released under the GNU General Public License. Refer * to the COPYING file distributed with this package. * - * (c) 2004 Andreas Regel <andreas.regel AT powarman.de> + * (c) 2004-2010 Andreas Regel <andreas.regel AT powarman.de> + * (c) 2010-2011 Wolfgang Astleitner <mrwastl AT users sourceforge net> */ #include <glcdskin/config.h> @@ -136,6 +137,7 @@ typedef enum _eTokenId tokBrightnessActive, tokBrightnessIdle, tokBrightnessDelay, + tokDisplayMode, tokPrivateSettingEnd, // external services @@ -260,6 +262,7 @@ static const std::string Tokens[tokCountToken] = "BrightnessActive", "BrightnessIdle", "BrightnessDelay", + "DisplayMode", "privateSettingEnd", // external services @@ -647,6 +650,16 @@ GLCD::cType cGraphLCDSkinConfig::GetToken(const GLCD::tSkinToken & Token) return GraphLCDSetup.BrightnessIdle; case tokBrightnessDelay: return GraphLCDSetup.BrightnessDelay; + case tokDisplayMode: + switch (mDisplay->GetDisplayMode()) + { + case DisplayModeNormal: + return "Normal"; + case DisplayModeInteractive: + return "Interactive"; + default: + return "Normal"; + } default: break; @@ -765,13 +778,18 @@ int cGraphLCDSkinConfig::GetTabPosition(int Index, int MaxWidth, const GLCD::cFo return 0; } +void cGraphLCDSkinConfig::SetMenuClear() +{ + mTabs.clear(); +} + + uint64_t cGraphLCDSkinConfig::Now(void) { return cTimeMs::Now(); } - -void cGraphLCDSkinConfig::SetMenuClear() +GLCD::cDriver * cGraphLCDSkinConfig::GetDriver(void) const { - mTabs.clear(); + return (mDisplay) ? (mDisplay)->GetDriver() : NULL; } diff --git a/skinconfig.h b/skinconfig.h index 97bde72..3e901d5 100644 --- a/skinconfig.h +++ b/skinconfig.h @@ -6,7 +6,8 @@ * This file is released under the GNU General Public License. Refer * to the COPYING file distributed with this package. * - * (c) 2004 Andreas Regel <andreas.regel AT powarman.de> + * (c) 2004-2010 Andreas Regel <andreas.regel AT powarman.de> + * (c) 2010-2011 Wolfgang Astleitner <mrwastl AT users sourceforge net> */ #ifndef _GRAPHLCD_SKINCONFIG_H_ @@ -14,6 +15,8 @@ #include "alias.h" +#include <glcddrivers/driver.h> + class cGraphLCDSkinConfig : public GLCD::cSkinConfig { private: @@ -37,9 +40,11 @@ public: virtual GLCD::cType GetToken(const GLCD::tSkinToken & Token); virtual int GetTokenId(const std::string & Name); virtual int GetTabPosition(int Index, int MaxWidth, const GLCD::cFont & Font); - virtual uint64_t Now(void); const std::string & SkinName(void) const { return mSkinName; } + + virtual uint64_t Now(void); + virtual GLCD::cDriver * GetDriver(void) const; }; #endif |