remove ugly SIGUSR1 loop once again
[enigma2.git] / lib / service / servicedvbrecord.h
index 6a58fc84cdb0972c69b2c96ae4efd401feda5621..17de033e190b18629f386538ea589d195fe799f0 100644 (file)
 #include <lib/service/servicedvb.h>
 
 class eDVBServiceRecord: public eDVBServiceBase,
-       public iRecordableService, public Object
+       public iRecordableService, 
+       public iStreamableService,
+       public Object
 {
-DECLARE_REF(eDVBServiceRecord);
+       DECLARE_REF(eDVBServiceRecord);
 public:
        RESULT connectEvent(const Slot2<void,iRecordableService*,int> &event, ePtr<eConnection> &connection);
        RESULT prepare(const char *filename, time_t begTime, time_t endTime, int eit_event_id);
-       RESULT start();
+       RESULT prepareStreaming();
+       RESULT start(bool simulate=false);
        RESULT stop();
-       RESULT getError(int &error) { error = m_error; m_error = 0; return 0; }
+       RESULT stream(ePtr<iStreamableService> &ptr);
+       RESULT getError(int &error) { error = m_error; return 0; }
+       RESULT frontendInfo(ePtr<iFrontendInformation> &ptr);
+
+               /* streamable service */
+       PyObject *getStreamingData();
+
 private:
        enum { stateIdle, statePrepared, stateRecording };
+       bool m_simulate;
        int m_state, m_want_record;
        friend class eServiceFactoryDVB;
        eDVBServiceRecord(const eServiceReferenceDVB &ref);
@@ -29,20 +39,23 @@ private:
        eServiceReferenceDVB m_ref;
        
        ePtr<iDVBTSRecorder> m_record;
+       ePtr<eConnection>       m_con_record_event;
        
        int m_recording, m_tuned, m_error;
        std::set<int> m_pids_active;
        std::string m_filename;
        int m_target_fd;
+       int m_streaming;
        
        int doPrepare();
        int doRecord();
-       RESULT frontendInfo(ePtr<iFrontendInformation> &ptr);
 
                        /* events */
        void serviceEvent(int event);
        Signal2<void,iRecordableService*,int> m_event;
-
+       
+                       /* recorder events */
+       void recordEvent(int event);
 };
 
 #endif