[mmap] partial revert of 8cef8db4 to disable using mmap file reader
[videoplayer.git] / QShuttlePro.h
blob158cdc97a3cce1f58495e5f232d69bd4c315a465
1 /* ***** BEGIN LICENSE BLOCK *****
3 * The MIT License
5 * Copyright (c) 2008 BBC Research
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal
9 * in the Software without restriction, including without limitation the rights
10 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 * copies of the Software, and to permit persons to whom the Software is
12 * furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included in
15 * all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 * THE SOFTWARE.
25 * ***** END LICENSE BLOCK ***** */
27 #ifndef QSHUTTLEPRO_H
28 #define QSHUTTLEPRO_H
30 #include <QtGui>
32 #include "pthread.h"
34 class QShuttlePro : public QThread {
35 Q_OBJECT
37 public:
39 QShuttlePro();
40 void stop();
42 signals:
43 void jogForward();
44 void jogBackward();
46 void shuttleChanged(int);
47 void shuttleCenter();
48 void shuttleLeft1();
49 void shuttleLeft2();
50 void shuttleLeft3();
51 void shuttleLeft4();
52 void shuttleLeft5();
53 void shuttleLeft6();
54 void shuttleLeft7();
55 void shuttleRight1();
56 void shuttleRight2();
57 void shuttleRight3();
58 void shuttleRight4();
59 void shuttleRight5();
60 void shuttleRight6();
61 void shuttleRight7();
63 void keyPressed(int);
64 void keyReleased(int);
65 void keyChanged(int, int);
67 void key256Pressed();
68 void key257Pressed();
69 void key258Pressed();
70 void key259Pressed();
71 void key260Pressed();
72 void key261Pressed();
73 void key262Pressed();
74 void key263Pressed();
75 void key264Pressed();
76 void key265Pressed();
77 void key266Pressed();
78 void key267Pressed();
79 void key268Pressed();
80 void key269Pressed();
81 void key270Pressed();
83 private:
85 typedef struct
87 short vendor;
88 short product;
89 const char* name;
90 }ShuttleData;
92 int fd;
93 struct timeval lastshuttle;
94 int need_shuttle_center;
95 unsigned int jogvalue;
96 int shuttlevalue;
98 void run();
99 bool running;
100 pthread_t self;
102 int openShuttle();
103 void process_event(struct input_event);
104 void jog(unsigned int value);
105 void shuttle(int value);
106 void key(unsigned int value, unsigned int code);
107 void check_shuttle_center();
110 #endif