- split iStaticServiceInformation against iServiceInformation
[openblackhole/openblackhole-enigma2.git] / lib / service / servicedvb.h
1 #ifndef __servicedvb_h
2 #define __servicedvb_h
3
4 #include <lib/service/iservice.h>
5 #include <lib/dvb/idvb.h>
6
7 #include <lib/dvb/pmt.h>
8 #include <lib/dvb/eit.h>
9
10 class eServiceFactoryDVB: public iServiceHandler
11 {
12 DECLARE_REF(eServiceFactoryDVB);
13 public:
14         eServiceFactoryDVB();
15         virtual ~eServiceFactoryDVB();
16         enum { id = 0x1 };
17
18                 // iServiceHandler
19         RESULT play(const eServiceReference &, ePtr<iPlayableService> &ptr);
20         RESULT record(const eServiceReference &, ePtr<iRecordableService> &ptr);
21         RESULT list(const eServiceReference &, ePtr<iListableService> &ptr);
22         RESULT info(const eServiceReference &, ePtr<iStaticServiceInformation> &ptr);
23 private:
24         RESULT lookupService(ePtr<eDVBService> &ptr, const eServiceReference &ref);
25 };
26
27 class eDVBServiceList: public iListableService
28 {
29 DECLARE_REF(eDVBServiceList);
30 private:
31         eServiceReference m_parent;
32         friend class eServiceFactoryDVB;
33         eDVBServiceList(const eServiceReference &parent);
34 public:
35         virtual ~eDVBServiceList();
36         RESULT getContent(std::list<eServiceReference> &list);
37 };
38
39 class eDVBServicePlay: public iPlayableService, public Object, public iServiceInformation
40 {
41 DECLARE_REF(eDVBServicePlay);
42 private:
43         friend class eServiceFactoryDVB;
44         eServiceReference m_reference;
45         
46         ePtr<eDVBService> m_dvb_service;
47         
48         ePtr<iTSMPEGDecoder> m_decoder;
49         
50         eDVBServicePMTHandler m_service_handler;
51         eDVBServiceEITHandler m_event_handler;
52         
53         eDVBServicePlay(const eServiceReference &ref, eDVBService *service);
54         
55         void gotNewEvent();
56         
57         void serviceEvent(int event);
58         Signal2<void,iPlayableService*,int> m_event;
59 public:
60         virtual ~eDVBServicePlay();
61
62                 // iPlayableService
63         RESULT connectEvent(const Slot2<void,iPlayableService*,int> &event, ePtr<eConnection> &connection);
64         RESULT start();
65         RESULT stop();
66         RESULT pause(ePtr<iPauseableService> &ptr);
67         RESULT info(ePtr<iServiceInformation> &ptr);
68         
69                 // iServiceInformation
70         RESULT getName(std::string &name);
71         RESULT getEvent(ePtr<eServiceEvent> &evt, int nownext);
72 };
73
74 #endif