X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fjogshuttle.h;h=b136639abf4727d37e9511fcf965dd61971b6c81;hb=56aee6aedeeed3efd10ada8fe3c229eddc01ef05;hp=34673fa65348c697c1b622ae749606273a1c8f64;hpb=60eb4b82541e1560403e52c2d078c0b4b100de7d;p=kdenlive diff --git a/src/jogshuttle.h b/src/jogshuttle.h index 34673fa6..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,31 +36,44 @@ 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; unsigned short jogvalue; bool isWorking(); - bool stop_me; + volatile bool stop_me; QString m_device; 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);