+void ShuttleThread::key(struct media_ctrl_event ev)
+{
+ if (ev.value == KEY_PRESS) {
+ int code = ev.index + 1;
+ QApplication::postEvent(m_parent,
+ new QEvent((QEvent::Type)(KEY_EVENT_OFFSET + code)));
+ }
+}
+
+void ShuttleThread::shuttle(struct media_ctrl_event ev)
+{
+ int value = ev.value / 2;
+
+ if (value > MAX_SHUTTLE_RANGE || value < -MAX_SHUTTLE_RANGE) {
+ kDebug() << "Jog shuttle value is out of range: " << MAX_SHUTTLE_RANGE;
+ return;
+ }
+
+ QApplication::postEvent(m_parent,
+ new QEvent((QEvent::Type) (JOG_STOP + (value))));
+}
+
+void ShuttleThread::jog(struct media_ctrl_event ev)
+{
+ if (ev.value < 0)
+ QApplication::postEvent(m_parent, new QEvent((QEvent::Type) JOG_BACK1));
+ else if (ev.value > 0)
+ QApplication::postEvent(m_parent, new QEvent((QEvent::Type) JOG_FWD1));
+}
+