#ifndef SHUTTLE_H
#define SHUTTLE_H
-#include <qthread.h>
+#include <QThread>
#include <QObject>
+#include <QMap>
#include <linux/input.h>
public:
virtual void run();
- void init(QObject *parent, QString device);
+ void init(QObject *parent, const QString &device);
QObject *m_parent;
int shuttlevalue;
int shuttlecounter;
void key(unsigned short code, unsigned int value);
};
+typedef QMap<QString, QString> DeviceMap;
+typedef QMap<QString, QString>::iterator DeviceMapIter;
class JogShuttle: public QObject
{
-Q_OBJECT public:
- explicit JogShuttle(QString device, QObject * parent = 0);
+ Q_OBJECT
+public:
+ explicit JogShuttle(const QString &device, QObject * parent = 0);
~JogShuttle();
void stopDevice();
- void initDevice(QString device);
+ void initDevice(const QString &device);
+ static QString enumerateDevice(const QString& device);
+ static DeviceMap enumerateDevices(const QString& devPath);
protected:
virtual void customEvent(QEvent * e);