kopia lustrzana https://gitlab.com/eliggett/wfview
Bit of tidying
rodzic
3993046771
commit
80dc5d2df6
|
@ -44,8 +44,8 @@ public slots:
|
||||||
void offEventIndexChanged(int index);
|
void offEventIndexChanged(int index);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum { NONE=0, shuttleXpress, shuttlePro2, RC28, xBoxGamepad, unknownGamepad } usbDevice;
|
|
||||||
|
|
||||||
|
usbDeviceType usbDevice = usbNone;
|
||||||
Ui::controllerSetup* ui;
|
Ui::controllerSetup* ui;
|
||||||
QGraphicsScene* scene;
|
QGraphicsScene* scene;
|
||||||
QGraphicsTextItem* textItem;
|
QGraphicsTextItem* textItem;
|
||||||
|
|
|
@ -167,7 +167,7 @@ void usbController::run()
|
||||||
if (!handle) {
|
if (!handle) {
|
||||||
handle = hid_open(0x0c26, 0x001e, NULL);
|
handle = hid_open(0x0c26, 0x001e, NULL);
|
||||||
if (!handle) {
|
if (!handle) {
|
||||||
usbDevice = NONE;
|
usbDevice = usbNone;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
usbDevice = RC28;
|
usbDevice = RC28;
|
||||||
|
@ -226,7 +226,7 @@ void usbController::run()
|
||||||
void usbController::runTimer()
|
void usbController::runTimer()
|
||||||
{
|
{
|
||||||
int res=1;
|
int res=1;
|
||||||
|
|
||||||
while (res > 0) {
|
while (res > 0) {
|
||||||
QByteArray data(HIDDATALENGTH, 0x0);
|
QByteArray data(HIDDATALENGTH, 0x0);
|
||||||
res = hid_read(handle, (unsigned char*)data.data(), HIDDATALENGTH);
|
res = hid_read(handle, (unsigned char*)data.data(), HIDDATALENGTH);
|
||||||
|
@ -329,6 +329,9 @@ void usbController::runTimer()
|
||||||
BUTTON* butf1 = Q_NULLPTR;
|
BUTTON* butf1 = Q_NULLPTR;
|
||||||
BUTTON* butf2 = Q_NULLPTR;;
|
BUTTON* butf2 = Q_NULLPTR;;
|
||||||
|
|
||||||
|
|
||||||
|
//delayedCmdQue.erase(std::remove_if(delayedCmdQue.begin() + 1, delayedCmdQue.end(), [cmd](const commandtype& c) { return (c.cmd == cmd); }),
|
||||||
|
|
||||||
for (BUTTON* but = buttonList->begin(); but != buttonList->end(); but++) {
|
for (BUTTON* but = buttonList->begin(); but != buttonList->end(); but++) {
|
||||||
if (but->dev == usbDevice) {
|
if (but->dev == usbDevice) {
|
||||||
|
|
||||||
|
|
|
@ -106,7 +106,6 @@ signals:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
hid_device* handle;
|
hid_device* handle;
|
||||||
enum { NONE=0, shuttleXpress, shuttlePro2, RC28, xBoxGamepad, unknownGamepad }usbDevice;
|
|
||||||
bool isOpen=false;
|
bool isOpen=false;
|
||||||
unsigned int buttons=0;
|
unsigned int buttons=0;
|
||||||
unsigned char jogpos=0;
|
unsigned char jogpos=0;
|
||||||
|
@ -126,7 +125,7 @@ private:
|
||||||
#endif
|
#endif
|
||||||
void buttonState(QString but, bool val);
|
void buttonState(QString but, bool val);
|
||||||
void buttonState(QString but, double val);
|
void buttonState(QString but, double val);
|
||||||
|
usbDeviceType usbDevice = usbNone;
|
||||||
protected:
|
protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -194,4 +194,6 @@ enum codecType { LPCM, PCMU, OPUS };
|
||||||
|
|
||||||
enum passbandActions {passbandStatic, pbtInnerMove, pbtOuterMove, pbtMoving, passbandResizing};
|
enum passbandActions {passbandStatic, pbtInnerMove, pbtOuterMove, pbtMoving, passbandResizing};
|
||||||
|
|
||||||
|
enum usbDeviceType { usbNone = 0, shuttleXpress, shuttlePro2, RC28, xBoxGamepad, unknownGamepad };
|
||||||
|
|
||||||
#endif // WFVIEWTYPES_H
|
#endif // WFVIEWTYPES_H
|
||||||
|
|
Ładowanie…
Reference in New Issue