Modifications by Lraizer to allow for EPG data to be gathered on UK cable
--- a/data/setup.xml 2014-05-20 23:37:48.000000000 +0100 +++ b/data/setup.xml 2014-05-29 20:05:34.638320494 +0100 @@ -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"> --- a/lib/dvb/epgcache.cpp 2014-05-20 23:37:48.000000000 +0100 +++ b/lib/dvb/epgcache.cpp 2014-05-22 14:38:18.000000000 +0100 @@ -466,7 +466,21 @@ eDebug("[eEPGCache] couldnt initialize schedule other reader!!"); 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 ) @@ -1553,7 +1567,26 @@ m_ScheduleOtherReader->start(mask); 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) { @@ -1614,6 +1647,22 @@ 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) ) { @@ -1736,6 +1785,21 @@ 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) { @@ -1818,6 +1882,16 @@ 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"); return; @@ -1855,6 +1929,16 @@ 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; } eDebug(" finished(%ld)", ::time(0)); --- a/lib/dvb/epgcache.h 2014-05-20 23:37:48.000000000 +0100 +++ b/lib/dvb/epgcache.h 2014-05-22 14:11:10.000000000 +0100 @@ -5,6 +5,7 @@ #define ENABLE_MHW_EPG 1 #define ENABLE_FREESAT 1 #define ENABLE_NETMED 1 +#define ENABLE_VIRGIN 1 #ifndef SWIG @@ -200,6 +201,10 @@ 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; @@ -419,6 +424,10 @@ ,NETMED_SCHEDULE=512 ,NETMED_SCHEDULE_OTHER=1024 #endif +#ifdef ENABLE_VIRGIN + ,VIRGIN_NOWNEXT=2048 + ,VIRGIN_SCHEDULE=4096 +#endif ,EPG_IMPORT=0x80000000 }; void setEpgHistorySeconds(time_t seconds); --- a/lib/python/Components/UsageConfig.py 2014-05-20 23:37:48.000000000 +0100 +++ b/lib/python/Components/UsageConfig.py 2014-05-29 20:10:19.246321389 +0100 @@ -259,6 +259,7 @@ 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 @@ -273,12 +274,15 @@ 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):