-
Notifications
You must be signed in to change notification settings - Fork 345
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #5583. Allow LIRC device to be set and allow LIRC to be reset e…
…xternally. This makes setting up a machine with multiple LIRC devices a simpler affair. git-svn-id: http://svn.mythtv.org/svn/trunk@19499 7dbf422c-18fa-0310-86e9-fd20926502f2
- Loading branch information
1 parent
693a55c
commit 2aa4aa5
Showing
8 changed files
with
629 additions
and
168 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,53 @@ | ||
#ifndef LIRC_H_ | ||
#define LIRC_H_ | ||
|
||
#include <QThread> | ||
#include <QByteArray> | ||
#include <QString> | ||
#include <QObject> | ||
#include <QThread> | ||
#include <QMutex> | ||
#include <QList> | ||
|
||
#include <lirc/lirc_client.h> | ||
class LIRCPriv; | ||
|
||
/** \class LircThread | ||
* \brief Interface between mythtv and lircd | ||
* | ||
* Create connection to the lircd daemon and translate remote keypresses | ||
* into custom events which are posted to the mainwindow. | ||
*/ | ||
class LircThread : public QThread | ||
class LIRC : public QThread | ||
{ | ||
Q_OBJECT | ||
public: | ||
LircThread(QObject *main_window); | ||
~LircThread(); | ||
int Init(const QString &config_file, const QString &program, | ||
bool ignoreExtApp=false); | ||
void Stop(void) { m_bStop = true; } | ||
LIRC(QObject *main_window, | ||
const QString &lircd_device, | ||
const QString &our_program, | ||
const QString &config_file, | ||
const QString &external_app); | ||
bool Init(void); | ||
|
||
private: | ||
void run(void); | ||
void SpawnApp(void); | ||
virtual void start(void); | ||
virtual void deleteLater(void); | ||
|
||
struct lirc_config *m_lircConfig; | ||
QObject *m_mainWindow; | ||
volatile bool m_bStop; | ||
int m_fd; | ||
private: | ||
virtual ~LIRC(); | ||
void TeardownAll(); | ||
|
||
QString m_externalApp; | ||
bool IsDoRunSet(void) const; | ||
virtual void run(void); | ||
void SpawnApp(void); | ||
QList<QByteArray> GetCodes(void); | ||
void Process(const QByteArray &data); | ||
|
||
mutable QMutex lock; | ||
static QMutex lirclib_lock; | ||
QObject *m_mainWindow; ///< window to send key events to | ||
QString lircdDevice; ///< device on which to receive lircd data | ||
QString program; ///< program to extract from config file | ||
QString configFile; ///< file containing LIRC->key mappings | ||
QString m_externalApp; ///< external application for keys | ||
bool doRun; | ||
int lircd_socket; | ||
uint buf_offset; | ||
QByteArray buf; | ||
uint eofCount; | ||
uint retryCount; | ||
LIRCPriv *d; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,7 +47,7 @@ class LircEventLock | |
void unlock(); | ||
|
||
private: | ||
bool m_eventsLocked; | ||
bool events_locked; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters