vdr: (many many thanks to Andras)

- initial commit of an working for xbmc-pvr
This commit is contained in:
Stephan Raue 2010-02-09 23:36:39 +01:00
parent 934b92ea84
commit 96e2f3d361
10 changed files with 17491 additions and 6 deletions

View File

@ -23,7 +23,7 @@ cd $BUILD/$1*
cat > Make.config <<EOF
PLUGINLIBDIR=/usr/lib/vdr
VIDEODIR=/storage/Videos
CONFDIR=/etc/vdr
CONFDIR=/storage/.config/vdr
LOCDIR=/usr/share/locale
INCLUDES += -I`ls -d ../freetype-*/include`
LIBS += -liconv -lintl

View File

@ -0,0 +1,65 @@
m1;Digi:362:M256:C:6900:151=2:160=hun:170:0:5:1:7:0
m1 HD;Magyar Televízió:378000:M256:C:6900:1001=27:1002=hun;1004=hun:1003:0:300:1:9:0
m2;m2:370:M256:C:6900:100=2:101=eng:8040:0:6:1:2:0
m2 HD;Magyar Televizio:402000:M256:C:6900:1100=27:1101=hun;1102=hun:111:0:301:1:5:0
RTL Klub;Digi:370:M256:C:6900:8102=2:6021=hun:5020:0:15:1:2:0
TV 2;Digi:370:M256:C:6900:8104=2:6041=hun,6043=hun:5040:0:20:1:2:0
DunaTV;AH-EDP:370:M256:C:6900:96=2:97=hun:98:0:30:1:2:0
DunaTV HD;Duna Televizio:410000:M256:C:6900:2001=27:2002=hun:2013:0:302:1:8:0
Duna II autonómia;Duna Televizio:378:M256:C:6900:80=2:81=hun:82:0:200:1:9:0
Viasat3:402:M256:C:6900:1931=2:1932:1936:0:10:1:5:0
4! storytv;Telespazio Hungary:370:M256:C:6900:1792=2:1793=hun:1796:0:50:1:2:0
Cool;UPC Direct:362:M256:C:6900:451=2:460=hun:0:0:60:1:7:0
Film+;UPC Direct:362:M256:C:6900:751=2:760=hun:0:0:65:1:7:0
HBO 2;RCS:378:M256:C:6900:593=2:826=hun,3005=cze:0:68:2:1:9:0
AXN;Eutelsat:386:M256:C:6900:510=2:501=hun:0:0:55:1:3:0
Hallmark:386:M256:C:6900:1260=2:1220:0:0:70:1:3:0
Movies 24:386:M256:C:6900:1110=2:1100:0:0:75:1:3:0
TV Paprika;UPC Direct:370:M256:C:6900:351=2:360=hun,361=cze:370:1:90:1:2:0
National Geographic;UPC Direct:354:M256:C:6900:351=2:360=hun,362=eng:0:0:165:1:6:0
Nat Geo Wild;DMC:386:M256:C:6900:3201=2:3220=hun:0:1:170:1:3:0
Discovery Channel:386:M256:C:6900:34=2:1120:0:0:135:1:3:0
Viasat History;viasat:354:M256:C:6900:6491=2:6494=hun,6495=eng:0:0:190:1:6:0
Viasat Explorer:362:M256:C:6900:6051=2:6052=hun,6056=rus:0:0:185:1:7:0
Animal Planet:386:M256:C:6900:1160=2:1123:0:0:160:1:3:0
Investigation Discovery:410:M256:C:6900:1360=2:1319=hun:0:0:155:1:8:0
Spektrum:410:M256:C:6900:610=2:600=hun:628:0:175:1:8:0
Eurosport;Eutelsat:354:M256:C:6900:2577=2:2584=hun:2578:1:205:1:6:0
Eurosport 2;EUROSPORT:354:M256:C:6900:1001=2:1102=hun:0:1:210:1:6:0
Sport1;Digi:386:M256:C:6900:8106=2:6061=hun,6063=ROX:5060:0:215:1:3:0
Sport2;Digi:386:M256:C:6900:8103=2:6031=hun,6032=JUV:8040:0:220:1:3:0
DigiSport;Digi:402:M256:C:6900:8091=2:6091=hun:8040:0:25:1:5:0
DigiSport HD;Digi:402000:M256:C:6900:3211=27:3212=hun:0:0:26:1:5:0
H!T Music Channel;DIGI_hu:354:M256:C:6900:650=2:662=hun:0:0:115:1:6:0
Music Channel;DIGI_hu:354:M256:C:6900:200=2:212=eng:0:0:120:1:6:0
MusicMix/SuperOne;IMC:402:M256:C:6900:308+8190=2:256=eng:0:0:125:1:5:0
Nóta TV;IMC:410:M256:C:6900:4131+4387=2:4129=eng:0:0:110:1:8:0
Cartoon Network/TCM;UPC Direct:354:M256:C:6900:101=2:110=hun:120:0:95:1:6:0
Minimax;Telespazio Hungary:362:M256:C:6900:8176=2:8177=hun:772:100,929:105:1:7:0
Disney Channel;UPC Direct:410:M256:C:6900:301=2:310=hun:0:0:100:1:8:0
Zone Romantica;Arqiva:354:M256:C:6900:133=2:135=hun:0:0:80:1:6:0
Magyar ATV:362:M256:C:6900:100=2:101:110:1:35:1:7:0
Echo TV;UPC Direct:410:M256:C:6900:101=2:110=hun:0:0:45:1:8:0
­r TV;hírTV:362:M256:C:6900:200=2:201:210:1:40:1:7:0
RTL;RTL World:362:M256:C:6900:163=2:104=deu:105:0:230:1:7:0
3sat;ZDFvision:410:M256:C:6900:210=2:220=deu:230:0:245:1:8:0
VOX;RTL World:354:M256:C:6900:167=2:136=deu:71:0:235:1:6:0
Pro7;ProSiebenSat.1:354:M256:C:6900:511=2:512=deu:52:0:240:1:6:0
Rai Uno;CANALSATELLITE:354:M256:C:6900:289=2:290=ita:291:0:250:1:6:0
TV5;CANALSATELLITE:410:M256:C:6900:164=2:112=fra:60:0:255:1:8:0
TVE;CANALSATELLITE:410:M256:C:6900:58=2:59:0:0:260:1:8:0
Sky News;SES ASTRA:410:M256:C:6900:1290+6290=2:2290=eng:5290:0:265:1:8:0
HBO;RCS:378:M256:C:6900:596=2:829=hun:0:1:1:1:9:0
HBO Comedy;RCS:378:M256:C:6900:4044=2:1893=hun,4045=rom,5000=cze:0:10:3:1:9:0
Cinemax;RCS:378:M256:C:6900:523=2:673=hun,789=eng,3004=cze:0:1801,1802,1880:4:1:9:0
MR1-Kossuth;AH-EDP:370:M256:C:6900:0:99=hun:0:0:7211:1:2:0
MR2-Petofi;AH-EDP:370:M256:C:6900:0:32=hun:0:0:7212:1:2:0
MR4/MR5;AH-EDP:370:M256:C:6900:0:33=hun:0:0:7219:1:2:0
MR3 Bartok;Magyar Radio:370:M256:C:6900:0:901=hun:0:0:15531:1:2:0
Zone Reality;DMC:394000:M256:C:6900:2301=2:2310=hun:0:0:85:1:4:0
PV TV;RCS:394000:M256:C:6900:4004=2:787=rom,999=eng,2008=bul,7000=hun:0:0:130:1:4:0
Discovery Science:394000:M256:C:6900:1960=2:1921:0:0:140:1:4:0
Discovery Travel & Living:394000:M256:C:6900:1860=2:1821:0:0:145:1:4:0
Discovery World:394000:M256:C:6900:1060=2:1021:0:0:150:1:4:0
Travel Channel;Arqiva:394000:M256:C:6900:2001=2:2002=hun+cze:0:0:180:1:4:0
SportKlub;Digi:394000:M256:C:6900:8000=2:8001=sve:8040:0:225:1:4:0

View File

@ -0,0 +1,73 @@
# DiSEqC configuration for VDR
#
# Format:
#
# satellite slof polarization lof command...
#
# satellite: one of the 'S' codes defined in sources.conf
# slof: switch frequency of LNB; the first entry with
# an slof greater than the actual transponder
# frequency will be used
# polarization: V = vertical, H = horizontal, L = Left circular, R = Right circular
# lof: the local oscillator frequency to subtract from
# the actual transponder frequency
# command:
# t tone off
# T tone on
# v voltage low (13V)
# V voltage high (18V)
# A mini A
# B mini B
# Wnn wait nn milliseconds (nn may be any positive integer number)
# [xx ...] hex code sequence (max. 6)
#
# The 'command...' part is optional.
#
# Examples:
# Full DiSEqC sequence:
S19.2E 11700 V 9750 t v W15 [E0 10 38 F0] W15 A W15 t
S19.2E 99999 V 10600 t v W15 [E0 10 38 F1] W15 A W15 T
S19.2E 11700 H 9750 t V W15 [E0 10 38 F2] W15 A W15 t
S19.2E 99999 H 10600 t V W15 [E0 10 38 F3] W15 A W15 T
S13.0E 11700 V 9750 t v W15 [E0 10 38 F4] W15 B W15 t
S13.0E 99999 V 10600 t v W15 [E0 10 38 F5] W15 B W15 T
S13.0E 11700 H 9750 t V W15 [E0 10 38 F6] W15 B W15 t
S13.0E 99999 H 10600 t V W15 [E0 10 38 F7] W15 B W15 T
# Optimized for mini DiSEqC (aka toneburst):
#
# S19.2E 11700 V 9750 t v W15 A W15 t
# S19.2E 99999 V 10600 t v W15 A W15 T
# S19.2E 11700 H 9750 t V W15 A W15 t
# S19.2E 99999 H 10600 t V W15 A W15 T
#
# S13.0E 11700 V 9750 t v W15 B W15 t
# S13.0E 99999 V 10600 t v W15 B W15 T
# S13.0E 11700 H 9750 t V W15 B W15 t
# S13.0E 99999 H 10600 t V W15 B W15 T
#
# Optimized for full DiSEqC:
#
# S19.2E 11700 V 9750 [E0 10 38 F0]
# S19.2E 99999 V 10600 [E0 10 38 F1]
# S19.2E 11700 H 9750 [E0 10 38 F2]
# S19.2E 99999 H 10600 [E0 10 38 F3]
#
# S13.0E 11700 V 9750 [E0 10 38 F4]
# S13.0E 99999 V 10600 [E0 10 38 F5]
# S13.0E 11700 H 9750 [E0 10 38 F6]
# S13.0E 99999 H 10600 [E0 10 38 F7]
#
# DisiCon-4 Single Cable Network:
#
# horizontal: 11.704 - 12.205 GHz (1. IF: 1144 - 1645 MHz) - LOF 1 (10,56 GHz)
# horizontal: 12.676 - 12.709 GHz (1. IF: 2116 - 2148 MHz) - LOF 1 (10,56 GHz)
# vertical: 12.035 - 12.107 GHz (1. IF: 955 - 1027 MHz) - LOF 3 (11,08 GHz)
# vertical: 12.464 - 12.716 GHz (1. IF: 1744 - 1996 MHz) - LOF 2 (10,72 GHz)
#
# S19.2E 99999 H 10560 t v
# S19.2E 12110 V 11080 t v
# S19.2E 99999 V 10720 t v

View File

@ -0,0 +1,13 @@
# Remote control key macros for VDR
#
# Format:
#
# macrokey key1 key2 key3...
# macrokey @plugin key1 key2 key3...
#
# See man vdr(5)
Red Recordings
Green Schedule
Yellow Info
Blue Timers

View File

@ -0,0 +1,13 @@
#
# svdrphosts This file describes a number of host addresses that
# are allowed to connect to the SVDRP port of the Video
# Disk Recorder (VDR) running on this system.
# Syntax:
#
# IP-Address[/Netmask]
#
127.0.0.1 # always accept localhost
#192.168.100.0/24 # any host on the local net
#204.152.189.113 # a specific host
#0.0.0.0/0 # any host on any net (USE THIS WITH CARE!)

View File

@ -9,7 +9,7 @@
echo "### Starting VDR ###"
PLUGINS=""
for file in /etc/vdr/plugins.d/*; do
for file in /storage/.config/vdr/plugins.d/*; do
# plugins are enabled by default
PLUGIN=""
OPTIONS=""

View File

@ -26,7 +26,12 @@ done
# mkdir -p $INSTALL/etc
# cp $PACKAGES/$1/config/wakeup $INSTALL/etc
mkdir -p $INSTALL/etc/vdr/plugins
mkdir -p $INSTALL/etc/vdr/plugins.d
cp -a $PKG_BUILD/*.conf $INSTALL/etc/vdr
[ "$SERVICES" = yes ] && echo '0.0.0.0/0' >> $INSTALL/etc/vdr/svdrphosts.conf
mkdir -p $INSTALL/usr/config/vdr
mkdir -p $INSTALL/usr/config/vdr/plugins
mkdir -p $INSTALL/usr/config/vdr/plugins.d
cp -a $PKG_DIR/config/*.conf $INSTALL/usr/config/vdr
[ "$SERVICES" = yes ] && echo '0.0.0.0/0' >> $INSTALL/usr/config/vdr/svdrphosts.conf
$SCRIPTS/install vdr-streamdev

View File

@ -0,0 +1,402 @@
diff -rupN vdr-1.7.11/config.c vdr-1.7.11.gotox_patched/config.c
--- vdr-1.7.11/config.c 2009-12-05 16:30:30.000000000 +0100
+++ vdr-1.7.11.gotox_patched/config.c 2010-01-06 23:57:02.650640016 +0100
@@ -231,6 +231,11 @@ cSetup::cSetup(void)
LnbFrequLo = 9750;
LnbFrequHi = 10600;
DiSEqC = 0;
+ UseGotox = 0;
+ GotoxSpeed = 100;
+ GotoxRepeat = 0;
+ GotoxSN = 0; GotoxLat = 613; GotoxEW = 1; GotoxLong = 236; // Somewhere at Tampere, Finland :^)
+ GotoxPrevSource = 0;
SetSystemTime = 0;
TimeSource = 0;
TimeTransponder = 0;
@@ -418,6 +423,14 @@ bool cSetup::Parse(const char *Name, con
else if (!strcasecmp(Name, "LnbFrequLo")) LnbFrequLo = atoi(Value);
else if (!strcasecmp(Name, "LnbFrequHi")) LnbFrequHi = atoi(Value);
else if (!strcasecmp(Name, "DiSEqC")) DiSEqC = atoi(Value);
+ else if (!strcasecmp(Name, "UseGotox")) UseGotox = atoi(Value);
+ else if (!strcasecmp(Name, "GotoxSpeed")) GotoxSpeed = atoi(Value);
+ else if (!strcasecmp(Name, "GotoxRepeat")) GotoxRepeat = atoi(Value);
+ else if (!strcasecmp(Name, "GotoxSN")) GotoxSN = atoi(Value);
+ else if (!strcasecmp(Name, "GotoxLat")) GotoxLat = atoi(Value);
+ else if (!strcasecmp(Name, "GotoxEW")) GotoxEW = atoi(Value);
+ else if (!strcasecmp(Name, "GotoxLong")) GotoxLong = atoi(Value);
+ else if (!strcasecmp(Name, "GotoxPrevSource")) GotoxPrevSource = atoi(Value);
else if (!strcasecmp(Name, "SetSystemTime")) SetSystemTime = atoi(Value);
else if (!strcasecmp(Name, "TimeSource")) TimeSource = cSource::FromString(Value);
else if (!strcasecmp(Name, "TimeTransponder")) TimeTransponder = atoi(Value);
@@ -510,6 +523,14 @@ bool cSetup::Save(void)
Store("LnbFrequLo", LnbFrequLo);
Store("LnbFrequHi", LnbFrequHi);
Store("DiSEqC", DiSEqC);
+ Store("UseGotox", UseGotox);
+ Store("GotoxSpeed", GotoxSpeed);
+ Store("GotoxRepeat", GotoxRepeat);
+ Store("GotoxSN", GotoxSN);
+ Store("GotoxLat", GotoxLat);
+ Store("GotoxEW", GotoxEW);
+ Store("GotoxLong", GotoxLong);
+ Store("GotoxPrevSource", GotoxPrevSource);
Store("SetSystemTime", SetSystemTime);
Store("TimeSource", cSource::ToString(TimeSource));
Store("TimeTransponder", TimeTransponder);
diff -rupN vdr-1.7.11/config.h vdr-1.7.11.gotox_patched/config.h
--- vdr-1.7.11/config.h 2009-11-22 20:55:04.000000000 +0100
+++ vdr-1.7.11.gotox_patched/config.h 2010-01-06 23:57:02.650640016 +0100
@@ -215,6 +215,14 @@ public:
int LnbFrequLo;
int LnbFrequHi;
int DiSEqC;
+ int GotoxRepeat;
+ int GotoxSN;
+ int GotoxEW;
+ int GotoxSpeed;
+ int GotoxLat;
+ int GotoxLong;
+ int UseGotox;
+ int GotoxPrevSource;
int SetSystemTime;
int TimeSource;
int TimeTransponder;
diff -rupN vdr-1.7.11/diseqc.c vdr-1.7.11.gotox_patched/diseqc.c
--- vdr-1.7.11/diseqc.c 2009-12-05 16:57:02.000000000 +0100
+++ vdr-1.7.11.gotox_patched/diseqc.c 2010-01-06 23:57:02.650640016 +0100
@@ -114,6 +114,7 @@ cDiseqc::eDiseqcActions cDiseqc::Execute
case 'V': return daVoltage18;
case 'A': return daMiniA;
case 'B': return daMiniB;
+ case 'G': return daGotoX;
case 'W': *CurrentAction = Wait(*CurrentAction); break;
case '[': *CurrentAction = Codes(*CurrentAction); return *CurrentAction ? daCodes : daNone;
default: return daNone;
diff -rupN vdr-1.7.11/diseqc.h vdr-1.7.11.gotox_patched/diseqc.h
--- vdr-1.7.11/diseqc.h 2002-12-07 14:54:02.000000000 +0100
+++ vdr-1.7.11.gotox_patched/diseqc.h 2010-01-06 23:57:02.650640016 +0100
@@ -22,6 +22,7 @@ public:
daVoltage18,
daMiniA,
daMiniB,
+ daGotoX,
daCodes,
};
enum { MaxDiseqcCodes = 6 };
diff -rupN vdr-1.7.11/dvbdevice.c vdr-1.7.11.gotox_patched/dvbdevice.c
--- vdr-1.7.11/dvbdevice.c 2010-01-04 15:06:24.000000000 +0100
+++ vdr-1.7.11.gotox_patched/dvbdevice.c 2010-01-06 23:57:39.170642833 +0100
@@ -14,9 +14,11 @@
#include <linux/dvb/frontend.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
+#include <math.h>
#include "channels.h"
#include "diseqc.h"
#include "dvbci.h"
+#include "skins.h"
#define DVBS_TUNE_TIMEOUT 9000 //ms
#define DVBS_LOCK_TIMEOUT 2000 //ms
@@ -149,6 +151,95 @@ static unsigned int FrequencyToHz(unsign
return f;
}
+void HandleGotox(int fd_frontend, int new_source)
+{
+
+ int gotoXTable[10] = { 0x00, 0x02, 0x03, 0x05, 0x06, 0x08, 0x0A, 0x0B, 0x0D, 0x0E };
+ int satlong;
+ int satprev;
+ float waitseconds = 0;
+
+ if (Setup.UseGotox == 0)
+ return;
+
+ // Check if zapped into new source position?
+ if (new_source != Setup.GotoxPrevSource) {
+ satlong = (new_source & ~0xC800);
+ satprev = (Setup.GotoxPrevSource & ~0xC800);
+ if ((new_source & 0xC000) != 0x8000)
+ return; // Fail
+ if (new_source & 0x0800)
+ satlong = satlong * (-1);
+ if (Setup.GotoxPrevSource & 0x0800)
+ satprev = satprev * (-1);
+ if (Setup.GotoxSpeed > 0) {
+ waitseconds = fabs(satlong-satprev)/(float)(Setup.GotoxSpeed);
+ if (waitseconds < 0.0) waitseconds = 0.0; // Should not happen but ...
+ if (waitseconds > 60.0) waitseconds = 60.0; // Limit wait time to 60s
+ }
+ int Long=Setup.GotoxEW ? -Setup.GotoxLong : Setup.GotoxLong;
+ int Lat=Setup.GotoxSN ? -Setup.GotoxLat : Setup.GotoxLat;
+ double azimuth=M_PI+atan(tan((satlong-Long)*M_PI/1800)/sin(Lat*M_PI/1800));
+ double x=acos(cos((satlong-Long)*M_PI/1800)*cos(Lat*M_PI/1800));
+ double elevation=atan((cos(x)-0.1513)/sin(x));
+ double SatHourangle=180+atan((-cos(elevation)*sin(azimuth))/(sin(elevation)*cos(Lat*M_PI/1800)
+ -cos(elevation)*sin(Lat*M_PI/1800)*cos(azimuth)))*180/M_PI;
+ int tmp=(int)(fabs(180-SatHourangle)*10);
+ tmp=(tmp/10)*0x10 + gotoXTable[ tmp % 10 ];
+ int p2=(tmp%0x0100);
+ int p1=(tmp/0x0100);
+ if (SatHourangle < 180)
+ p1 |= 0xe0;
+ else
+ p1 |= 0xd0;
+
+ dsyslog("DiSEqC GotoX %d (%d) -> %d (%d), wait time %4.1fs",
+ satprev, Setup.GotoxPrevSource, satlong, new_source, waitseconds);
+
+#if 1
+ // Set high LNB voltage and tone off, then wait > 15ms
+ CHECK(ioctl(fd_frontend, FE_SET_VOLTAGE, SEC_VOLTAGE_18));
+ CHECK(ioctl(fd_frontend, FE_SET_TONE, SEC_TONE_OFF));
+ usleep(20000);
+
+ // Send 1st GotoX command, then wait > 15ms
+ uchar gotox_bytes[5] = { 0xe0, 0x31, 0x6e, p1, p2};
+ struct dvb_diseqc_master_cmd gotox_cmd;
+ memcpy(gotox_cmd.msg, gotox_bytes, 5);
+ gotox_cmd.msg_len = 5;
+ CHECK(ioctl(fd_frontend, FE_DISEQC_SEND_MASTER_CMD, &gotox_cmd));
+ usleep(20000);
+
+ // Send repeated GotoX command, then wait > 15ms
+ if (Setup.GotoxRepeat) {
+ gotox_bytes[0] = 0xe1;
+ memcpy(gotox_cmd.msg, gotox_bytes, 5);
+ CHECK(ioctl(fd_frontend, FE_DISEQC_SEND_MASTER_CMD, &gotox_cmd));
+ usleep(20000);
+ }
+
+ {
+ char mess_move[60];
+ snprintf(mess_move,sizeof(mess_move),"Moving dish to %d.%d%s - %ds", \
+ (new_source & 0x0800)?-satlong/10:satlong/10, \
+ (new_source & 0x0800)?-satlong%10:satlong%10, \
+ (new_source & 0x0800)?"E":"W", (int)waitseconds);
+ // Wait for dish movement and display message approx. for that time
+ Skins.QueueMessage(mtWarning, mess_move, int(1 + waitseconds - Setup.ChannelInfoTime), 0);
+ while (waitseconds > 0.0) {
+ usleep(100000); // 100ms
+ waitseconds = waitseconds - 100e-3;
+ }
+ }
+
+#endif
+
+ Setup.GotoxPrevSource = new_source;
+ dsyslog("DiSEqC GotoX done.");
+ }
+}
+
+
bool cDvbTuner::SetFrontend(void)
{
#define MAXFRONTENDCMDS 16
@@ -187,6 +278,7 @@ bool cDvbTuner::SetFrontend(void)
case cDiseqc::daVoltage18: CHECK(ioctl(fd_frontend, FE_SET_VOLTAGE, SEC_VOLTAGE_18)); break;
case cDiseqc::daMiniA: CHECK(ioctl(fd_frontend, FE_DISEQC_SEND_BURST, SEC_MINI_A)); break;
case cDiseqc::daMiniB: CHECK(ioctl(fd_frontend, FE_DISEQC_SEND_BURST, SEC_MINI_B)); break;
+ case cDiseqc::daGotoX: HandleGotox(fd_frontend, channel.Source()); break;
case cDiseqc::daCodes: {
int n = 0;
uchar *codes = diseqc->Codes(n);
@@ -211,6 +303,10 @@ bool cDvbTuner::SetFrontend(void)
}
}
else {
+ // Send GotoX DiSEqC command if activated in vdr setup. Then wait with high LNB voltage
+ // estimated time for dish movement
+ HandleGotox(fd_frontend, channel.Source());
+
int tone = SEC_TONE_OFF;
if (frequency < (unsigned int)Setup.LnbSLOF) {
frequency -= Setup.LnbFrequLo;
diff -rupN vdr-1.7.11/menu.c vdr-1.7.11.gotox_patched/menu.c
--- vdr-1.7.11/menu.c 2009-12-06 12:29:05.000000000 +0100
+++ vdr-1.7.11.gotox_patched/menu.c 2010-01-06 23:57:02.662652058 +0100
@@ -2541,8 +2541,14 @@ void cMenuSetupLNB::Setup(void)
Add(new cMenuEditIntItem( tr("Setup.LNB$SLOF (MHz)"), &data.LnbSLOF));
Add(new cMenuEditIntItem( tr("Setup.LNB$Low LNB frequency (MHz)"), &data.LnbFrequLo));
Add(new cMenuEditIntItem( tr("Setup.LNB$High LNB frequency (MHz)"), &data.LnbFrequHi));
- }
-
+ }
+ Add(new cMenuEditBoolItem(tr("Setup.LNB$Use GotoX dish positioning"), &data.UseGotox));
+ if (data.UseGotox) {
+ Add(new cMenuEditBoolItem(tr("Setup.LNB$Repeat GotoX commands"), &data.GotoxRepeat));
+ Add(new cMenuEditIntpItem(tr("Setup.LNB$Latitude"), &data.GotoxLat,0,900,&data.GotoxSN,tr("North"),tr("South")));
+ Add(new cMenuEditIntpItem(tr("Setup.LNB$Longitude"), &data.GotoxLong,0,1800,&data.GotoxEW,tr("West"),tr("East")));
+ Add(new cMenuEditIntdItem(tr("Setup.LNB$Rotor speed (deg/s)"), &data.GotoxSpeed, 1, 100));
+ }
SetCurrent(Get(current));
Display();
}
@@ -2550,10 +2556,15 @@ void cMenuSetupLNB::Setup(void)
eOSState cMenuSetupLNB::ProcessKey(eKeys Key)
{
int oldDiSEqC = data.DiSEqC;
+ int oldUseGotox = data.UseGotox;
eOSState state = cMenuSetupBase::ProcessKey(Key);
if (Key != kNone && data.DiSEqC != oldDiSEqC)
Setup();
+
+ if (Key != kNone && data.UseGotox != oldUseGotox)
+ Setup();
+
return state;
}
diff -rupN vdr-1.7.11/menuitems.c vdr-1.7.11.gotox_patched/menuitems.c
--- vdr-1.7.11/menuitems.c 2009-12-06 12:31:20.000000000 +0100
+++ vdr-1.7.11.gotox_patched/menuitems.c 2010-01-06 23:57:02.662652058 +0100
@@ -1106,3 +1106,121 @@ void cMenuSetupPage::SetupStore(const ch
if (plugin)
plugin->SetupStore(Name, Value);
}
+
+// cMenuEditIntpItem & cMenuEditIntdItem for GotoX function
+
+void cMenuEditIntpItem::Set(void)
+{
+ char buf[16];
+ snprintf(buf, sizeof(buf), "%d.%d %s", *value/10, *value % 10, *value2 ? trueString : falseString);
+ SetValue(buf);
+}
+
+void cMenuEditIntdItem::Set(void)
+{
+ char buf[16];
+ snprintf(buf, sizeof(buf), "%d.%d", *value/10, *value % 10);
+ SetValue(buf);
+}
+
+
+cMenuEditIntpItem::cMenuEditIntpItem(const char *Name, int *Value, int Min, int Max,int *Value2, const char *FalseString,const char *TrueString):cMenuEditIntItem(Name, Value, Min, Max)
+{
+ value = Value;
+ value2= Value2;
+ trueString = TrueString;
+ falseString = FalseString;
+ min = Min;
+ max = Max;
+ Set();
+}
+
+cMenuEditIntdItem::cMenuEditIntdItem(const char *Name, int *Value, int Min, int Max):cMenuEditIntItem(Name, Value, Min, Max)
+{
+ value = Value;
+ min = Min;
+ max = Max;
+ Set();
+}
+
+eOSState cMenuEditIntpItem::ProcessKey(eKeys Key)
+{
+ eOSState state = cMenuEditItem::ProcessKey(Key);
+ if (state == osUnknown)
+ {
+ int newValue = *value;
+ int newValue2= *value2;
+ Key = NORMALKEY(Key);
+ switch (Key) {
+ case kNone : break;
+ case k0...k9:
+ if (fresh)
+ {
+ *value = 0;
+ fresh = false;
+ }
+ newValue = *value * 10 + (Key - k0);
+ break;
+ case kLeft :
+ newValue2 = 0;
+ fresh = true;
+ break;
+ case kRight :
+ newValue2 = 1;
+ fresh = true;
+ break;
+ default :
+ if (*value < min) { *value = min; Set(); }
+ if (*value > max) { *value = max; Set(); }
+ return state;
+ }
+ if ((!fresh || min <= newValue) && newValue <= max)
+ {
+ *value = newValue;
+ *value2 = newValue2;
+ Set();
+ }
+ state = osContinue;
+ }
+ return state;
+}
+
+eOSState cMenuEditIntdItem::ProcessKey(eKeys Key)
+{
+ eOSState state = cMenuEditItem::ProcessKey(Key);
+ if (state == osUnknown)
+ {
+ int newValue = *value;
+ Key = NORMALKEY(Key);
+ switch (Key) {
+ case kNone : break;
+ case k0...k9:
+ if (fresh)
+ {
+ *value = 0;
+ fresh = false;
+ }
+ newValue = *value * 10 + (Key - k0);
+ break;
+ case kLeft :
+ newValue = *value - 1;
+ fresh = true;
+ break;
+ case kRight :
+ newValue = *value + 1;
+ fresh = true;
+ break;
+ default :
+ if (*value < min) { *value = min; Set(); }
+ if (*value > max) { *value = max; Set(); }
+ return state;
+ }
+ if ((!fresh || min <= newValue) && newValue <= max)
+ {
+ *value = newValue;
+ Set();
+ }
+ state = osContinue;
+ }
+ return state;
+}
diff -rupN vdr-1.7.11/menuitems.h vdr-1.7.11.gotox_patched/menuitems.h
--- vdr-1.7.11/menuitems.h 2009-05-03 14:50:34.000000000 +0200
+++ vdr-1.7.11.gotox_patched/menuitems.h 2010-01-06 23:57:02.666651684 +0100
@@ -199,4 +199,22 @@ public:
void SetPlugin(cPlugin *Plugin);
};
+class cMenuEditIntpItem : public cMenuEditIntItem {
+protected:
+ virtual void Set(void);
+ const char *falseString, *trueString;
+ int *value2;
+public:
+ cMenuEditIntpItem(const char *Name, int *Value, int Min = 0, int Max = INT_MAX, int *Value2=0, const char *FalseString = "", const char *TrueSting = NULL);
+ virtual eOSState ProcessKey(eKeys Key);
+};
+
+class cMenuEditIntdItem : public cMenuEditIntItem {
+protected:
+ virtual void Set(void);
+public:
+ cMenuEditIntdItem(const char *Name, int *Value, int Min = 0, int Max = INT_MAX);
+ virtual eOSState ProcessKey(eKeys Key);
+};
+
#endif //__MENUITEMS_H

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,46 @@
diff -NaurwB vdr-1.7.7/epg.c vdr-1.7.7-patched/epg.c
--- vdr-1.7.7/epg.c 2009-06-13 01:01:25.000000000 +0200
+++ vdr-1.7.7-patched/epg.c 2009-11-07 20:40:34.000000000 +0100
@@ -630,6 +630,17 @@
fprintf(f, "%sX %s\n", Prefix, *p->ToString());
}
}
+#ifdef USE_PARENTALRATING
+ if (!isempty(GetContentsString())) {
+ for (int i = 0; i < MAXEVCONTENTS; i++) {
+ if (!isempty(GetContentsString(i))) {
+ strreplace(description, '\n', '|');
+ fprintf(f, "%sG %i %i %s\n",Prefix, Contents(i) & 0xF0, Contents(i) & 0x0F, (const char *)GetContentsString(i));
+ strreplace(description, '|', '\n');
+ }
+ }
+ }
+#endif /* PARENTALRATING */
if (vps)
fprintf(f, "%sV %ld\n", Prefix, vps);
if (!InfoOnly)
@@ -697,6 +708,24 @@
}
}
break;
+#ifdef USE_PARENTALRATING
+ case 'G': if (Event) {
+ unsigned int ContentID = 0;
+ unsigned int ContentSubID = 0;
+ int n = sscanf(t, "%u %u", &ContentID, &ContentSubID);
+ if (n == 2) {
+ if (ContentID != 0) {
+ for (int i = 0; i < MAXEVCONTENTS; i++) {
+ if (Event->Contents(i) == 0) {
+ Event->contents[i] = ContentID | ContentSubID;
+ break;
+ }
+ }
+ }
+ }
+ }
+ break;
+#endif /* PARENTALRATING */
case 'e': if (Event && !Event->Title())
Event->SetTitle(tr("No title"));
Event = NULL;