fixed undefined operation on variable 'i' (assuming big endian byte order in source...
[enigma2.git] / lib / base / filepush.h
index ed2dc2ebbbb87d63a9cc4993a28a5b9afc9becc5..7eb79974e7ea3594486739e7195b24ca72abbcf2 100644 (file)
@@ -2,9 +2,11 @@
 #define __lib_base_filepush_h
 
 #include <lib/base/thread.h>
+#include <libsig_comp.h>
+#include <lib/base/message.h>
 #include <sys/types.h>
 
-class eFilePushThread: public eThread
+class eFilePushThread: public eThread, public Object
 {
 public:
        eFilePushThread();
@@ -13,14 +15,25 @@ public:
        void start(int sourcefd, int destfd);
        
        void pause();
-       void seek(off_t where);
+       void seek(int whence, off_t where);
        void resume();
        
+               /* flushes the internal readbuffer */ 
+       void flush();
+       
+       enum { evtEOF, evtReadError, evtWriteError };
+       Signal1<void,int> m_event;
+       
 private:
        int m_stop;
        unsigned char m_buffer[65536];
        int m_buf_start, m_buf_end;
        int m_fd_source, m_fd_dest;
+       
+       eFixedMessagePump<int> m_messagepump;
+       
+       void sendEvent(int evt);
+       void recvEvent(const int &evt);
 };
 
 #endif