From 2601ee77efe1f10be7cbeb8af94e2fb229cc1ec1 Mon Sep 17 00:00:00 2001 From: Felix Domke Date: Sat, 17 Dec 2005 02:56:52 +0000 Subject: timer: add name/description, factor out "parse from epg event", fix some cases where demux was not available at that time, add timeshift framework, fix movielist (not all movies are great!) --- lib/service/servicedvb.cpp | 67 ++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 62 insertions(+), 5 deletions(-) (limited to 'lib/service/servicedvb.cpp') diff --git a/lib/service/servicedvb.cpp b/lib/service/servicedvb.cpp index a9d235ec..790bfca6 100644 --- a/lib/service/servicedvb.cpp +++ b/lib/service/servicedvb.cpp @@ -127,6 +127,9 @@ public: eStaticServiceDVBPVRInformation(const eServiceReference &ref); RESULT getName(const eServiceReference &ref, std::string &name); int getLength(const eServiceReference &ref); + + int getInfo(const eServiceReference &ref, int w); + std::string getInfoString(const eServiceReference &ref,int w); }; DEFINE_REF(eStaticServiceDVBPVRInformation); @@ -160,7 +163,32 @@ int eStaticServiceDVBPVRInformation::getLength(const eServiceReference &ref) return len / 90000; } +int eStaticServiceDVBPVRInformation::getInfo(const eServiceReference &ref, int w) +{ + switch (w) + { + case iServiceInformation::sDescription: + return iServiceInformation::resIsString; + case iServiceInformation::sTimeCreate: + if (m_parser.m_time_create) + return m_parser.m_time_create; + else + return iServiceInformation::resNA; + default: + return iServiceInformation::resNA; + } +} +std::string eStaticServiceDVBPVRInformation::getInfoString(const eServiceReference &ref,int w) +{ + switch (w) + { + case iServiceInformation::sDescription: + return m_parser.m_description; + default: + return ""; + } +} class eDVBPVRServiceOfflineOperations: public iServiceOfflineOperations { @@ -459,6 +487,7 @@ eDVBServicePlay::eDVBServicePlay(const eServiceReference &ref, eDVBService *serv m_reference(ref), m_dvb_service(service), m_service_handler(0), m_is_paused(0) { m_is_pvr = !ref.path.empty(); + m_timeshift_enabled = 0; CONNECT(m_service_handler.serviceEvent, eDVBServicePlay::serviceEvent); CONNECT(m_event_handler.m_eit_changed, eDVBServicePlay::gotNewEvent); @@ -619,14 +648,14 @@ RESULT eDVBServicePlay::connectEvent(const Slot2 &ev RESULT eDVBServicePlay::pause(ePtr &ptr) { - if (m_is_pvr) + if (!m_is_pvr) { - ptr = this; - return 0; + ptr = 0; + return -1; } - ptr = 0; - return -1; + ptr = this; + return 0; } RESULT eDVBServicePlay::setSlowMotion(int ratio) @@ -753,6 +782,17 @@ RESULT eDVBServicePlay::subServices(ePtr &ptr) return 0; } +RESULT eDVBServicePlay::timeshift(ePtr &ptr) +{ + if (m_timeshift_enabled || !m_is_pvr) + { + ptr = this; + return 0; + } + ptr = 0; + return -1; +} + RESULT eDVBServicePlay::getName(std::string &name) { if (m_dvb_service) @@ -939,6 +979,23 @@ RESULT eDVBServicePlay::getSubservice(eServiceReference &sub, unsigned int n) return -1; } +RESULT eDVBServicePlay::startTimeshift() +{ + if (m_timeshift_enabled) + return -1; + eDebug("TIMESHIFT - start!"); + return 0; +} + +RESULT eDVBServicePlay::stopTimeshift() +{ + if (!m_timeshift_enabled) + return -1; + m_timeshift_enabled = 0; + eDebug("timeshift disabled"); + return 0; +} + DEFINE_REF(eDVBServicePlay) eAutoInitPtr init_eServiceFactoryDVB(eAutoInitNumbers::service+1, "eServiceFactoryDVB"); -- cgit v1.2.3