X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fjogshuttle.h;h=b136639abf4727d37e9511fcf965dd61971b6c81;hb=a7a883757867c177be234cb2a05bb9ce47cc562c;hp=e7c0e2097dfaeac434cf23df465bc5134636fffd;hpb=4c78943062f9def895277b8239ad1f369bb42fbc;p=kdenlive diff --git a/src/jogshuttle.h b/src/jogshuttle.h index e7c0e209..b136639a 100644 --- a/src/jogshuttle.h +++ b/src/jogshuttle.h @@ -21,42 +21,59 @@ #ifndef SHUTTLE_H #define SHUTTLE_H -#include +#include #include +#include #include - +#include +#include typedef struct input_event EV; -class ShuttleThread : public QThread { +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); +class JogShuttle: public QObject +{ + 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); @@ -65,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); };