diff options
| author | louis <louis.braun@gmx.de> | 2016-05-29 10:07:28 +0200 |
|---|---|---|
| committer | louis <louis.braun@gmx.de> | 2016-05-29 10:07:28 +0200 |
| commit | 87f3d895f7026b8b39944042cafcd50fdd14028a (patch) | |
| tree | 77f25bc9e7458a6b7e0f6129ffff08d8ac1d344d | |
| parent | 75668612bede1c9971e6cb77eda396525d1019b1 (diff) | |
| download | vdr-plugin-skindesigner-87f3d895f7026b8b39944042cafcd50fdd14028a.tar.gz vdr-plugin-skindesigner-87f3d895f7026b8b39944042cafcd50fdd14028a.tar.bz2 | |
left / right keys in zappilot configurable in skin
| -rw-r--r-- | coreengine/attribute.c | 8 | ||||
| -rw-r--r-- | coreengine/attribute.h | 1 | ||||
| -rw-r--r-- | coreengine/attributes.c | 4 | ||||
| -rw-r--r-- | coreengine/attributes.h | 1 | ||||
| -rw-r--r-- | coreengine/definitions.h | 6 | ||||
| -rw-r--r-- | coreengine/viewdisplaychannel.c | 22 | ||||
| -rw-r--r-- | coreengine/viewdisplaychannel.h | 1 | ||||
| -rw-r--r-- | coreengine/viewlist.h | 1 | ||||
| -rw-r--r-- | displaychannel.c | 6 | ||||
| -rw-r--r-- | displaychannel.h | 1 | ||||
| -rw-r--r-- | dtd/displaychannel.dtd | 2 | ||||
| -rw-r--r-- | skins/estuary4vdr/setup.xml | 25 | ||||
| -rw-r--r-- | skins/estuary4vdr/xmlfiles/displaychannel.xml | 36 | ||||
| -rw-r--r-- | skinskeleton/xmlfiles/displaychannel.xml | 4 |
14 files changed, 84 insertions, 34 deletions
diff --git a/coreengine/attribute.c b/coreengine/attribute.c index d92cb9b..a1c3ec6 100644 --- a/coreengine/attribute.c +++ b/coreengine/attribute.c @@ -339,6 +339,14 @@ void cAttributes::SetDirection(int id, const char *val) { attribs[id] = (int)direction; } +void cAttributes::SetButton(int id, const char *val) { + eButtonType button = eButtonType::none; + if (!strcmp(val, "left")) + button = eButtonType::left; + else if (!strcmp(val, "right")) + button = eButtonType::right; + attribs[id] = (int)button; +} /*************************************************************************** * Private Functions ***************************************************************************/ diff --git a/coreengine/attribute.h b/coreengine/attribute.h index f0ec6f8..ecbcf62 100644 --- a/coreengine/attribute.h +++ b/coreengine/attribute.h @@ -46,6 +46,7 @@ protected: void SetOrientation(int id, const char *val); void SetDirection(int id, const char *val); void SetAlign(int id, const char *val); + void SetButton(int id, const char *val); public: cAttributes(int numAttributes); cAttributes(const cAttributes &other); diff --git a/coreengine/attributes.c b/coreengine/attributes.c index 4840dbc..b0d0dba 100644 --- a/coreengine/attributes.c +++ b/coreengine/attributes.c @@ -244,6 +244,8 @@ void cViewListAttribs::Set(vector<stringpair> &attributes) { SetShiftType(id, attVal); } else if (IdEqual(id, (int)eViewListAttribs::shiftmode)) { SetShiftMode(id, attVal); + } else if (IdEqual(id, (int)eViewListAttribs::button)) { + SetButton(id, attVal); } else { attribCtors[id] = new cNumericExpr(attVal); } @@ -289,6 +291,7 @@ void cViewListAttribs::SetAttributesDefs(void) { attribIDs.insert(pair<string, int>("startx", (int)eViewListAttribs::startx)); attribIDs.insert(pair<string, int>("starty", (int)eViewListAttribs::starty)); attribIDs.insert(pair<string, int>("condition", (int)eViewListAttribs::condition)); + attribIDs.insert(pair<string, int>("button", (int)eViewListAttribs::button)); attribNames.insert(pair<int, string>((int)eViewListAttribs::align, "align")); attribNames.insert(pair<int, string>((int)eViewListAttribs::menuitemwidth, "menuitemwidth")); attribNames.insert(pair<int, string>((int)eViewListAttribs::determinatefont, "determinatefont")); @@ -301,6 +304,7 @@ void cViewListAttribs::SetAttributesDefs(void) { attribNames.insert(pair<int, string>((int)eViewListAttribs::startx, "startx")); attribNames.insert(pair<int, string>((int)eViewListAttribs::starty, "starty")); attribNames.insert(pair<int, string>((int)eViewListAttribs::condition, "condition")); + attribNames.insert(pair<int, string>((int)eViewListAttribs::button, "button")); } void cViewListAttribs::Debug(void) { diff --git a/coreengine/attributes.h b/coreengine/attributes.h index 228964d..c0a7402 100644 --- a/coreengine/attributes.h +++ b/coreengine/attributes.h @@ -70,6 +70,7 @@ public: cPoint ShiftStartpoint(void) { return cPoint(GetValue((int)eViewListAttribs::startx), GetValue((int)eViewListAttribs::starty)); }; int ShiftType(void) { return GetValue((int)eViewListAttribs::shifttype); }; int ShiftMode(void) { return GetValue((int)eViewListAttribs::shiftmode); }; + eButtonType Button(void) { return (eButtonType)GetValue((int)eViewListAttribs::button); } void Debug(void); }; /****************************************************************** diff --git a/coreengine/definitions.h b/coreengine/definitions.h index 51f298d..5d8ecc0 100644 --- a/coreengine/definitions.h +++ b/coreengine/definitions.h @@ -1664,6 +1664,7 @@ enum class eViewListAttribs { startx, starty, condition, + button, count }; @@ -1871,5 +1872,10 @@ enum class eDirection { topdown }; +enum class eButtonType { + none = -1, + left, + right +}; #endif //__DEFINITIONS_H diff --git a/coreengine/viewdisplaychannel.c b/coreengine/viewdisplaychannel.c index 7ab36ce..831a1b9 100644 --- a/coreengine/viewdisplaychannel.c +++ b/coreengine/viewdisplaychannel.c @@ -292,6 +292,22 @@ int cViewChannel::MaxItems(void) { return 0; } +bool cViewChannel::KeyRightOpensChannellist(void) { + if (channelList) { + if (channelList->Button() == eButtonType::left) + return false; + else if (channelList->Button() == eButtonType::right) + return true; + } + if (groupList) { + if (groupList->Button() == eButtonType::left) + return true; + else if (groupList->Button() == eButtonType::right) + return false; + } + return true; +} + void cViewChannel::SetChannelInfo(const cChannel *channel) { if (!channel) return; @@ -329,6 +345,8 @@ void cViewChannel::ClearList(void) { channelList->Clear(); if (viewType == dcGroupsList && groupList) groupList->Clear(); + if (viewType == dcGroupsChannelList && groupChannelList) + groupChannelList->Clear(); } void cViewChannel::SetNumChannelHints(int num) { @@ -349,7 +367,7 @@ void cViewChannel::Close(void) { fader = NULL; delete shifter; shifter = NULL; - if (initFinished && ShiftTime() > 0) { + if (initFinished && viewType == dcDefault && ShiftTime() > 0) { cRect shiftbox = CoveredArea(); cPoint ref = cPoint(shiftbox.X(), shiftbox.Y()); cPoint end = ShiftStart(shiftbox); @@ -357,7 +375,7 @@ void cViewChannel::Close(void) { shifter->Shift(); delete shifter; shifter = NULL; - } else if (initFinished && FadeTime() > 0) { + } else if (initFinished && viewType == dcDefault && FadeTime() > 0) { fader = new cAnimation((cFadable*)this, false); fader->Fade(); delete fader; diff --git a/coreengine/viewdisplaychannel.h b/coreengine/viewdisplaychannel.h index aa7c278..497d327 100644 --- a/coreengine/viewdisplaychannel.h +++ b/coreengine/viewdisplaychannel.h @@ -62,6 +62,7 @@ public: #ifdef USE_ZAPCOCKPIT void SetViewType(eDisplaychannelView viewType); int MaxItems(void); + bool KeyRightOpensChannellist(void); void SetChannelInfo(const cChannel *channel); void SetChannelList(const cChannel *channel, int index, bool current); void SetGroupList(const char *group, int numChannels, int index, bool current); diff --git a/coreengine/viewlist.h b/coreengine/viewlist.h index b72123e..8e968c8 100644 --- a/coreengine/viewlist.h +++ b/coreengine/viewlist.h @@ -43,6 +43,7 @@ public: void Draw(eMenuCategory menuCat); void Clear(void); virtual void Close(void); + eButtonType Button(void) { return attribs->Button(); }; //Fadable bool Detached(void) { return false; }; int Delay(void) { return 0; }; diff --git a/displaychannel.c b/displaychannel.c index c9cc832..96e4419 100644 --- a/displaychannel.c +++ b/displaychannel.c @@ -43,6 +43,12 @@ int cSDDisplayChannel::MaxItems(void) { return view->MaxItems(); } +bool cSDDisplayChannel::KeyRightOpensChannellist(void) { + if (!ok) + return true; + return view->KeyRightOpensChannellist(); +} + void cSDDisplayChannel::SetChannelInfo(const cChannel *Channel) { if (!ok) return; diff --git a/displaychannel.h b/displaychannel.h index e0f2895..d0c7dbb 100644 --- a/displaychannel.h +++ b/displaychannel.h @@ -23,6 +23,7 @@ public: #ifdef USE_ZAPCOCKPIT virtual void SetViewType(eDisplaychannelView ViewType); virtual int MaxItems(void); + virtual bool KeyRightOpensChannellist(void); virtual void SetChannelInfo(const cChannel *Channel); virtual void SetChannelList(const cChannel *Channel, int Index, bool Current); virtual void SetGroupList(const char *Group, int NumChannels, int Index, bool Current); diff --git a/dtd/displaychannel.dtd b/dtd/displaychannel.dtd index 9ed515c..cf1aed6 100644 --- a/dtd/displaychannel.dtd +++ b/dtd/displaychannel.dtd @@ -307,6 +307,7 @@ numlistelements CDATA #REQUIRED
orientation CDATA #REQUIRED
condition CDATA #IMPLIED
+ button CDATA #IMPLIED
>
<!ELEMENT grouplist (listelement)>
@@ -325,6 +326,7 @@ numlistelements CDATA #REQUIRED
orientation CDATA #REQUIRED
condition CDATA #IMPLIED
+ button CDATA #IMPLIED
>
<!ELEMENT groupchannellist (listelement)>
diff --git a/skins/estuary4vdr/setup.xml b/skins/estuary4vdr/setup.xml index bd57312..673b25d 100644 --- a/skins/estuary4vdr/setup.xml +++ b/skins/estuary4vdr/setup.xml @@ -23,11 +23,11 @@ <parameter type="int" name="zapdetailshorttextfs" min="0" max="100" displaytext="{tr(zapdetailshorttextfs)}">80</parameter> <parameter type="int" name="zapdetaildescfs" min="0" max="100" displaytext="{tr(zapdetaildescfs)}">6</parameter> <parameter type="separator" name="sepzapcockpitcl" displaytext="{tr(sepzapcockpitcl)}"/> - <parameter type="int" name="zapclchannelfs" min="0" max="100" displaytext="{tr(zapclchannelfs)}">38</parameter> - <parameter type="int" name="zapclchannely" min="0" max="100" displaytext="{tr(zapclchannely)}">3</parameter> - <parameter type="int" name="zapclpresentfs" min="0" max="100" displaytext="{tr(zapclpresentfs)}">38</parameter> - <parameter type="int" name="zapclpresenty" min="0" max="100" displaytext="{tr(zapclpresenty)}">35</parameter> - <parameter type="int" name="zapclnextfs" min="0" max="100" displaytext="{tr(zapclnextfs)}">28</parameter> + <parameter type="int" name="zapclpresenttimefs" min="0" max="100" displaytext="{tr(zapclpresenttimefs)}">30</parameter> + <parameter type="int" name="zapclpresenttimey" min="0" max="100" displaytext="{tr(zapclpresenttimey)}">3</parameter> + <parameter type="int" name="zapclpresentfs" min="0" max="100" displaytext="{tr(zapclpresentfs)}">45</parameter> + <parameter type="int" name="zapclpresenty" min="0" max="100" displaytext="{tr(zapclpresenty)}">26</parameter> + <parameter type="int" name="zapclnextfs" min="0" max="100" displaytext="{tr(zapclnextfs)}">30</parameter> <parameter type="int" name="zapclnexty" min="0" max="100" displaytext="{tr(zapclnexty)}">70</parameter> <parameter type="int" name="zapcldetaildatetimefs" min="0" max="100" displaytext="{tr(zapcldetaildatetimefs)}">80</parameter> <parameter type="int" name="zapcldetailheaderfs" min="0" max="100" displaytext="{tr(zapcldetailheaderfs)}">80</parameter> @@ -361,15 +361,14 @@ <trans lang="de_DE">Einfahrzeit für Zapcockpit Elemente [ms]</trans> <trans lang="fi_FI">Liukuman kesto elementeille [ms]</trans> </token> - <token name="tr(zapclchannelfs)"> - <trans lang="en_EN">Font size channel</trans> - <trans lang="de_DE">Schriftgröße Kanal</trans> - <trans lang="fi_FI">Kirjasintyypin koko kanavalle</trans> + <token name="tr(zapclpresenttimefs)"> + <trans lang="en_EN">Font size remaining time present event</trans> + <trans lang="de_DE">Schriftgröße verbleibende Zeit aktuelle Sendung</trans> </token> - <token name="tr(zapclchannely)"> - <trans lang="en_EN">Vertical position channel</trans> - <trans lang="de_DE">Vertikale Position Kanal</trans> - <trans lang="fi_FI">Pystysijainti kanavalle</trans> + <token name="tr(zapclpresenttimey)"> + <trans lang="en_EN">Vertical position remaining time present event</trans> + <trans lang="de_DE">Vertikale Position verbleibende Zeit aktuelle Sendung</trans> + <trans lang="fi_FI">Pystysijainti nykyiselle ohjelmalle</trans> </token> <token name="tr(zapclpresentfs)"> <trans lang="en_EN">Font size present event</trans> diff --git a/skins/estuary4vdr/xmlfiles/displaychannel.xml b/skins/estuary4vdr/xmlfiles/displaychannel.xml index 0c3ddc1..d3be8bf 100644 --- a/skins/estuary4vdr/xmlfiles/displaychannel.xml +++ b/skins/estuary4vdr/xmlfiles/displaychannel.xml @@ -198,17 +198,18 @@ <drawrectangle condition="{current}" x="0" y="0" width="100%" height="100%" color="{menubackactive}" /> </area> <area x="1%" width="25%" layer="5"> - <drawimage name="logo" imagetype="channellogo" path="{channelid}" align="center" width="80%" height="80%" valign="center" /> + <drawimage condition="{channellogoexists}" name="logo" imagetype="channellogo" path="{channelid}" align="center" width="80%" height="80%" valign="center" /> + <drawtextbox condition="not{channellogoexists}" x="2%" width="96%" align="center" valign="center" font="{regular}" fontsize="30%" color="{fontdefault}" text="{number} {name}" maxlines="3" /> </area> <area condition="not{current}" x="26%" width="73%" layer="4"> - <drawtext x="0" y="{zapclchannely}*{areaheight}/100" font="{regular}" fontsize="{zapclchannelfs}*{areaheight}/100" color="{fontdefault}" text="{number} {name}" /> - <drawtext x="0" y="{zapclpresenty}*{areaheight}/100" font="{regular}" fontsize="{zapclpresentfs}*{areaheight}/100" color="{fontdefault}" text="+{presenteventremaining}min: {presenteventtitle}" /> - <drawtext x="0" y="{zapclnexty}*{areaheight}/100" font="{regular}" fontsize="{zapclnextfs}*{areaheight}/100" color="{fontdefault}" text="{nexteventstart} {nexteventstop}: {nexteventtitle}" /> + <drawtext x="0" y="{zapclpresenttimey}*{areaheight}/100" font="{regular}" fontsize="{zapclpresenttimefs}*{areaheight}/100" color="{fontdefault}" text="+{presenteventremaining}min" /> + <drawtext x="0" y="{zapclpresenty}*{areaheight}/100" font="{regular}" fontsize="{zapclpresentfs}*{areaheight}/100" color="{fontdefault}" text="{presenteventtitle}" /> + <drawtext x="0" y="{zapclnexty}*{areaheight}/100" font="{regular}" fontsize="{zapclnextfs}*{areaheight}/100" color="{fontdefault}" text="{nexteventstart} - {nexteventstop}: {nexteventtitle}" /> </area> <area condition="{current}" x="26%" width="73%" layer="4"> - <drawtext x="0" y="{zapclchannely}*{areaheight}/100" font="{regular}" fontsize="{zapclchannelfs}*{areaheight}/100" color="{fontmenuactive}" text="{number} {name}" /> - <drawtext x="0" y="{zapclpresenty}*{areaheight}/100" font="{regular}" fontsize="{zapclpresentfs}*{areaheight}/100" color="{fontmenuactive}" text="+{presenteventremaining}min: {presenteventtitle}" /> - <drawtext x="0" y="{zapclnexty}*{areaheight}/100" font="{regular}" fontsize="{zapclnextfs}*{areaheight}/100" color="{fontmenuactive}" text="{nexteventstart} {nexteventstop}: {nexteventtitle}" /> + <drawtext x="0" y="{zapclpresenttimey}*{areaheight}/100" font="{regular}" fontsize="{zapclpresenttimefs}*{areaheight}/100" color="{fontmenuactive}" text="+{presenteventremaining}min" /> + <drawtext x="0" y="{zapclpresenty}*{areaheight}/100" font="{regular}" fontsize="{zapclpresentfs}*{areaheight}/100" color="{fontmenuactive}" text="{presenteventtitle}" /> + <drawtext x="0" y="{zapclnexty}*{areaheight}/100" font="{regular}" fontsize="{zapclnextfs}*{areaheight}/100" color="{fontmenuactive}" text="{nexteventstart} - {nexteventstop}: {nexteventtitle}" /> </area> </listelement> </channellist> @@ -274,18 +275,19 @@ <drawrectangle condition="not{current}" x="0" y="{areaheight}-1" width="100%" height="1" color="{menubackline}" /> <drawrectangle condition="{current}" x="0" y="0" width="100%" height="100%" color="{menubackactive}" /> </area> - <area x="1%" width="25%" layer="3"> - <drawimage name="logo" imagetype="channellogo" path="{channelid}" align="center" width="80%" height="80%" valign="center" /> + <area x="1%" width="25%" layer="5"> + <drawimage condition="{channellogoexists}" name="logo" imagetype="channellogo" path="{channelid}" align="center" width="80%" height="80%" valign="center" /> + <drawtextbox condition="not{channellogoexists}" x="2%" width="96%" align="center" valign="center" font="{regular}" fontsize="30%" color="{fontdefault}" text="{number} {name}" maxlines="3" /> </area> - <area condition="not{current}" x="26%" width="73%" layer="3"> - <drawtext x="0" y="{zapclchannely}*{areaheight}/100" font="{regular}" fontsize="{zapclchannelfs}*{areaheight}/100" color="{fontdefault}" text="{number} {name}" /> - <drawtext x="0" y="{zapclpresenty}*{areaheight}/100" font="{regular}" fontsize="{zapclpresentfs}*{areaheight}/100" color="{fontdefault}" text="+{presenteventremaining}min: {presenteventtitle}" /> - <drawtext x="0" y="{zapclnexty}*{areaheight}/100" font="{regular}" fontsize="{zapclnextfs}*{areaheight}/100" color="{fontdefault}" text="{nexteventstart} {nexteventstop}: {nexteventtitle}" /> + <area condition="not{current}" x="26%" width="73%" layer="4"> + <drawtext x="0" y="{zapclpresenttimey}*{areaheight}/100" font="{regular}" fontsize="{zapclpresenttimefs}*{areaheight}/100" color="{fontdefault}" text="+{presenteventremaining}min" /> + <drawtext x="0" y="{zapclpresenty}*{areaheight}/100" font="{regular}" fontsize="{zapclpresentfs}*{areaheight}/100" color="{fontdefault}" text="{presenteventtitle}" /> + <drawtext x="0" y="{zapclnexty}*{areaheight}/100" font="{regular}" fontsize="{zapclnextfs}*{areaheight}/100" color="{fontdefault}" text="{nexteventstart} - {nexteventstop}: {nexteventtitle}" /> </area> - <area condition="{current}" x="26%" width="73%" layer="3"> - <drawtext x="0" y="{zapclchannely}*{areaheight}/100" font="{regular}" fontsize="{zapclchannelfs}*{areaheight}/100" color="{fontmenuactive}" text="{number} {name}" /> - <drawtext x="0" y="{zapclpresenty}*{areaheight}/100" font="{regular}" fontsize="{zapclpresentfs}*{areaheight}/100" color="{fontmenuactive}" text="+{presenteventremaining}min: {presenteventtitle}" /> - <drawtext x="0" y="{zapclnexty}*{areaheight}/100" font="{regular}" fontsize="{zapclnextfs}*{areaheight}/100" color="{fontmenuactive}" text="{nexteventstart} {nexteventstop}: {nexteventtitle}" /> + <area condition="{current}" x="26%" width="73%" layer="4"> + <drawtext x="0" y="{zapclpresenttimey}*{areaheight}/100" font="{regular}" fontsize="{zapclpresenttimefs}*{areaheight}/100" color="{fontmenuactive}" text="+{presenteventremaining}min" /> + <drawtext x="0" y="{zapclpresenty}*{areaheight}/100" font="{regular}" fontsize="{zapclpresentfs}*{areaheight}/100" color="{fontmenuactive}" text="{presenteventtitle}" /> + <drawtext x="0" y="{zapclnexty}*{areaheight}/100" font="{regular}" fontsize="{zapclnextfs}*{areaheight}/100" color="{fontmenuactive}" text="{nexteventstart} - {nexteventstop}: {nexteventtitle}" /> </area> </listelement> </groupchannellist> diff --git a/skinskeleton/xmlfiles/displaychannel.xml b/skinskeleton/xmlfiles/displaychannel.xml index bf2ddaa..5bfed29 100644 --- a/skinskeleton/xmlfiles/displaychannel.xml +++ b/skinskeleton/xmlfiles/displaychannel.xml @@ -330,7 +330,7 @@ {nexteventstart} start time of next event in hh:mm {nexteventstop} end time of next event in hh:mm --> - <channellist> + <channellist button="right"> </channellist> <!-- Available Variables channellistdetail: @@ -350,7 +350,7 @@ {groupname} name of displayed channel group {numchannels} number of channels in channel group --> - <grouplist> + <grouplist button="left"> </grouplist> <!-- Available Variables groupchannellistback: |
