remove new found flags when do a automatic scan and "clear before scan" was
[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();
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         int m_state, m_want_record;
35         friend class eServiceFactoryDVB;
36         eDVBServiceRecord(const eServiceReferenceDVB &ref);
37         
38         eServiceReferenceDVB m_ref;
39         
40         ePtr<iDVBTSRecorder> m_record;
41         ePtr<eConnection>       m_con_record_event;
42         
43         int m_recording, m_tuned, m_error;
44         std::set<int> m_pids_active;
45         std::string m_filename;
46         int m_target_fd;
47         int m_streaming;
48         
49         int doPrepare();
50         int doRecord();
51
52                         /* events */
53         void serviceEvent(int event);
54         Signal2<void,iRecordableService*,int> m_event;
55         
56                         /* recorder events */
57         void recordEvent(int event);
58 };
59
60 #endif