add SeekRelative stuff
[enigma2.git] / lib / service / servicedvb.h
index 941ad7b..9ebd277 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __servicemp3_h
-#define __servicemp3_h
+#ifndef __servicedvb_h
+#define __servicedvb_h
 
 #include <lib/service/iservice.h>
 #include <lib/dvb/idvb.h>
@@ -9,7 +9,7 @@
 
 class eServiceFactoryDVB: public iServiceHandler
 {
-DECLARE_REF;
+DECLARE_REF(eServiceFactoryDVB);
 public:
        eServiceFactoryDVB();
        virtual ~eServiceFactoryDVB();
@@ -20,50 +20,74 @@ public:
        RESULT record(const eServiceReference &, ePtr<iRecordableService> &ptr);
        RESULT list(const eServiceReference &, ePtr<iListableService> &ptr);
        RESULT info(const eServiceReference &, ePtr<iStaticServiceInformation> &ptr);
+       RESULT offlineOperations(const eServiceReference &, ePtr<iServiceOfflineOperations> &ptr);
+private:
+       RESULT lookupService(ePtr<eDVBService> &ptr, const eServiceReference &ref);
 };
 
 class eDVBServiceList: public iListableService
 {
-DECLARE_REF;
+DECLARE_REF(eDVBServiceList);
+public:
+       virtual ~eDVBServiceList();
+       RESULT getContent(std::list<eServiceReference> &list);
+       RESULT getNext(eServiceReference &ptr);
+       int compareLessEqual(const eServiceReference &a, const eServiceReference &b);
 private:
+       RESULT startQuery();
        eServiceReference m_parent;
        friend class eServiceFactoryDVB;
        eDVBServiceList(const eServiceReference &parent);
-public:
-       virtual ~eDVBServiceList();
-       RESULT getContent(std::list<eServiceReference> &list);
+       ePtr<iDVBChannelListQuery> m_query;
 };
 
-class eDVBServicePlay: public iPlayableService, public Object, public iServiceInformation
+class eDVBServicePlay: public iPlayableService, public iPauseableService, public iSeekableService, public Object, public iServiceInformation
 {
-DECLARE_REF;
+DECLARE_REF(eDVBServicePlay);
+public:
+       virtual ~eDVBServicePlay();
+
+               // iPlayableService
+       RESULT connectEvent(const Slot2<void,iPlayableService*,int> &event, ePtr<eConnection> &connection);
+       RESULT start();
+       RESULT stop();
+       RESULT seek(ePtr<iSeekableService> &ptr);
+       RESULT pause(ePtr<iPauseableService> &ptr);
+       RESULT info(ePtr<iServiceInformation> &ptr);
+       
+               // iPauseableService
+       RESULT pause();
+       RESULT unpause();
+       
+               // 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 getName(std::string &name);
+       RESULT getEvent(ePtr<eServiceEvent> &evt, int nownext);
+
 private:
        friend class eServiceFactoryDVB;
        eServiceReference m_reference;
        
+       ePtr<eDVBService> m_dvb_service;
+       
        ePtr<iTSMPEGDecoder> m_decoder;
        
        eDVBServicePMTHandler m_service_handler;
        eDVBServiceEITHandler m_event_handler;
        
-       eDVBServicePlay(const eServiceReference &ref);
+       eDVBServicePlay(const eServiceReference &ref, eDVBService *service);
        
        void gotNewEvent();
        
        void serviceEvent(int event);
-public:
-       virtual ~eDVBServicePlay();
-
-               // iPlayableService
-       RESULT connectEvent(const Slot2<void,iPlayableService*,int> &event, ePtr<eConnection> &connection);
-       RESULT start();
-       RESULT stop();
-       RESULT pause(ePtr<iPauseableService> &ptr);
-       RESULT info(ePtr<iServiceInformation> &ptr);
+       Signal2<void,iPlayableService*,int> m_event;
        
-               // iServiceInformation
-       RESULT getName(const eServiceReference &ref, std::string &name);
-       RESULT getEvent(ePtr<eServiceEvent> &evt, int nownext);
+       int m_is_pvr, m_is_paused;
 };
 
 #endif