aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/python/Components/TimerList.py14
-rw-r--r--lib/python/Screens/SubserviceSelection.py21
-rw-r--r--lib/python/Screens/TimerEntry.py17
-rw-r--r--lib/service/event.cpp21
-rw-r--r--lib/service/event.h2
-rw-r--r--lib/service/service.cpp22
-rw-r--r--lib/service/servicedvb.cpp23
7 files changed, 76 insertions, 44 deletions
diff --git a/lib/python/Components/TimerList.py b/lib/python/Components/TimerList.py
index e48b7a0d..47c49d3f 100644
--- a/lib/python/Components/TimerList.py
+++ b/lib/python/Components/TimerList.py
@@ -26,7 +26,9 @@ RT_WRAP = 32
def TimerEntryComponent(timer, processed):
res = [ timer ]
- res.append((eListboxPythonMultiContent.TYPE_TEXT, 0, 0, 220, 30, 0, RT_HALIGN_LEFT, timer.service_ref.getServiceName()))
+ res.append((eListboxPythonMultiContent.TYPE_TEXT, 0, 0, 560, 30, 0, RT_HALIGN_LEFT|RT_VALIGN_CENTER, timer.service_ref.getServiceName()))
+ res.append((eListboxPythonMultiContent.TYPE_TEXT, 0, 30, 560, 20, 1, RT_HALIGN_LEFT|RT_VALIGN_CENTER, timer.name))
+
repeatedtext = ""
days = [ "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" ]
if (timer.repeated != 0):
@@ -39,12 +41,10 @@ def TimerEntryComponent(timer, processed):
repeatedtext += days[x]
count += 1
flags = flags >> 1
- res.append((eListboxPythonMultiContent.TYPE_TEXT, 0, 30, 300, 20, 1, RT_HALIGN_LEFT, repeatedtext + (" %s ... %s" % (FuzzyTime(timer.begin)[1], FuzzyTime(timer.end)[1]))))
+ res.append((eListboxPythonMultiContent.TYPE_TEXT, 0, 50, 300, 20, 1, RT_HALIGN_LEFT|RT_VALIGN_CENTER, repeatedtext + (" %s ... %s" % (FuzzyTime(timer.begin)[1], FuzzyTime(timer.end)[1]))))
else:
- res.append((eListboxPythonMultiContent.TYPE_TEXT, 0, 30, 300, 20, 1, RT_HALIGN_LEFT, repeatedtext + ("%s, %s ... %s" % (FuzzyTime(timer.begin) + FuzzyTime(timer.end)[1:]))))
+ res.append((eListboxPythonMultiContent.TYPE_TEXT, 0, 50, 300, 20, 1, RT_HALIGN_LEFT|RT_VALIGN_CENTER, repeatedtext + ("%s, %s ... %s" % (FuzzyTime(timer.begin) + FuzzyTime(timer.end)[1:]))))
- res.append((eListboxPythonMultiContent.TYPE_TEXT, 240, 0, 320, 20, 1, RT_HALIGN_RIGHT, timer.name))
-
if not processed:
if timer.state == TimerEntry.StateWait:
state = "waiting"
@@ -57,7 +57,7 @@ def TimerEntryComponent(timer, processed):
else:
state = "done!"
- res.append((eListboxPythonMultiContent.TYPE_TEXT, 320, 30, 240, 20, 1, RT_HALIGN_RIGHT, state))
+ res.append((eListboxPythonMultiContent.TYPE_TEXT, 320, 50, 240, 20, 1, RT_HALIGN_RIGHT|RT_VALIGN_CENTER, state))
return res
@@ -75,7 +75,7 @@ class TimerList(HTMLComponent, GUIComponent):
def GUIcreate(self, parent):
self.instance = eListbox(parent)
self.instance.setContent(self.l)
- self.instance.setItemHeight(50)
+ self.instance.setItemHeight(70)
def GUIdelete(self):
self.instance.setContent(None)
diff --git a/lib/python/Screens/SubserviceSelection.py b/lib/python/Screens/SubserviceSelection.py
index a73cf0e4..0aa34b61 100644
--- a/lib/python/Screens/SubserviceSelection.py
+++ b/lib/python/Screens/SubserviceSelection.py
@@ -2,7 +2,7 @@ from Screen import Screen
from Components.ActionMap import ActionMap
from Components.MenuList import MenuList
from Components.Label import Label
-from enigma import eServiceReferencePtr, eServiceReference
+from enigma import eServiceReferencePtr, eServiceReference, iSubserviceListPtr, eServiceEventPtrPtr
class SubserviceSelection(Screen):
def KeyOk(self):
@@ -10,7 +10,7 @@ class SubserviceSelection(Screen):
self.close(selection[1])
def Cancel(self):
self.close(None)
- def __init__(self, session, subservices):
+ def __init__(self, session, subservices, parent=None):
Screen.__init__(self, session)
self["actions"] = ActionMap(["OkCancelActions"],
@@ -21,10 +21,19 @@ class SubserviceSelection(Screen):
self.subservices = subservices
+ print subservices
tlist = []
- n = subservices.getNumberOfSubservices()
- for x in range(n):
- i = subservices.getSubservice(x)
- tlist.append((i.getName(), i))
+ if isinstance(subservices, iSubserviceListPtr):
+ n = subservices.getNumberOfSubservices()
+ for x in range(n):
+ i = subservices.getSubservice(x)
+ tlist.append((i.getName(), i))
+ elif isinstance(subservices, eServiceEventPtrPtr):
+ n = subservices.getNumOfLinkageServices()
+ for x in range(n):
+ i = subservices.getLinkageService(parent, x)
+ tlist.append((i.getName(), i))
+ else:
+ print "unknown type of subservices"
self["subservices"] = MenuList(tlist)
diff --git a/lib/python/Screens/TimerEntry.py b/lib/python/Screens/TimerEntry.py
index ea18d892..703e4aba 100644
--- a/lib/python/Screens/TimerEntry.py
+++ b/lib/python/Screens/TimerEntry.py
@@ -7,6 +7,8 @@ from Components.ConfigList import ConfigList
from Components.NimManager import nimmanager
from Components.Label import Label
from Components.Pixmap import Pixmap
+from Screens.SubserviceSelection import SubserviceSelection
+from enigma import eEPGCache
import time
import datetime
@@ -256,8 +258,19 @@ class TimerEntry(Screen):
if (config.timerentry.day[x].value == 0): self.timer.setRepeated(x)
self.timer.begin = self.getTimestamp(time.time(), config.timerentry.starttime.value)
- self.timer.end = self.getTimestamp(time.time(), config.timerentry.endtime.value)
-
+ self.timer.end = self.getTimestamp(time.time(), config.timerentry.endtime.value)
+
+ if self.timer.eit is not None:
+ event = eEPGCache.getInstance().lookupEventId(self.timer.service_ref.ref, self.timer.eit)
+ if event is not None:
+ if event.getNumOfLinkageServices() > 0:
+ self.session.openWithCallback(self.subserviceSelected, SubserviceSelection, event, self.timer.service_ref.ref)
+ return
+ self.close((True, self.timer))
+
+ def subserviceSelected(self, service):
+ if not service is None:
+ self.timer.service_ref = ServiceReference(service)
self.close((True, self.timer))
def keyCancel(self):
diff --git a/lib/service/event.cpp b/lib/service/event.cpp
index f84c38b7..2d0f83a4 100644
--- a/lib/service/event.cpp
+++ b/lib/service/event.cpp
@@ -204,7 +204,7 @@ RESULT eServiceEvent::getComponentData(ePtr<eComponentData> &dest, int tagnum) c
return -1;
}
-RESULT eServiceEvent::getLinkageService(eServiceReference &service, int num) const
+RESULT eServiceEvent::getLinkageService(eServiceReference &service, eServiceReference &parent, int num) const
{
std::list<eServiceReference>::const_iterator it =
m_linkage_services.begin();
@@ -213,6 +213,25 @@ RESULT eServiceEvent::getLinkageService(eServiceReference &service, int num) con
if ( it != m_linkage_services.end() )
{
service = *it;
+ eServiceReferenceDVB &subservice = (eServiceReferenceDVB&) service;
+ eServiceReferenceDVB &current = (eServiceReferenceDVB&) parent;
+ subservice.setDVBNamespace(current.getDVBNamespace());
+ if ( current.getParentTransportStreamID().get() )
+ {
+ subservice.setParentTransportStreamID( current.getParentTransportStreamID() );
+ subservice.setParentServiceID( current.getParentServiceID() );
+ }
+ else
+ {
+ subservice.setParentTransportStreamID( current.getTransportStreamID() );
+ subservice.setParentServiceID( current.getServiceID() );
+ }
+ if ( subservice.getParentTransportStreamID() == subservice.getTransportStreamID() &&
+ subservice.getParentServiceID() == subservice.getServiceID() )
+ {
+ subservice.setParentTransportStreamID( eTransportStreamID(0) );
+ subservice.setParentServiceID( eServiceID(0) );
+ }
return 0;
}
service.type = eServiceReference::idInvalid;
diff --git a/lib/service/event.h b/lib/service/event.h
index 0a6891aa..9ee6538b 100644
--- a/lib/service/event.h
+++ b/lib/service/event.h
@@ -53,7 +53,7 @@ public:
std::string getBeginTimeString() const;
SWIG_VOID(RESULT) getComponentData(ePtr<eComponentData> &SWIG_OUTPUT, int tagnum) const;
int getNumOfLinkageServices() const { return m_linkage_services.size(); }
- SWIG_VOID(RESULT) getLinkageService(eServiceReference &SWIG_OUTPUT, int num) const;
+ SWIG_VOID(RESULT) getLinkageService(eServiceReference &SWIG_OUTPUT, eServiceReference &parent, int num) const;
};
TEMPLATE_TYPEDEF(ePtr<eServiceEvent>, eServiceEventPtr);
diff --git a/lib/service/service.cpp b/lib/service/service.cpp
index 150a0cd3..a490c3d7 100644
--- a/lib/service/service.cpp
+++ b/lib/service/service.cpp
@@ -7,8 +7,8 @@
eServiceReference::eServiceReference(const std::string &string)
{
const char *c=string.c_str();
- int pathl=-1;
-
+ int pathl=0;
+
if ( sscanf(c, "%d:%d:%x:%x:%x:%x:%x:%x:%x:%x:%n", &type, &flags, &data[0], &data[1], &data[2], &data[3], &data[4], &data[5], &data[6], &data[7], &pathl) < 8 )
{
memset( data, 0, sizeof(data) );
@@ -17,7 +17,19 @@ eServiceReference::eServiceReference(const std::string &string)
}
if (pathl)
- path=c+pathl;
+ {
+ const char *pathstr = c+pathl;
+ const char *namestr = strchr(pathstr, ':');
+ if (namestr)
+ {
+ if (pathstr != namestr)
+ path.assign(pathstr, namestr-pathstr);
+ if (*(namestr+1))
+ name=namestr+1;
+ }
+ else
+ path=pathstr;
+ }
}
std::string eServiceReference::toString() const
@@ -27,10 +39,10 @@ std::string eServiceReference::toString() const
ret += ":";
ret += getNum(flags);
for (unsigned int i=0; i<sizeof(data)/sizeof(*data); ++i)
- {
ret+=":"+ getNum(data[i], 0x10);
- }
ret+=":"+path;
+ if (name.length())
+ ret+=":"+name;
return ret;
}
diff --git a/lib/service/servicedvb.cpp b/lib/service/servicedvb.cpp
index 9cba0aaf..15deff62 100644
--- a/lib/service/servicedvb.cpp
+++ b/lib/service/servicedvb.cpp
@@ -1037,29 +1037,8 @@ RESULT eDVBServicePlay::getSubservice(eServiceReference &sub, unsigned int n)
ePtr<eServiceEvent> evt;
if (!m_event_handler.getEvent(evt, 0))
{
- if (!evt->getLinkageService(sub, n))
- {
- eServiceReferenceDVB &subservice = (eServiceReferenceDVB&) sub;
- eServiceReferenceDVB &current = (eServiceReferenceDVB&) m_reference;
- subservice.setDVBNamespace(current.getDVBNamespace());
- if ( current.getParentTransportStreamID().get() )
- {
- subservice.setParentTransportStreamID( current.getParentTransportStreamID() );
- subservice.setParentServiceID( current.getParentServiceID() );
- }
- else
- {
- subservice.setParentTransportStreamID( current.getTransportStreamID() );
- subservice.setParentServiceID( current.getServiceID() );
- }
- if ( subservice.getParentTransportStreamID() == subservice.getTransportStreamID() &&
- subservice.getParentServiceID() == subservice.getServiceID() )
- {
- subservice.setParentTransportStreamID( eTransportStreamID(0) );
- subservice.setParentServiceID( eServiceID(0) );
- }
+ if (!evt->getLinkageService(sub, m_reference, n))
return 0;
- }
}
sub.type=eServiceReference::idInvalid;
return -1;