X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fjogshuttle.h;h=b136639abf4727d37e9511fcf965dd61971b6c81;hb=56aee6aedeeed3efd10ada8fe3c229eddc01ef05;hp=9a6ecc0287c5dbb01483b724f49c492e6dc411c7;hpb=2b4a438e09bf373960bcd127dcf6701a74b3ee22;p=kdenlive diff --git a/src/jogshuttle.h b/src/jogshuttle.h index 9a6ecc02..b136639a 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; @@ -45,20 +47,33 @@ public: private: bool m_isWorking; + void handle_event(const struct media_ctrl_event& ev); + void jog(const struct media_ctrl_event& ev); + void shuttle(const struct media_ctrl_event& ev); + void key(const struct media_ctrl_event& ev); + +#ifdef USE_DEPRECATED void handle_event(EV ev); void jog(unsigned int value); void shuttle(int value); void key(unsigned short code, unsigned int value); +#endif }; +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 canonicalDevice(const QString& device); + static DeviceMap enumerateDevices(const QString& devPath); + static int keysCount(const QString& devPath); protected: virtual void customEvent(QEvent * e);