chktimecmp_end = chktimecmp + (duration / 60)
time = localtime(x.begin)
for y in (0, 1, 2, 3, 4, 5, 6):
- if x.repeated & (2 ** y):
+ if x.repeated & (2 ** y) and (x.begin <= begin or begin <= x.begin <= end):
timecmp = y * 1440 + time.tm_hour * 60 + time.tm_min
if timecmp <= chktimecmp < (timecmp + ((x.end - x.begin) / 60)):
time_match = ((timecmp + ((x.end - x.begin) / 60)) - chktimecmp) * 60
eDebug("[eEPGCache] couldnt initialize schedule other reader!!");
return;
}
+
+ res = demux->createSectionReader( this, data.m_ViasatReader );
+ if ( res )
+ {
+ eDebug("[eEPGCache] couldnt initialize viasat reader!!");
+ return;
+ }
#ifdef ENABLE_PRIVATE_EPG
res = demux->createSectionReader( this, data.m_PrivateReader );
if ( res )
eDebug("[EPGC] stop caching events(%ld)", ::time(0));
zapTimer->start(UPDATE_INTERVAL, 1);
eDebug("[EPGC] next update in %i min", UPDATE_INTERVAL / 60000);
- for (int i=0; i < 3; ++i)
+ for (unsigned int i=0; i < sizeof(seenSections)/sizeof(tidMap); ++i)
{
seenSections[i].clear();
calcedSections[i].clear();
eDebug("[EPGC] start caching events(%ld)", ::time(0));
state=0;
haveData=0;
- for (int i=0; i < 3; ++i)
+ for (unsigned int i=0; i < sizeof(seenSections)/sizeof(tidMap); ++i)
{
seenSections[i].clear();
calcedSections[i].clear();
m_ScheduleOtherReader->start(mask);
isRunning |= SCHEDULE_OTHER;
+ mask.pid = 0x39;
+
+ mask.data[0] = 0x40;
+ mask.mask[0] = 0x40;
+ m_ViasatReader->connectRead(slot(*this, &eEPGCache::channel_data::readDataViasat), m_ViasatConn);
+ m_ViasatReader->start(mask);
+ isRunning |= VIASAT;
+
abortTimer->start(7000,true);
}
}
if ( !(haveData&SCHEDULE_OTHER) && (isRunning&SCHEDULE_OTHER) )
{
- eDebug("[EPGC] abort non avail schedule_other reading");
+ eDebug("[EPGC] abort non avail schedule other reading");
isRunning &= ~SCHEDULE_OTHER;
m_ScheduleOtherReader->stop();
m_ScheduleOtherConn=0;
}
+ if ( !(haveData&VIASAT) && (isRunning&VIASAT) )
+ {
+ eDebug("[EPGC] abort non avail viasat reading");
+ isRunning &= ~VIASAT;
+ m_ViasatReader->stop();
+ m_ViasatConn=0;
+ }
#ifdef ENABLE_MHW_EPG
if ( !(haveData&MHW) && (isRunning&MHW) )
{
m_MHWConn2=0;
}
#endif
- if ( isRunning )
+ if ( isRunning & VIASAT )
+ abortTimer->start(300000, true);
+ else if ( isRunning )
abortTimer->start(90000, true);
else
{
++state;
- for (int i=0; i < 3; ++i)
+ for (unsigned int i=0; i < sizeof(seenSections)/sizeof(tidMap); ++i)
{
seenSections[i].clear();
calcedSections[i].clear();
void eEPGCache::channel_data::abortEPG()
{
- for (int i=0; i < 3; ++i)
+ for (unsigned int i=0; i < sizeof(seenSections)/sizeof(tidMap); ++i)
{
seenSections[i].clear();
calcedSections[i].clear();
m_ScheduleOtherReader->stop();
m_ScheduleOtherConn=0;
}
+ if (isRunning & VIASAT)
+ {
+ isRunning &= ~VIASAT;
+ m_ViasatReader->stop();
+ m_ViasatConn=0;
+ }
#ifdef ENABLE_MHW_EPG
if (isRunning & MHW)
{
pthread_mutex_unlock(&channel_active);
}
+
+void eEPGCache::channel_data::readDataViasat( const __u8 *data)
+{
+ __u8 *d=0;
+ memcpy(&d, &data, sizeof(__u8*));
+ d[0] |= 0x80;
+ readData(data);
+}
+
void eEPGCache::channel_data::readData( const __u8 *data)
{
int source;
source=SCHEDULE_OTHER;
map=2;
break;
+ case 0xD0 ... 0xDF:
+ case 0xE0 ... 0xEF:
+ reader=m_ViasatReader;
+ source=VIASAT;
+ map=3;
+ break;
default:
eDebug("[EPGC] unknown table_id !!!");
return;
m_ScheduleOtherConn=0;
eDebugNoNewLine("schedule other");
break;
+ case VIASAT:
+ m_ViasatConn=0;
+ eDebugNoNewLine("viasat");
+ break;
default: eDebugNoNewLine("unknown");break;
}
eDebug(" finished(%ld)", ::time(0));
if ( state > 1 || // aborted
// have si data.. so we dont read mhw data
- (haveData & (SCHEDULE|SCHEDULE_OTHER)) )
+ (haveData & (SCHEDULE|SCHEDULE_OTHER|VIASAT)) )
{
eDebug("[EPGC] mhw aborted %d", state);
}
if ( state > 1 || // aborted
// have si data.. so we dont read mhw data
- (haveData & (eEPGCache::SCHEDULE|eEPGCache::SCHEDULE_OTHER)) )
+ (haveData & (SCHEDULE|SCHEDULE_OTHER|VIASAT)) )
{
eDebug("[EPGC] mhw2 aborted %d", state);
}
int prevChannelState;
__u8 state, isRunning, haveData;
ePtr<eDVBChannel> channel;
- ePtr<eConnection> m_stateChangedConn, m_NowNextConn, m_ScheduleConn, m_ScheduleOtherConn;
- ePtr<iDVBSectionReader> m_NowNextReader, m_ScheduleReader, m_ScheduleOtherReader;
- tidMap seenSections[3], calcedSections[3];
+ 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_PRIVATE_EPG
ePtr<eTimer> startPrivateTimer;
int m_PrevVersion;
void storeTitle(std::map<__u32, mhw_title_t>::iterator itTitle, std::string sumText, const __u8 *data);
#endif
void readData(const __u8 *data);
+ void readDataViasat(const __u8 *data);
void startChannel();
void startEPG();
bool finishEPG();
#ifdef ENABLE_MHW_EPG
,MHW=8
#endif
+ ,VIASAT=16
};
struct Message
{
case ISO_639_LANGUAGE_DESCRIPTOR:
if (!isvideo)
{
+ int cnt=0;
const Iso639LanguageList *languages = ((Iso639LanguageDescriptor*)*desc)->getIso639Languages();
/* use last language code */
- for (Iso639LanguageConstIterator i(languages->begin()); i != languages->end(); ++i)
- audio.language_code = (*i)->getIso639LanguageCode();
+ for (Iso639LanguageConstIterator i(languages->begin()); i != languages->end(); ++i, ++cnt)
+ {
+ if (cnt == 0)
+ audio.language_code = (*i)->getIso639LanguageCode();
+ else
+ audio.language_code += "/" + (*i)->getIso639LanguageCode();
+ }
}
break;
case STREAM_IDENTIFIER_DESCRIPTOR:
self.showHours = 'ShowHours' in args
self.showNoSeconds = 'ShowNoSeconds' in args
- if self.detailed:
- self.poll_interval = 100
- else:
- self.poll_interval = 500
-
if type == "Length":
self.type = self.TYPE_LENGTH
elif type == "Position":
else:
raise ElementError("type must be {Length|Position|Remaining|Gauge} with optional arguments {Negate|Detailed|ShowHours|ShowNoSeconds} for ServicePosition converter")
- self.poll_enabled = self.type != self.TYPE_LENGTH
+ if self.detailed:
+ self.poll_interval = 100
+ elif self.type == self.TYPE_LENGTH:
+ self.poll_interval = 2000
+ else:
+ self.poll_interval = 500
+
+ self.poll_enabled = True
def getSeek(self):
s = self.source.service
class CIselectMainMenu(Screen):
skin = """
- <screen position="205,150" size="310,270" title="CI Assignment" >
- <widget name="CiList" position="10,10" size="290,200" scrollbarMode="showOnDemand" />
+ <screen position="180,150" size="350,270" title="CI assignment" >
+ <widget name="CiList" position="10,10" size="330,200" scrollbarMode="showOnDemand" />
<ePixmap position="10,210" size="290,2" pixmap="skin_default/div-h.png" transparent="1" alphatest="on" />
<ePixmap pixmap="skin_default/buttons/red.png" position="10,220" size="140,40" alphatest="on" />
<ePixmap pixmap="skin_default/buttons/green.png" position="160,220" size="140,40" alphatest="on" />
for slot in range(NUM_CI):
state = eDVBCI_UI.getInstance().getState(slot)
if state == 0:
- appname = _("Slot %d") %(slot+1) + " - " + _("no module")
+ appname = _("Slot %d") %(slot+1) + " - " + _("no module found")
elif state == 1:
appname = _("Slot %d") %(slot+1) + " - " + _("init modules")
elif state == 2:
menuList.list = self.list
menuList.l.setList(self.list)
self["CiList"] = menuList
+ self.onShown.append(self.setWindowTitle)
+
+ def setWindowTitle(self):
+ self.setTitle(_("CI assignment"))
def greenPressed(self):
cur = self["CiList"].getCurrent()
class CIconfigMenu(Screen):
skin = """
- <screen position="60,80" size="595,436" title="CI Assignment" >
+ <screen position="60,80" size="595,436" title="CI assignment" >
<widget name="CAidList.desc" position="10,10" size="575,22" font="Regular;20" />
<widget name="CAidList" position="10,40" size="575,45" font="Regular;20" />
<widget name="ServiceList.desc" position="10,90" size="575,22" font="Regular;20" />
Screen.__init__(self, session)
self.ci_slot=ci_slot
self.filename="/etc/enigma2/ci"+str(self.ci_slot)+".xml"
-
+
self["key_red"] = StaticText(_("delete"))
self["key_green"] = StaticText(_("add Service"))
self["key_yellow"] = StaticText(_("add Provider"))
"ok": self.okPressed,
"cancel": self.cancel
}, -1)
-
+
print "[CI_Wizzard_Config] Configuring CI Slots : %d " % self.ci_slot
i=0
# if config mode !=advanced autoselect any caid
if config.usage.setup_level.index <= 1: # advanced
self.selectedcaid=self.caidlist
+ self.onShown.append(self.setWindowTitle)
+
+ def setWindowTitle(self):
+ self.setTitle(_("CI assignment"))
def redPressed(self):
self.delete()
service_name = service_ref.getServiceName()
if find_in_list(self.servicelist, service_name, 0)==False:
split_ref=service_ref.ref.toString().split(":")
- if split_ref[0] == "1": #== dvb service und nicht muell von None
+ if split_ref[0] == "1":#== dvb service und nicht muell von None
self.servicelist.append( (service_name , ConfigNothing(), 0, service_ref.ref.toString()) )
self["ServiceList"].l.setList(self.servicelist)
class easyCIconfigMenu(CIconfigMenu):
skin = """
- <screen position="80,80" size="470,420" title="CI Assignment" >
+ <screen position="80,80" size="470,420" title="CI assignment" >
<widget name="ServiceList.desc" position="10,10" size="420,22" font="Regular;20" />
<widget name="ServiceList" position="10,40" size="450,340" scrollbarMode="showOnDemand" />
<ePixmap position="10,360" size="450,2" pixmap="skin_default/div-h.png" transparent="1" alphatest="on" />
ci=ci_slot
CIconfigMenu.__init__(self, session, ci_slot)
self.skin = easyCIconfigMenu.skin
-
+
self["actions"] = ActionMap(["ColorActions","SetupActions"],
{
"green": self.greenPressed,
"ok": self.okPressed,
"cancel": self.cancel
}, -1)
-
+
def bluePressed(self):
print "do nothing"
<widget source="key_red" render="Label" position="10,240" zPosition="1" size="140,40" font="Regular;19" halign="center" valign="center" backgroundColor="#9f1313" transparent="1" />
<widget source="key_green" render="Label" position="160,240" zPosition="1" size="140,40" font="Regular;19" halign="center" valign="center" backgroundColor="#1f771f" transparent="1" />
</screen>"""
-
+
def __init__(self, session, list, selected_caids):
self.skin = CAidSelect.skin
Screen.__init__(self, session)
"green": self.greenPressed,
"red": self.cancel
}, -1)
+ self.onShown.append(self.setWindowTitle)
+
+ def setWindowTitle(self):
+ self.setTitle(_("select CAId's"))
def greenPressed(self):
list = self.list.getSelectionsList()
def __onExecCallback(self):
self.showSatellites()
+ self.setTitle(_("Select provider to add..."))
def channelSelected(self): # just return selected service
ref = self.getCurrentSelection()
def __onExecCallback(self):
self.setModeTv()
+ self.setTitle(_("Select service to add..."))
def doNothing(self):
print "nothing to do..."
from os import system, remove
import re
import urllib
+from Tools.Downloader import downloadWithProgress
from twisted.web import client
from twisted.internet import reactor, defer
from twisted.python import failure
class UserRequestedCancel(Exception):
pass
-class HTTPProgressDownloader(client.HTTPDownloader):
- def __init__(self, url, outfile, headers=None):
- client.HTTPDownloader.__init__(self, url, outfile, headers=headers, agent="Dreambox .NFI Download Plugin")
- self.status = None
- self.progress_callback = None
- self.deferred = defer.Deferred()
-
- def noPage(self, reason):
- if self.status == "304":
- print reason.getErrorMessage()
- client.HTTPDownloader.page(self, "")
- else:
- client.HTTPDownloader.noPage(self, reason)
-
- def gotHeaders(self, headers):
- if self.status == "200":
- if headers.has_key("content-length"):
- self.totalbytes = int(headers["content-length"][0])
- else:
- self.totalbytes = 0
- self.currentbytes = 0.0
- return client.HTTPDownloader.gotHeaders(self, headers)
-
- def pagePart(self, packet):
- if self.status == "200":
- self.currentbytes += len(packet)
- if self.totalbytes and self.progress_callback:
- self.progress_callback(self.currentbytes, self.totalbytes)
- return client.HTTPDownloader.pagePart(self, packet)
-
- def pageEnd(self):
- return client.HTTPDownloader.pageEnd(self)
-
-class downloadWithProgress:
- def __init__(self, url, outputfile, contextFactory=None, *args, **kwargs):
- scheme, host, port, path = client._parse(url)
- self.factory = HTTPProgressDownloader(url, outputfile, *args, **kwargs)
- self.connection = reactor.connectTCP(host, port, self.factory)
-
- def start(self):
- return self.factory.deferred
-
- def stop(self):
- print "[stop]"
- self.connection.disconnect()
- #self.factory.deferred.errback(failure.Failure(UserRequestedCancel))
-
- def addProgress(self, progress_callback):
- print "[addProgress]"
- self.factory.progress_callback = progress_callback
-
class Feedlist(MenuList):
def __init__(self, list=[], enableWrapAround = False):
MenuList.__init__(self, list, enableWrapAround, eListboxPythonMultiContent)
idx = 0
while idx < n:
+ cnt = 0
i = audio.getTrackInfo(idx)
- language = i.getLanguage()
+ languages = i.getLanguage().split('/')
description = i.getDescription()
+ language = ""
- if LanguageCodes.has_key(language):
- language = LanguageCodes[language][0]
+ for lang in languages:
+ if cnt:
+ language += ' / '
+ if LanguageCodes.has_key(lang):
+ language += LanguageCodes[lang][0]
+ else:
+ language += lang
+ cnt += 1
if len(description):
description += " (" + language + ")"
--- /dev/null
+from twisted.web import client
+from twisted.internet import reactor, defer
+from twisted.python import failure
+
+class HTTPProgressDownloader(client.HTTPDownloader):
+ def __init__(self, url, outfile, headers=None):
+ client.HTTPDownloader.__init__(self, url, outfile, headers=headers, agent="Dreambox HTTP Downloader")
+ self.status = None
+ self.progress_callback = None
+ self.deferred = defer.Deferred()
+
+ def noPage(self, reason):
+ if self.status == "304":
+ print reason.getErrorMessage()
+ client.HTTPDownloader.page(self, "")
+ else:
+ client.HTTPDownloader.noPage(self, reason)
+
+ def gotHeaders(self, headers):
+ if self.status == "200":
+ if headers.has_key("content-length"):
+ self.totalbytes = int(headers["content-length"][0])
+ else:
+ self.totalbytes = 0
+ self.currentbytes = 0.0
+ return client.HTTPDownloader.gotHeaders(self, headers)
+
+ def pagePart(self, packet):
+ if self.status == "200":
+ self.currentbytes += len(packet)
+ if self.totalbytes and self.progress_callback:
+ self.progress_callback(self.currentbytes, self.totalbytes)
+ return client.HTTPDownloader.pagePart(self, packet)
+
+ def pageEnd(self):
+ return client.HTTPDownloader.pageEnd(self)
+
+class downloadWithProgress:
+ def __init__(self, url, outputfile, contextFactory=None, *args, **kwargs):
+ scheme, host, port, path = client._parse(url)
+ self.factory = HTTPProgressDownloader(url, outputfile, *args, **kwargs)
+ self.connection = reactor.connectTCP(host, port, self.factory)
+
+ def start(self):
+ return self.factory.deferred
+
+ def stop(self):
+ print "[stop]"
+ self.connection.disconnect()
+
+ def addProgress(self, progress_callback):
+ print "[addProgress]"
+ self.factory.progress_callback = progress_callback
FuzzyDate.py XMLTools.py Directories.py NumericalTextInput.py \
KeyBindings.py BoundFunction.py ISO639.py Notifications.py __init__.py \
RedirectOutput.py DreamboxHardware.py Import.py Event.py CList.py \
- LoadPixmap.py Profile.py HardwareInfo.py Transponder.py ASCIItranslit.py
+ LoadPixmap.py Profile.py HardwareInfo.py Transponder.py ASCIItranslit.py \
+ Downloader.py
std::string eServiceMP3::getInfoString(int w)
{
- if ( !m_stream_tags )
+ if ( !m_stream_tags && w < sUser && w > 26 )
return "";
const gchar *tag = 0;
switch (w)
case sTagChannelMode:
tag = "channel-mode";
break;
-
case sUser+12:
return m_error_message;
default:
g_free (g_lang);
// g_free (g_type);
}
+ m_event((iPlayableService*)this, evUpdatedEventInfo);
}
case GST_MESSAGE_ELEMENT:
{