1 #ifndef __servicedvbrecord_h
2 #define __servicedvbrecord_h
4 #include <lib/service/iservice.h>
5 #include <lib/dvb/idvb.h>
7 #include <lib/dvb/pmt.h>
8 #include <lib/dvb/eit.h>
11 #include <lib/service/servicedvb.h>
13 class eDVBServiceRecord: public eDVBServiceBase,
14 public iRecordableService,
15 public iStreamableService,
18 DECLARE_REF(eDVBServiceRecord);
20 RESULT connectEvent(const Slot2<void,iRecordableService*,int> &event, ePtr<eConnection> &connection);
21 RESULT prepare(const char *filename, time_t begTime, time_t endTime, int eit_event_id);
22 RESULT prepareStreaming();
23 RESULT start(bool simulate=false);
25 RESULT stream(ePtr<iStreamableService> &ptr);
26 RESULT getError(int &error) { error = m_error; return 0; }
27 RESULT frontendInfo(ePtr<iFrontendInformation> &ptr);
29 /* streamable service */
30 PyObject *getStreamingData();
33 enum { stateIdle, statePrepared, stateRecording };
35 int m_state, m_want_record;
36 friend class eServiceFactoryDVB;
37 eDVBServiceRecord(const eServiceReferenceDVB &ref);
39 eServiceReferenceDVB m_ref;
41 ePtr<iDVBTSRecorder> m_record;
42 ePtr<eConnection> m_con_record_event;
44 int m_recording, m_tuned, m_error;
45 std::set<int> m_pids_active;
46 std::string m_filename;
54 void serviceEvent(int event);
55 Signal2<void,iRecordableService*,int> m_event;
58 void recordEvent(int event);