aboutsummaryrefslogtreecommitdiff
path: root/lib/service/servicedvb.cpp
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2005-12-17 02:56:52 +0000
committerFelix Domke <tmbinc@elitedvb.net>2005-12-17 02:56:52 +0000
commit2601ee77efe1f10be7cbeb8af94e2fb229cc1ec1 (patch)
treedee02f1a965266cfc29d96ae664f71ecc889e879 /lib/service/servicedvb.cpp
parent654f9ddcbd850acbd23cb0b568632268cfd26f22 (diff)
downloadenigma2-2601ee77efe1f10be7cbeb8af94e2fb229cc1ec1.tar.gz
enigma2-2601ee77efe1f10be7cbeb8af94e2fb229cc1ec1.zip
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!)
Diffstat (limited to 'lib/service/servicedvb.cpp')
-rw-r--r--lib/service/servicedvb.cpp67
1 files changed, 62 insertions, 5 deletions
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<void,iPlayableService*,int> &ev
RESULT eDVBServicePlay::pause(ePtr<iPauseableService> &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<iSubserviceList> &ptr)
return 0;
}
+RESULT eDVBServicePlay::timeshift(ePtr<iTimeshiftService> &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<eServiceFactoryDVB> init_eServiceFactoryDVB(eAutoInitNumbers::service+1, "eServiceFactoryDVB");