|
|
|
@ -7,8 +7,6 @@ import os
|
|
|
|
|
import serial
|
|
|
|
|
from PySide import QtCore
|
|
|
|
|
|
|
|
|
|
from player import ButtonEvent
|
|
|
|
|
|
|
|
|
|
_inputs = {}
|
|
|
|
|
|
|
|
|
|
def _add_input(inputType, inputClass):
|
|
|
|
@ -22,13 +20,14 @@ def get_input(inputType, args, app):
|
|
|
|
|
return _inputs[inputType](app, *args)
|
|
|
|
|
|
|
|
|
|
class BaseInput(QtCore.QThread):
|
|
|
|
|
buttonEvent = QtCore.Signal(int)
|
|
|
|
|
|
|
|
|
|
def __init__(self, app, parent=None):
|
|
|
|
|
super(BaseInput, self).__init__(parent)
|
|
|
|
|
self._app = app
|
|
|
|
|
|
|
|
|
|
def _sendButtonEvent(self, btn):
|
|
|
|
|
if self._app.activeWindow():
|
|
|
|
|
QtCore.QCoreApplication.postEvent(self._app.activeWindow(), ButtonEvent(int(btn)))
|
|
|
|
|
self.buttonEvent.emit(int(btn))
|
|
|
|
|
|
|
|
|
|
@QtCore.Slot(bool)
|
|
|
|
|
def buzzersOpen(self, isOpen):
|
|
|
|
|