kopia lustrzana https://gitlab.com/eliggett/wfview
Fix compile errors on Linux
rodzic
fbf28be5db
commit
4159e535fc
10
shuttle.cpp
10
shuttle.cpp
|
@ -3,7 +3,7 @@
|
|||
|
||||
shuttle::shuttle()
|
||||
{
|
||||
|
||||
qInfo() << "Starting USB device detection";
|
||||
}
|
||||
|
||||
shuttle::~shuttle()
|
||||
|
@ -75,7 +75,7 @@ void shuttle::run()
|
|||
wchar_t product[MAX_STR];
|
||||
res = hid_get_manufacturer_string(handle, manufacturer, MAX_STR);
|
||||
res = hid_get_product_string(handle, product, MAX_STR);
|
||||
qDebug() << QString("Found Device: %0 from %1").arg(QString::fromWCharArray(product)).arg(QString::fromWCharArray(manufacturer));
|
||||
qInfo() << QString("Found Device: %0 from %1").arg(QString::fromWCharArray(product)).arg(QString::fromWCharArray(manufacturer));
|
||||
hid_set_nonblocking(handle, 1);
|
||||
QTimer::singleShot(0, this, SLOT(runTimer()));
|
||||
}
|
||||
|
@ -90,7 +90,7 @@ void shuttle::runTimer()
|
|||
;//printf("waiting...\n");
|
||||
else if (res < 0)
|
||||
{
|
||||
qDebug() << "USB Device disconnected?";
|
||||
qInfo() << "USB Device disconnected?";
|
||||
hid_close(handle);
|
||||
QTimer::singleShot(1000, this, SLOT(run()));
|
||||
return;
|
||||
|
@ -104,7 +104,7 @@ void shuttle::runTimer()
|
|||
<< hex << (unsigned char)data[3] << ":"
|
||||
<< hex << (unsigned char)data[4];
|
||||
|
||||
unsigned int tempButtons = unsigned int((unsigned char)data[3] | (unsigned char)data[4] << 8);
|
||||
unsigned int tempButtons = (unsigned int)((unsigned char)data[3] | (unsigned char)data[4] << 8);
|
||||
unsigned char tempJogpos = (unsigned char)data[1];
|
||||
unsigned char tempShutpos = (unsigned char)data[0];
|
||||
|
||||
|
@ -161,7 +161,7 @@ void shuttle::runTimer()
|
|||
emit button7(true);
|
||||
}
|
||||
|
||||
buttons = unsigned int((unsigned char)data[3] | (unsigned char)data[4] << 8);
|
||||
buttons = (unsigned int)((unsigned char)data[3] | (unsigned char)data[4] << 8);
|
||||
jogpos = (unsigned char)data[1];
|
||||
shutpos = (unsigned char)data[0];
|
||||
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
#define SHUTTLE_H
|
||||
|
||||
#include <iostream>
|
||||
#include <qthread >
|
||||
#include <QThread>
|
||||
#include <QCoreApplication>
|
||||
#include <QTimer>
|
||||
#include "hidapi.h"
|
||||
#include "hidapi/hidapi.h"
|
||||
|
||||
#ifndef Q_OS_WIN
|
||||
//Headers needed for sleeping.
|
||||
|
@ -65,4 +65,4 @@ protected:
|
|||
};
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -6,8 +6,6 @@
|
|||
|
||||
QT += core gui serialport network multimedia
|
||||
|
||||
QT += usb
|
||||
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport
|
||||
|
||||
TARGET = wfview
|
||||
|
@ -92,7 +90,7 @@ CONFIG(debug, release|debug) {
|
|||
}
|
||||
|
||||
#linux:LIBS += -L./ -l$$QCPLIB -lpulse -lpulse-simple -lpthread
|
||||
linux:LIBS += -L./ -l$$QCPLIB -lhidapi
|
||||
linux:LIBS += -L./ -l$$QCPLIB -lhidapi-libusb
|
||||
macx:LIBS += -framework CoreAudio -framework CoreFoundation -lpthread
|
||||
|
||||
win32:LIBS += -L../hidapi/windows/release -lhidapi
|
||||
|
@ -129,7 +127,7 @@ SOURCES += main.cpp\
|
|||
repeatersetup.cpp \
|
||||
rigctld.cpp \
|
||||
ring/ring.cpp \
|
||||
shuttle.cpp
|
||||
shuttle.cpp
|
||||
|
||||
HEADERS += wfmain.h \
|
||||
commhandler.h \
|
||||
|
@ -155,7 +153,7 @@ HEADERS += wfmain.h \
|
|||
rigctld.h \
|
||||
ulaw.h \
|
||||
ring/ring.h \
|
||||
shuttle.h
|
||||
shuttle.h
|
||||
|
||||
|
||||
FORMS += wfmain.ui \
|
||||
|
|
Ładowanie…
Reference in New Issue