5dd2f3b289bb918b281748d5ceded8825160f72f
[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 };
24
25 class eDVBServiceList: public iListableService
26 {
27 DECLARE_REF(eDVBServiceList);
28 private:
29         eServiceReference m_parent;
30         friend class eServiceFactoryDVB;
31         eDVBServiceList(const eServiceReference &parent);
32 public:
33         virtual ~eDVBServiceList();
34         RESULT getContent(std::list<eServiceReference> &list);
35 };
36
37 class eDVBServicePlay: public iPlayableService, public Object, public iServiceInformation
38 {
39 DECLARE_REF(eDVBServicePlay);
40 private:
41         friend class eServiceFactoryDVB;
42         eServiceReference m_reference;
43         
44         ePtr<iTSMPEGDecoder> m_decoder;
45         
46         eDVBServicePMTHandler m_service_handler;
47         eDVBServiceEITHandler m_event_handler;
48         
49         eDVBServicePlay(const eServiceReference &ref);
50         
51         void gotNewEvent();
52         
53         void serviceEvent(int event);
54         Signal2<void,iPlayableService*,int> m_event;
55 public:
56         virtual ~eDVBServicePlay();
57
58                 // iPlayableService
59         RESULT connectEvent(const Slot2<void,iPlayableService*,int> &event, ePtr<eConnection> &connection);
60         RESULT start();
61         RESULT stop();
62         RESULT pause(ePtr<iPauseableService> &ptr);
63         RESULT info(ePtr<iServiceInformation> &ptr);
64         
65                 // iServiceInformation
66         RESULT getName(const eServiceReference &ref, std::string &name);
67         RESULT getEvent(ePtr<eServiceEvent> &evt, int nownext);
68 };
69
70 #endif