diff options
author | Jochen Dolze <vdr@dolze.de> | 2009-01-30 00:14:56 +0100 |
---|---|---|
committer | Jochen Dolze <vdr@dolze.de> | 2009-01-30 00:14:56 +0100 |
commit | 54a468314486b9c5e9ea34d36791873d54fb8365 (patch) | |
tree | 6bd9b2fa8a6f2a7afacc9acd7156281e7057f0c9 /global.cpp | |
parent | 6fb31a9477d93e019b0a2b4ef8457288ab0a40f4 (diff) | |
download | vdr-plugin-infosatepg-54a468314486b9c5e9ea34d36791873d54fb8365.tar.gz vdr-plugin-infosatepg-54a468314486b9c5e9ea34d36791873d54fb8365.tar.bz2 |
Added extened EPG
New setup for channels
Diffstat (limited to 'global.cpp')
-rw-r--r-- | global.cpp | 21 |
1 files changed, 16 insertions, 5 deletions
@@ -174,13 +174,16 @@ bool cGlobalInfosatepg::CheckMAC(struct ethhdr *eth_hdr) return true; } -void cGlobalInfosatepg::AddChannel(tChannelID ChannelID,int Usage) +void cGlobalInfosatepg::AddChannel(tChannelID ChannelID,int Usage,int Days) { infosatchannels= (struct infosatchannels *) realloc (infosatchannels, (numinfosatchannels+1) *sizeof (struct infosatchannels)); if (!infosatchannels) return; infosatchannels[numinfosatchannels].ChannelID=ChannelID; - infosatchannels[numinfosatchannels].Usage=Usage; + infosatchannels[numinfosatchannels].Usage=Usage & 0xFFFF; + if (Days<=0) Days=1; + if (Days>EPG_DAYS) Days=EPG_DAYS; + infosatchannels[numinfosatchannels].Days=Days; numinfosatchannels++; } @@ -220,23 +223,31 @@ bool cGlobalInfosatepg::ChannelExists(tChannelID ChannelID,int *Index) return false; } -bool cGlobalInfosatepg::SetChannelUse(int Index,int Usage) +bool cGlobalInfosatepg::SetChannelOptions(int Index,int Usage,int Days) { if (numinfosatchannels==0) return false; if ((Index<0) || (Index>numinfosatchannels-1)) return false; bool ret=false; - if (infosatchannels[Index].Usage!=Usage) ret=true; + if ((infosatchannels[Index].Usage!=Usage) | (infosatchannels[Index].Days!=Days)) ret=true; infosatchannels[Index].Usage=Usage; + infosatchannels[Index].Days=Days; return ret; } -int cGlobalInfosatepg::GetChannelUse(int Index) +int cGlobalInfosatepg::GetChannelUsage(int Index) { if (numinfosatchannels==0) return USE_NOTHING; if ((Index<0) || (Index>numinfosatchannels-1)) return USE_NOTHING; return infosatchannels[Index].Usage; } +int cGlobalInfosatepg::GetChannelDays(int Index) +{ + if (numinfosatchannels==0) return 0; + if ((Index<0) || (Index>numinfosatchannels-1)) return 0; + return infosatchannels[Index].Days; +} + int cGlobalInfosatepg::Save() { char file[1024]; |