MythTV  0.26-pre
lirc.h
Go to the documentation of this file.
00001 #ifndef LIRC_H_
00002 #define LIRC_H_
00003 
00004 #include <QByteArray>
00005 #include <QString>
00006 #include <QObject>
00007 #include <QMutex>
00008 #include <QList>
00009 
00010 #include <sys/types.h>   // for uint
00011 
00012 #include "mthread.h"
00013 
00014 class LIRCPriv;
00015 
00024 class LIRC : public QObject, public MThread
00025 {
00026     Q_OBJECT
00027   public:
00028     LIRC(QObject *main_window,
00029          const QString &lircd_device,
00030          const QString &our_program,
00031          const QString &config_file);
00032     bool Init(void);
00033 
00034     virtual void start(void);
00035     virtual void deleteLater(void);
00036 
00037   private:
00038     virtual ~LIRC();
00039     void TeardownAll();
00040 
00041     bool IsDoRunSet(void) const;
00042     virtual void run(void);
00043     QList<QByteArray> GetCodes(void);
00044     void Process(const QByteArray &data);
00045 
00046     mutable QMutex  lock;
00047     static  QMutex  lirclib_lock;
00048     QObject        *m_mainWindow;  
00049     QString         lircdDevice;   
00050     QString         program;       
00051     QString         configFile;    
00052     bool            doRun;
00053     uint            buf_offset;
00054     QByteArray      buf;
00055     uint            eofCount;
00056     uint            retryCount;
00057     LIRCPriv       *d;
00058 };
00059 
00060 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends