X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fjogshuttle.h;h=b136639abf4727d37e9511fcf965dd61971b6c81;hb=a7a883757867c177be234cb2a05bb9ce47cc562c;hp=5e9e269ecf8e4649742b6fc7da9222096a145184;hpb=c42a026234a44a2d766e57bc64a6ac7bbd094000;p=kdenlive diff --git a/src/jogshuttle.h b/src/jogshuttle.h index 5e9e269e..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: - QString m_device; 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 jogshuttle(unsigned short code, unsigned int value); 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); @@ -67,11 +82,9 @@ private: ShuttleThread m_shuttleProcess; signals: - void rewind1(); - void forward1(); - void rewind(double); - void forward(double); - void stop(); + void jogBack(); + void jogForward(); + void shuttlePos(int); void button(int); };