4 #include <lib/service/iservice.h>
5 #include <lib/dvb/idvb.h>
7 #include <lib/dvb/pmt.h>
8 #include <lib/dvb/eit.h>
9 #include <lib/base/filepush.h>
11 class eServiceFactoryDVB: public iServiceHandler
13 DECLARE_REF(eServiceFactoryDVB);
16 virtual ~eServiceFactoryDVB();
20 RESULT play(const eServiceReference &, ePtr<iPlayableService> &ptr);
21 RESULT record(const eServiceReference &, ePtr<iRecordableService> &ptr);
22 RESULT list(const eServiceReference &, ePtr<iListableService> &ptr);
23 RESULT info(const eServiceReference &, ePtr<iStaticServiceInformation> &ptr);
24 RESULT offlineOperations(const eServiceReference &, ePtr<iServiceOfflineOperations> &ptr);
26 RESULT lookupService(ePtr<eDVBService> &ptr, const eServiceReference &ref);
31 class eDVBServiceList: public iListableService, public iMutableServiceList
33 DECLARE_REF(eDVBServiceList);
35 virtual ~eDVBServiceList();
36 RESULT getContent(std::list<eServiceReference> &list, bool sorted=false);
37 RESULT getContent(PyObject *list, bool sorted=false);
38 RESULT getNext(eServiceReference &ptr);
39 int compareLessEqual(const eServiceReference &a, const eServiceReference &b);
41 RESULT startEdit(ePtr<iMutableServiceList> &);
42 RESULT flushChanges();
43 RESULT addService(eServiceReference &ref);
44 RESULT removeService(eServiceReference &ref);
45 RESULT moveService(eServiceReference &ref, int pos);
46 RESULT setListName(const std::string &name);
49 eServiceReference m_parent;
50 friend class eServiceFactoryDVB;
51 eDVBServiceList(const eServiceReference &parent);
52 ePtr<iDVBChannelListQuery> m_query;
54 /* for editing purposes. WARNING: lifetime issue! */
58 class eDVBServicePlay: public iPlayableService, public iPauseableService,
59 public iSeekableService, public Object, public iServiceInformation,
60 public iAudioTrackSelection, public iFrontendStatusInformation,
61 public iSubserviceList, public iTimeshiftService
63 DECLARE_REF(eDVBServicePlay);
65 virtual ~eDVBServicePlay();
68 RESULT connectEvent(const Slot2<void,iPlayableService*,int> &event, ePtr<eConnection> &connection);
71 RESULT seek(ePtr<iSeekableService> &ptr);
72 RESULT pause(ePtr<iPauseableService> &ptr);
73 RESULT info(ePtr<iServiceInformation> &ptr);
74 RESULT audioTracks(ePtr<iAudioTrackSelection> &ptr);
75 RESULT frontendStatusInfo(ePtr<iFrontendStatusInformation> &ptr);
76 RESULT subServices(ePtr<iSubserviceList> &ptr);
77 RESULT timeshift(ePtr<iTimeshiftService> &ptr);
82 RESULT setSlowMotion(int ratio);
83 RESULT setFastForward(int ratio);
86 RESULT getLength(pts_t &len);
87 RESULT seekTo(pts_t to);
88 RESULT seekRelative(int direction, pts_t to);
89 RESULT getPlayPosition(pts_t &pos);
90 RESULT setTrickmode(int trick=0);
91 RESULT isCurrentlySeekable();
93 // iServiceInformation
94 RESULT getName(std::string &name);
95 RESULT getEvent(ePtr<eServiceEvent> &evt, int nownext);
97 std::string getInfoString(int w);
99 // iAudioTrackSelection
100 int getNumberOfTracks();
101 RESULT selectTrack(unsigned int i);
102 RESULT getTrackInfo(struct iAudioTrackInfo &, unsigned int n);
104 // iFrontendStatusInformation
105 int getFrontendInfo(int w);
108 int getNumberOfSubservices();
109 RESULT getSubservice(eServiceReference &subservice, unsigned int n);
112 RESULT startTimeshift();
113 RESULT stopTimeshift();
114 int isTimeshiftActive();
115 RESULT activateTimeshift();
118 friend class eServiceFactoryDVB;
119 eServiceReference m_reference;
121 ePtr<eDVBService> m_dvb_service;
123 ePtr<iTSMPEGDecoder> m_decoder;
125 /* in timeshift mode, we essentially have two channels, and thus pmt handlers. */
126 eDVBServicePMTHandler m_service_handler, m_service_handler_timeshift;
127 eDVBServiceEITHandler m_event_handler;
129 eDVBServicePlay(const eServiceReference &ref, eDVBService *service);
133 void serviceEvent(int event);
134 void serviceEventTimeshift(int event);
135 Signal2<void,iPlayableService*,int> m_event;
137 int m_is_pvr, m_is_paused, m_timeshift_enabled, m_timeshift_active;
139 std::string m_timeshift_file;
142 ePtr<iDVBDemux> m_decode_demux;
144 int m_current_audio_stream;
145 int selectAudioStream(int n);
147 ePtr<iDVBTSRecorder> m_record;
148 std::set<int> m_pids_active;
150 void updateTimeshiftPids();
152 void switchToTimeshift();
154 void updateDecoder();
158 ePtr<eCueSheet> m_cue;