X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fjogshuttle.h;h=b136639abf4727d37e9511fcf965dd61971b6c81;hb=56aee6aedeeed3efd10ada8fe3c229eddc01ef05;hp=2c28d88fc1238e1d6e9b78d1610a9a7002410153;hpb=16e43620d9ff9e432ea91ded529f1e365d03fd52;p=kdenlive diff --git a/src/jogshuttle.h b/src/jogshuttle.h index 2c28d88f..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; - bool shuttlechange; + 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);