X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fjogshuttle.h;h=36e1f4c8df435725f66149b98a5ea2d1a7ee3940;hb=b2f37cecd90d42af8cc8f655462c91cf6624cb01;hp=9a6ecc0287c5dbb01483b724f49c492e6dc411c7;hpb=27bd91107e757db52b4b9b00ef0b8f262839043d;p=kdenlive diff --git a/src/jogshuttle.h b/src/jogshuttle.h index 9a6ecc02..36e1f4c8 100644 --- a/src/jogshuttle.h +++ b/src/jogshuttle.h @@ -21,11 +21,13 @@ #ifndef SHUTTLE_H #define SHUTTLE_H -#include +#include #include +#include #include - +#include +#include typedef struct input_event EV; @@ -34,7 +36,7 @@ class ShuttleThread : public QThread public: virtual void run(); - void init(QObject *parent, QString device); + void init(QObject *parent, const QString &device); QObject *m_parent; int shuttlevalue; int shuttlecounter; @@ -46,19 +48,29 @@ public: private: bool m_isWorking; void handle_event(EV ev); + void handle_event(struct media_ctrl_event ev); + void jog(struct media_ctrl_event ev); void jog(unsigned int value); void shuttle(int value); + void shuttle(struct media_ctrl_event ev); void key(unsigned short code, unsigned int value); + void key(struct media_ctrl_event ev); }; +typedef QMap DeviceMap; +typedef QMap::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); + static int keysCount(const QString& devPath); protected: virtual void customEvent(QEvent * e);