MythTV master
lirc.h
Go to the documentation of this file.
1#ifndef LIRC_H_
2#define LIRC_H_
3
4#include <QByteArray>
5#include <QString>
6#include <QObject>
7#include <QMutex>
8#include <QRecursiveMutex>
9#include <QList>
10
11#include <sys/types.h> // for uint
12
13#include "libmythbase/mthread.h"
14
15class LIRCPriv;
16
25class LIRC : public QObject, public MThread
26{
27 Q_OBJECT
28 public:
29 LIRC(QObject *main_window,
30 QString lircd_device,
31 QString our_program,
32 QString config_file);
33 bool Init(void);
34
35 virtual void start(void);
36 virtual void deleteLater(void);
37
38 private:
39 ~LIRC() override;
40 void TeardownAll();
41
42 bool IsDoRunSet(void) const;
43 void run(void) override; // MThread
44 QList<QByteArray> GetCodes(void);
45 void Process(const QByteArray &data);
46
47 mutable QRecursiveMutex m_lock;
48 static QMutex s_lirclibLock;
49 QObject *m_mainWindow {nullptr};
50 QString m_lircdDevice;
51 QString m_program;
52 QString m_configFile;
53 bool m_doRun {false};
55 QByteArray m_buf;
58 LIRCPriv *d {nullptr}; // NOLINT(readability-identifier-naming)
59};
60
61#endif
Interface between mythtv and lircd.
Definition: lirc.h:26
void Process(const QByteArray &data)
Definition: lirc.cpp:346
QString m_program
program to extract from config file
Definition: lirc.h:51
~LIRC() override
Definition: lirc.cpp:96
uint m_bufOffset
Definition: lirc.h:54
QString m_lircdDevice
device on which to receive lircd data
Definition: lirc.h:50
virtual void start(void)
Definition: lirc.cpp:326
bool IsDoRunSet(void) const
Definition: lirc.cpp:340
static QMutex s_lirclibLock
Definition: lirc.h:48
QString m_configFile
file containing LIRC->key mappings
Definition: lirc.h:52
QObject * m_mainWindow
window to send key events to
Definition: lirc.h:49
QRecursiveMutex m_lock
Definition: lirc.h:47
bool Init(void)
Definition: lirc.cpp:166
uint m_retryCount
Definition: lirc.h:57
bool m_doRun
Definition: lirc.h:53
LIRCPriv * d
Definition: lirc.h:58
QByteArray m_buf
Definition: lirc.h:55
uint m_eofCount
Definition: lirc.h:56
void TeardownAll()
Definition: lirc.cpp:107
void run(void) override
Runs the Qt event loop unless we have a QRunnable, in which case we run the runnable run instead.
Definition: lirc.cpp:417
QList< QByteArray > GetCodes(void)
Definition: lirc.cpp:485
LIRC(QObject *main_window, QString lircd_device, QString our_program, QString config_file)
Definition: lirc.cpp:82
virtual void deleteLater(void)
Definition: lirc.cpp:101
This is a wrapper around QThread that does several additional things.
Definition: mthread.h:49
unsigned int uint
Definition: freesurround.h:24