Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(HIDAPI_SRC ${PSMOVEAPI_SOURCE_DIR}/hidapi/mac/hid.c)
ELSE(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
find_package(PkgConfig REQUIRED)
find_package(Threads REQUIRED)

pkg_check_modules(LIBUSB REQUIRED libusb-1.0)
include_directories(${LIBUSB_INCLUDE_DIRS})
list(APPEND PSMOVE_REQUIRED_LIBS ${LIBUSB_LIBRARIES})
list(APPEND PSMOVE_REQUIRED_LIBS ${CMAKE_THREAD_LIBS_INIT})

# Only needed when using hidraw version of hidapi
#pkg_check_modules(UDEV REQUIRED libudev)
Expand Down
14 changes: 7 additions & 7 deletions qt/psmoveqt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ PSMoveQt::count()
}

bool
PSMoveQt::pair()
PSMoveQt::pair() const
{
if (psmove_pair(_move)) {
return true;
Expand All @@ -94,7 +94,7 @@ PSMoveQt::pair()
}

int
PSMoveQt::connectionType()
PSMoveQt::connectionType() const
{
switch (psmove_connection_type(_move)) {
case Conn_USB:
Expand All @@ -115,7 +115,7 @@ PSMoveQt::registerQML()
#endif

bool
PSMoveQt::enabled()
PSMoveQt::enabled() const
{
return _timer.isActive();
}
Expand All @@ -135,7 +135,7 @@ PSMoveQt::setEnabled(bool enabled)
}

int
PSMoveQt::trigger()
PSMoveQt::trigger() const
{
return _trigger;
}
Expand All @@ -162,13 +162,13 @@ PSMoveQt::setIndex(int index)
}

QColor
PSMoveQt::color()
PSMoveQt::color() const
{
return _color;
}

void
PSMoveQt::setColor(QColor color)
PSMoveQt::setColor(const QColor& color)
{
if (_color != color) {
_color = color;
Expand All @@ -180,7 +180,7 @@ PSMoveQt::setColor(QColor color)
}

int
PSMoveQt::rumble()
PSMoveQt::rumble() const
{
return _rumble;
}
Expand Down
28 changes: 14 additions & 14 deletions qt/psmoveqt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class PSMoveQt : public QObject

static int count();

bool pair();
bool pair() const;

enum ButtonType {
Triangle = Btn_TRIANGLE,
Expand All @@ -74,29 +74,29 @@ class PSMoveQt : public QObject
Unknown = Conn_Unknown,
};

int connectionType();
int connectionType() const;

#ifdef QT_DECLARATIVE_LIB
static void registerQML();
#endif

bool enabled();
bool enabled() const;
void setEnabled(bool enabled);
int trigger();
int trigger() const;
void setTrigger(int trigger);
QColor color();
void setColor(QColor color);
int rumble();
QColor color() const;
void setColor(const QColor& color);
int rumble() const;
void setRumble(int rumble);

int ax() { return _ax; }
int ay() { return _ay; }
int az() { return _az; }
int gx() { return _gx; }
int gy() { return _gy; }
int gz() { return _gz; }
int ax() const { return _ax; }
int ay() const { return _ay; }
int az() const { return _az; }
int gx() const { return _gx; }
int gy() const { return _gy; }
int gz() const { return _gz; }

int index() { return _index; }
int index() const { return _index; }
void setIndex(int index);

Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged)
Expand Down