fix compiler warning
[enigma2.git] / lib / service / servicedvbrecord.h
1 #ifndef __servicedvbrecord_h
2 #define __servicedvbrecord_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 #include <set>
10
11 #include <lib/service/servicedvb.h>
12
13 class eDVBServiceRecord: public eDVBServiceBase,
14         public iRecordableService, 
15         public iStreamableService,
16         public Object
17 {
18         DECLARE_REF(eDVBServiceRecord);
19 public:
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);
24         RESULT stop();
25         RESULT stream(ePtr<iStreamableService> &ptr);
26         RESULT getError(int &error) { error = m_error; return 0; }
27         RESULT frontendInfo(ePtr<iFrontendInformation> &ptr);
28
29                 /* streamable service */
30         PyObject *getStreamingData();
31
32 private:
33         enum { stateIdle, statePrepared, stateRecording };
34         bool m_simulate;
35         int m_state, m_want_record;
36         friend class eServiceFactoryDVB;
37         eDVBServiceRecord(const eServiceReferenceDVB &ref);
38         
39         eServiceReferenceDVB m_ref;
40         
41         ePtr<iDVBTSRecorder> m_record;
42         ePtr<eConnection>       m_con_record_event;
43         
44         int m_recording, m_tuned, m_error;
45         std::set<int> m_pids_active;
46         std::string m_filename;
47         int m_target_fd;
48         int m_streaming;
49         
50         int doPrepare();
51         int doRecord();
52
53                         /* events */
54         void serviceEvent(int event);
55         Signal2<void,iRecordableService*,int> m_event;
56         
57                         /* recorder events */
58         void recordEvent(int event);
59 };
60
61 #endif