[vdr] [PATCH] Make RGYB buttons customizable

2012-07-19 Thread Oliver Schinagl
Ages ago (2012-09-16 04:05) I wrote a patch against VDR 1.6. There was some
discussion about this subject but died away without anything really.

I rewrote the patch against current git (1.7.29) so should be applyable.


VDR currently assumes all remote controls have the same order of buttons.
This is not always the case. This patch allows you to change the order
of buttons in the UI.

This feature obviously only works on patched skins. Classic, lcars and
sttng skins are patched. Unpatched skins will remain to work fine, but
will ignore button order. Patching of the skin takes very minimum effort.

config.*: Load/Save Button information
menu.c  : Add button selection to the UI
skin*.c : Use button order from the config file

Signed-off-by: Oliver Schinagl oli...@schinagl.nl
---
 config.c  |   12 
 config.h  |4 
 menu.c|9 +
 skinclassic.c |   11 +++
 skinlcars.c   |   19 +++
 skinsttng.c   |   11 +++
 6 files changed, 50 insertions(+), 16 deletions(-)

diff --git a/config.c b/config.c
index 56454df..165bcee 100644
--- a/config.c
+++ b/config.c
@@ -424,6 +424,10 @@ cSetup::cSetup(void)
   UseDolbyDigital = 1;
   ChannelInfoPos = 0;
   ChannelInfoTime = 5;
+  Button0 = 0;
+  Button1 = 1;
+  Button2 = 2;
+  Button3 = 3;
   OSDLeftP = 0.03;
   OSDTopP = 0.03;
   OSDWidthP = 0.93;
@@ -620,6 +624,10 @@ bool cSetup::Parse(const char *Name, const char *Value)
   else if (!strcasecmp(Name, UseDolbyDigital)) UseDolbyDigital= 
atoi(Value);
   else if (!strcasecmp(Name, ChannelInfoPos))  ChannelInfoPos = 
atoi(Value);
   else if (!strcasecmp(Name, ChannelInfoTime)) ChannelInfoTime= 
atoi(Value);
+  else if (!strcasecmp(Name, Button0)) Button0= 
atoi(Value);
+  else if (!strcasecmp(Name, Button1)) Button1= 
atoi(Value);
+  else if (!strcasecmp(Name, Button2)) Button2= 
atoi(Value);
+  else if (!strcasecmp(Name, Button3)) Button3= 
atoi(Value);
   else if (!strcasecmp(Name, OSDLeftP))OSDLeftP   = 
atof(Value);
   else if (!strcasecmp(Name, OSDTopP)) OSDTopP= 
atof(Value);
   else if (!strcasecmp(Name, OSDWidthP)) { OSDWidthP  = 
atof(Value); ChkDoublePlausibility(OSDWidthP, 0.87); }
@@ -719,6 +727,10 @@ bool cSetup::Save(void)
   Store(UseDolbyDigital,UseDolbyDigital);
   Store(ChannelInfoPos, ChannelInfoPos);
   Store(ChannelInfoTime,ChannelInfoTime);
+  Store(Button0,Button0);
+  Store(Button1,Button1);
+  Store(Button2,Button2);
+  Store(Button3,Button3);
   Store(OSDLeftP,   OSDLeftP);
   Store(OSDTopP,OSDTopP);
   Store(OSDWidthP,  OSDWidthP);
diff --git a/config.h b/config.h
index acdf77a..3dd86ae 100644
--- a/config.h
+++ b/config.h
@@ -294,6 +294,10 @@ public:
   int UseDolbyDigital;
   int ChannelInfoPos;
   int ChannelInfoTime;
+  int Button0;
+  int Button1;
+  int Button2;
+  int Button3;
   double OSDLeftP, OSDTopP, OSDWidthP, OSDHeightP;
   int OSDLeft, OSDTop, OSDWidth, OSDHeight;
   double OSDAspect;
diff --git a/menu.c b/menu.c
index 9f4c54e..d7bce03 100644
--- a/menu.c
+++ b/menu.c
@@ -2510,6 +2510,7 @@ void cMenuSetupBase::Store(void)
 class cMenuSetupOSD : public cMenuSetupBase {
 private:
   const char *useSmallFontTexts[3];
+  const char *buttonColorTexts[4];
   int osdLanguageIndex;
   int numSkins;
   int originalSkinIndex;
@@ -2560,12 +2561,20 @@ void cMenuSetupOSD::Set(void)
   useSmallFontTexts[0] = tr(never);
   useSmallFontTexts[1] = tr(skin dependent);
   useSmallFontTexts[2] = tr(always);
+  buttonColorTexts[0] = tr(Key$Red);
+  buttonColorTexts[1] = tr(Key$Green);
+  buttonColorTexts[2] = tr(Key$Yellow);
+  buttonColorTexts[3] = tr(Key$Blue);
   Clear();
   SetSection(tr(OSD));
   Add(new cMenuEditStraItem(tr(Setup.OSD$Language),   
osdLanguageIndex, I18nNumLanguagesWithLocale(), I18nLanguages()-At(0)));
   Add(new cMenuEditStraItem(tr(Setup.OSD$Skin),   
skinIndex, numSkins, skinDescriptions));
   if (themes.NumThemes())
   Add(new cMenuEditStraItem(tr(Setup.OSD$Theme),  
themeIndex, themes.NumThemes(), themes.Descriptions()));
+  Add(new cMenuEditStraItem(tr(Setup.OSD$Button0),
data.Button0, 4, buttonColorTexts));
+  Add(new cMenuEditStraItem(tr(Setup.OSD$Button0),
data.Button1, 4, buttonColorTexts));
+  Add(new cMenuEditStraItem(tr(Setup.OSD$Button0),
data.Button2, 4, buttonColorTexts));
+  Add(new cMenuEditStraItem(tr(Setup.OSD$Button0),
data.Button3, 4, buttonColorTexts));
   Add(new cMenuEditPrcItem( tr(Setup.OSD$Left (%)),   
data.OSDLeftP, 0.0, 0.5));
   Add(new cMenuEditPrcItem( tr(Setup.OSD$Top (%)),
data.OSDTopP, 0.0, 0.5));
   Add(new cMenuEditPrcItem( tr(Setup.OSD$Width (%)),  

[vdr] Usage of libsi

2012-07-19 Thread 林聖雄
In my use case, I needs the libsi to parse the DVB-SI section that I
interesed. So are there some simple demo programs that demonstrate how to
use this library?
Like read data from /dev/dvb/adapter0/frontend0 and parse it by this
library and get the some sections.

dowloaded package: vdr-1.7.23.tar.bz2

Tim
___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr