add SeekRelative stuff
authorFelix Domke <tmbinc@elitedvb.net>
Sun, 13 Nov 2005 04:31:21 +0000 (04:31 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Sun, 13 Nov 2005 04:31:21 +0000 (04:31 +0000)
lib/service/iservice.h
lib/service/servicedvb.cpp
lib/service/servicedvb.h

index f9a26722bf7d57125a687401651309565c95fb82..15631fdac410f9e9aa9da4795573b4a19966fa52 100644 (file)
@@ -207,6 +207,8 @@ class iSeekableService: public iObject
 public:
        virtual RESULT getLength(pts_t &SWIG_OUTPUT)=0;
        virtual RESULT seekTo(pts_t to)=0;
 public:
        virtual RESULT getLength(pts_t &SWIG_OUTPUT)=0;
        virtual RESULT seekTo(pts_t to)=0;
+       enum { dirForward = +1, dirBackward = -1 };
+       virtual RESULT seekRelative(int direction, pts_t to)=0;
        virtual RESULT getPlayPosition(pts_t &SWIG_OUTPUT)=0;
 };
 
        virtual RESULT getPlayPosition(pts_t &SWIG_OUTPUT)=0;
 };
 
@@ -290,6 +292,8 @@ public:
                // TODO: additional stuff, like a conversion interface?
 };
 
                // TODO: additional stuff, like a conversion interface?
 };
 
+TEMPLATE_TYPEDEF(ePtr<iServiceOfflineOperations>, iServiceOfflineOperationsPtr);
+
 class iServiceHandler: public iObject
 {
 public:
 class iServiceHandler: public iObject
 {
 public:
index f3215d82f1059069a3e2a5d7f1cd07ff6e98d7fa..76b0089c60feb06443e1fa588fcd899909ee1bbe 100644 (file)
@@ -173,11 +173,10 @@ RESULT eDVBPVRServiceOfflineOperations::getListOfFilenames(std::list<std::string
 {
        res.clear();
        res.push_back(m_ref.path);
 {
        res.clear();
        res.push_back(m_ref.path);
+       res.push_back(m_ref.path + ".meta");
        return 0;
 }
 
        return 0;
 }
 
-
-
 DEFINE_REF(eServiceFactoryDVB)
 
 eServiceFactoryDVB::eServiceFactoryDVB()
 DEFINE_REF(eServiceFactoryDVB)
 
 eServiceFactoryDVB::eServiceFactoryDVB()
@@ -227,7 +226,7 @@ RESULT eDVBServiceList::startQuery()
        
        ePtr<eDVBChannelQuery> q;
        
        
        ePtr<eDVBChannelQuery> q;
        
-       if (m_parent.path.size())
+       if (!m_parent.path.empty())
        {
                eDVBChannelQuery::compile(q, m_parent.path);
                if (!q)
        {
                eDVBChannelQuery::compile(q, m_parent.path);
                if (!q)
@@ -284,8 +283,15 @@ RESULT eServiceFactoryDVB::play(const eServiceReference &ref, ePtr<iPlayableServ
 
 RESULT eServiceFactoryDVB::record(const eServiceReference &ref, ePtr<iRecordableService> &ptr)
 {
 
 RESULT eServiceFactoryDVB::record(const eServiceReference &ref, ePtr<iRecordableService> &ptr)
 {
-       ptr = new eDVBServiceRecord((eServiceReferenceDVB&)ref);
-       return 0;
+       if (ref.path.empty())
+       {
+               ptr = new eDVBServiceRecord((eServiceReferenceDVB&)ref);
+               return 0;
+       } else
+       {
+               ptr = 0;
+               return -1;
+       }
 }
 
 RESULT eServiceFactoryDVB::list(const eServiceReference &ref, ePtr<iListableService> &ptr)
 }
 
 RESULT eServiceFactoryDVB::list(const eServiceReference &ref, ePtr<iListableService> &ptr)
@@ -309,7 +315,7 @@ RESULT eServiceFactoryDVB::info(const eServiceReference &ref, ePtr<iStaticServic
                ptr = new eStaticServiceDVBBouquetInformation;
                return 0;
        }
                ptr = new eStaticServiceDVBBouquetInformation;
                return 0;
        }
-       else if (ref.path.size())
+       else if (!ref.path.empty())
        {
                ptr = new eStaticServiceDVBPVRInformation(ref);
                return 0;
        {
                ptr = new eStaticServiceDVBPVRInformation(ref);
                return 0;
@@ -327,10 +333,17 @@ RESULT eServiceFactoryDVB::info(const eServiceReference &ref, ePtr<iStaticServic
        }
 }
 
        }
 }
 
-RESULT eServiceFactoryDVB::offlineOperations(const eServiceReference &, ePtr<iServiceOfflineOperations> &ptr)
+RESULT eServiceFactoryDVB::offlineOperations(const eServiceReference &ref, ePtr<iServiceOfflineOperations> &ptr)
 {
 {
-       ptr = 0;
-       return -1;
+       if (ref.path.empty())
+       {
+               ptr = 0;
+               return -1;
+       } else
+       {
+               ptr = new eDVBPVRServiceOfflineOperations(ref);
+               return 0;
+       }
 }
 
 RESULT eServiceFactoryDVB::lookupService(ePtr<eDVBService> &service, const eServiceReference &ref)
 }
 
 RESULT eServiceFactoryDVB::lookupService(ePtr<eDVBService> &service, const eServiceReference &ref)
@@ -578,6 +591,18 @@ RESULT eDVBServicePlay::seekTo(pts_t to)
        return -1;
 }
 
        return -1;
 }
 
+RESULT eDVBServicePlay::seekRelative(int direction, pts_t to)
+{
+       eDebug("eDVBServicePlay::seekRelative: jump %d, %lld", direction, to);
+
+       ePtr<iDVBPVRChannel> pvr_channel;
+       
+       if (m_service_handler.getPVRChannel(pvr_channel))
+               return -1;
+       
+       return pvr_channel->seekToPosition(SEEK_CUR, to);
+}
+
 RESULT eDVBServicePlay::getPlayPosition(pts_t &pos)
 {
        ePtr<iDVBPVRChannel> pvr_channel;
 RESULT eDVBServicePlay::getPlayPosition(pts_t &pos)
 {
        ePtr<iDVBPVRChannel> pvr_channel;
index f47c3906012ee31262703fb2e5c73159d9694ea5..9ebd277345fad0e28bee25b42f0df09e9ec3eda8 100644 (file)
@@ -62,6 +62,7 @@ public:
                // iSeekableService
        RESULT getLength(pts_t &len);
        RESULT seekTo(pts_t to);
                // iSeekableService
        RESULT getLength(pts_t &len);
        RESULT seekTo(pts_t to);
+       RESULT seekRelative(int direction, pts_t to);
        RESULT getPlayPosition(pts_t &pos);
 
                // iServiceInformation
        RESULT getPlayPosition(pts_t &pos);
 
                // iServiceInformation