summaryrefslogtreecommitdiffstats
path: root/noatun/modules/infrared/lirc.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commite2de64d6f1beb9e492daf5b886e19933c1fa41dd (patch)
tree9047cf9e6b5c43878d5bf82660adae77ceee097a /noatun/modules/infrared/lirc.h
downloadtdemultimedia-e2de64d6f1beb9e492daf5b886e19933c1fa41dd.tar.gz
tdemultimedia-e2de64d6f1beb9e492daf5b886e19933c1fa41dd.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'noatun/modules/infrared/lirc.h')
-rw-r--r--noatun/modules/infrared/lirc.h75
1 files changed, 75 insertions, 0 deletions
diff --git a/noatun/modules/infrared/lirc.h b/noatun/modules/infrared/lirc.h
new file mode 100644
index 00000000..e5380c5c
--- /dev/null
+++ b/noatun/modules/infrared/lirc.h
@@ -0,0 +1,75 @@
+
+#ifndef _LIRC_H_
+#define _LIRC_H_
+
+#include <qobject.h>
+#include <qstringlist.h>
+#include <qmap.h>
+
+class QSocket;
+
+typedef QMap<QString, QStringList> Remotes;
+
+class Lirc : public QObject
+{
+Q_OBJECT
+public:
+ /**
+ * Constructor
+ */
+ Lirc(QObject *parent);
+ /**
+ * Destructor
+ */
+ virtual ~Lirc();
+
+ /**
+ * Returns true if the connection to lircd is operational
+ */
+ bool isConnected() const { return m_socket; }
+ /**
+ * The names of the remote configured controls
+ */
+ const QStringList remotes() const;
+ /**
+ * The names of the buttons for the specified
+ * remote control
+ */
+ const QStringList buttons(const QString &remote) const
+ {
+ return m_remotes[remote];
+ }
+
+signals:
+ /**
+ * Emitted when the list of controls / buttons was cmpletely read
+ */
+ void remotesRead();
+ /**
+ * Emitted when a IR command was received
+ *
+ * The arguments are the name of the remote control used,
+ * the name of the button pressed and the repeat counter.
+ *
+ * The signal is emitted repeatedly as long as the button
+ * on the remote control remains pressed.
+ * The repeat counter starts with 0 and increases
+ * every time this signal is emitted.
+ */
+ void commandReceived(const QString &, const QString &, int);
+
+private slots:
+ void slotRead();
+
+private:
+ void update();
+ const QString readLine();
+ void sendCommand(const QString &);
+
+private:
+ QSocket *m_socket;
+ Remotes m_remotes;
+};
+
+#endif
+