left / right keys in zappilot configurable in skin

This commit is contained in:
louis 2016-05-29 10:07:28 +02:00
parent 75668612be
commit 87f3d895f7
14 changed files with 84 additions and 34 deletions

View File

@ -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
***************************************************************************/

View File

@ -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);

View File

@ -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) {

View File

@ -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);
};
/******************************************************************

View File

@ -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

View File

@ -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;

View File

@ -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);

View File

@ -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; };

View File

@ -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;

View File

@ -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);

View File

@ -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)>

View File

@ -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>

View File

@ -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>

View File

@ -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: