Skip to content

Commit

Permalink
add support for uk cable epg
Browse files Browse the repository at this point in the history
Signed-off-by: Littlesat <littlesat99@yahoo.com>
  • Loading branch information
LraiZer authored and littlesat committed Jun 4, 2014
1 parent 8431499 commit ad63408
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 0 deletions.
1 change: 1 addition & 0 deletions data/setup.xml
Expand Up @@ -67,6 +67,7 @@
<item level="2" text="Enable freesat EPG" description="Use FreeSat EPG information when it is available.">config.epg.freesat</item>
<item level="2" text="Enable ViaSat EPG" description="Use ViaSat EPG information when it is available.">config.epg.viasat</item>
<item level="2" text="Enable Netmed EPG" description="Use Netmed EPG information when it is available.">config.epg.netmed</item>
<item level="2" text="Enable Virgin EPG" description="Use Virgin EPG information when it is available.">config.epg.virgin</item>
<item level="2" text="Maintain old EPG data for" description="Configure for how many minutes finished events should remain visible in the EPG. Useful when you need information about an event which has just finished, or has been delayed.">config.epg.histminutes</item>
</setup>
<setup key="subtitlesetup" title="Subtitle settings">
Expand Down
86 changes: 86 additions & 0 deletions lib/dvb/epgcache.cpp
Expand Up @@ -467,6 +467,21 @@ void eEPGCache::DVBChannelRunning(iDVBChannel *chan)
return;
}

#ifdef ENABLE_VIRGIN
res = demux->createSectionReader( this, data.m_VirginNowNextReader );
if ( res )
{
eDebug("[eEPGCache] couldnt initialize virgin nownext reader!!");
return;
}

res = demux->createSectionReader( this, data.m_VirginScheduleReader );
if ( res )
{
eDebug("[eEPGCache] couldnt initialize virgin schedule reader!!");
return;
}
#endif
#ifdef ENABLE_NETMED
res = demux->createSectionReader( this, data.m_NetmedScheduleReader );
if ( res )
Expand Down Expand Up @@ -1554,6 +1569,27 @@ void eEPGCache::channel_data::startEPG()
isRunning |= SCHEDULE_OTHER;
}

#ifdef ENABLE_VIRGIN
if (eEPGCache::getInstance()->getEpgSources() & eEPGCache::VIRGIN_NOWNEXT)
{
mask.pid = 0x2bc;
mask.data[0] = 0x4E;
mask.mask[0] = 0xFE;
m_VirginNowNextReader->connectRead(bind(slot(*this, &eEPGCache::channel_data::readData), (int)eEPGCache::VIRGIN_NOWNEXT), m_VirginNowNextConn);
m_VirginNowNextReader->start(mask);
isRunning |= VIRGIN_NOWNEXT;
}

if (eEPGCache::getInstance()->getEpgSources() & eEPGCache::VIRGIN_SCHEDULE)
{
mask.pid = 0x2bc;
mask.data[0] = 0x50;
mask.mask[0] = 0xFE;
m_VirginScheduleReader->connectRead(bind(slot(*this, &eEPGCache::channel_data::readData), (int)eEPGCache::VIRGIN_SCHEDULE), m_VirginScheduleConn);
m_VirginScheduleReader->start(mask);
isRunning |= VIRGIN_SCHEDULE;
}
#endif
#ifdef ENABLE_NETMED
if (eEPGCache::getInstance()->getEpgSources() & eEPGCache::NETMED_SCHEDULE)
{
Expand Down Expand Up @@ -1614,6 +1650,22 @@ void eEPGCache::channel_data::abortNonAvail()
m_ScheduleOtherReader->stop();
m_ScheduleOtherConn=0;
}
#ifdef ENABLE_VIRGIN
if ( !(haveData&VIRGIN_NOWNEXT) && (isRunning&VIRGIN_NOWNEXT) )
{
eDebug("[EPGC] abort non avail virgin nownext reading");
isRunning &= ~VIRGIN_NOWNEXT;
m_VirginNowNextReader->stop();
m_VirginNowNextConn=0;
}
if ( !(haveData&VIRGIN_SCHEDULE) && (isRunning&VIRGIN_SCHEDULE) )
{
eDebug("[EPGC] abort non avail virgin schedule reading");
isRunning &= ~VIRGIN_SCHEDULE;
m_VirginScheduleReader->stop();
m_VirginScheduleConn=0;
}
#endif
#ifdef ENABLE_NETMED
if ( !(haveData&NETMED_SCHEDULE) && (isRunning&NETMED_SCHEDULE) )
{
Expand Down Expand Up @@ -1736,6 +1788,20 @@ void eEPGCache::channel_data::abortEPG()
m_ScheduleOtherReader->stop();
m_ScheduleOtherConn=0;
}
#ifdef ENABLE_VIRGIN
if (isRunning & VIRGIN_NOWNEXT)
{
isRunning &= ~VIRGIN_NOWNEXT;
m_VirginNowNextReader->stop();
m_VirginNowNextConn=0;
}
if (isRunning & VIRGIN_SCHEDULE)
{
isRunning &= ~VIRGIN_SCHEDULE;
m_VirginScheduleReader->stop();
m_VirginScheduleConn=0;
}
#endif
#ifdef ENABLE_NETMED
if (isRunning & NETMED_SCHEDULE)
{
Expand Down Expand Up @@ -1817,6 +1883,16 @@ void eEPGCache::channel_data::readData( const __u8 *data, int source)
reader = m_NetmedScheduleOtherReader;
map = 2;
break;
#endif
#ifdef ENABLE_VIRGIN
case VIRGIN_NOWNEXT:
reader = m_VirginNowNextReader;
map = 0;
break;
case VIRGIN_SCHEDULE:
reader = m_VirginScheduleReader;
map = 1;
break;
#endif
default:
eDebug("[EPGC] unknown source");
Expand Down Expand Up @@ -1854,6 +1930,16 @@ void eEPGCache::channel_data::readData( const __u8 *data, int source)
m_NetmedScheduleOtherConn=0;
eDebugNoNewLine("netmed schedule other");
break;
#endif
#ifdef ENABLE_VIRGIN
case VIRGIN_NOWNEXT:
m_VirginNowNextConn=0;
eDebugNoNewLine("virgin nownext");
break;
case VIRGIN_SCHEDULE:
m_VirginScheduleConn=0;
eDebugNoNewLine("virgin schedule");
break;
#endif
default: eDebugNoNewLine("unknown");break;
}
Expand Down
9 changes: 9 additions & 0 deletions lib/dvb/epgcache.h
Expand Up @@ -5,6 +5,7 @@
#define ENABLE_MHW_EPG 1
#define ENABLE_FREESAT 1
#define ENABLE_NETMED 1
#define ENABLE_VIRGIN 1

#ifndef SWIG

Expand Down Expand Up @@ -200,6 +201,10 @@ class eEPGCache: public eMainloop, private eThread, public Object
ePtr<eConnection> m_stateChangedConn, m_NowNextConn, m_ScheduleConn, m_ScheduleOtherConn, m_ViasatConn;
ePtr<iDVBSectionReader> m_NowNextReader, m_ScheduleReader, m_ScheduleOtherReader, m_ViasatReader;
tidMap seenSections[4], calcedSections[4];
#ifdef ENABLE_VIRGIN
ePtr<eConnection> m_VirginNowNextConn, m_VirginScheduleConn;
ePtr<iDVBSectionReader> m_VirginNowNextReader, m_VirginScheduleReader;
#endif
#ifdef ENABLE_NETMED
ePtr<eConnection> m_NetmedScheduleConn, m_NetmedScheduleOtherConn;
ePtr<iDVBSectionReader> m_NetmedScheduleReader, m_NetmedScheduleOtherReader;
Expand Down Expand Up @@ -418,6 +423,10 @@ class eEPGCache: public eMainloop, private eThread, public Object
#ifdef ENABLE_NETMED
,NETMED_SCHEDULE=512
,NETMED_SCHEDULE_OTHER=1024
#endif
#ifdef ENABLE_VIRGIN
,VIRGIN_NOWNEXT=2048
,VIRGIN_SCHEDULE=4096
#endif
,EPG_IMPORT=0x80000000
};
Expand Down
4 changes: 4 additions & 0 deletions lib/python/Components/UsageConfig.py
Expand Up @@ -259,6 +259,7 @@ def wakeOnLANChanged(configElement):
config.epg.freesat = ConfigYesNo(default = True)
config.epg.viasat = ConfigYesNo(default = True)
config.epg.netmed = ConfigYesNo(default = True)
config.epg.virgin = ConfigYesNo(default = False)
config.misc.showradiopic = ConfigYesNo(default = True)
def EpgSettingsChanged(configElement):
from enigma import eEPGCache
Expand All @@ -273,12 +274,15 @@ def EpgSettingsChanged(configElement):
mask &= ~eEPGCache.VIASAT
if not config.epg.netmed.value:
mask &= ~(eEPGCache.NETMED_SCHEDULE | eEPGCache.NETMED_SCHEDULE_OTHER)
if not config.epg.virgin.value:
mask &= ~(eEPGCache.VIRGIN_NOWNEXT | eEPGCache.VIRGIN_SCHEDULE)
eEPGCache.getInstance().setEpgSources(mask)
config.epg.eit.addNotifier(EpgSettingsChanged)
config.epg.mhw.addNotifier(EpgSettingsChanged)
config.epg.freesat.addNotifier(EpgSettingsChanged)
config.epg.viasat.addNotifier(EpgSettingsChanged)
config.epg.netmed.addNotifier(EpgSettingsChanged)
config.epg.virgin.addNotifier(EpgSettingsChanged)

config.epg.histminutes = ConfigSelectionNumber(min = 0, max = 120, stepwidth = 15, default = 0, wraparound = True)
def EpgHistorySecondsChanged(configElement):
Expand Down

0 comments on commit ad63408

Please sign in to comment.