diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-12-03 22:23:08 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-12-04 12:19:26 +0100 |
commit | b256886a5cb9f2ae3ebda70a2045b19ed9f4233e (patch) | |
tree | 4fa1e46de224cf834a05824dc1eb86001bdb3300 /tracker-rift-042 | |
parent | e89709a801e7874bc02c66848c638c6a0ccc85c1 (diff) |
api: add status check for modules
Diffstat (limited to 'tracker-rift-042')
-rw-r--r-- | tracker-rift-042/ftnoir_tracker_rift_042.cpp | 11 | ||||
-rw-r--r-- | tracker-rift-042/ftnoir_tracker_rift_042.h | 6 |
2 files changed, 7 insertions, 10 deletions
diff --git a/tracker-rift-042/ftnoir_tracker_rift_042.cpp b/tracker-rift-042/ftnoir_tracker_rift_042.cpp index 0e52812d..c8ced38f 100644 --- a/tracker-rift-042/ftnoir_tracker_rift_042.cpp +++ b/tracker-rift-042/ftnoir_tracker_rift_042.cpp @@ -36,22 +36,17 @@ rift_tracker_042::~rift_tracker_042() ovr_Shutdown(); } -void rift_tracker_042::start_tracker(QFrame*) +module_status rift_tracker_042::start_tracker(QFrame*) { ovr_Initialize(); hmd = ovrHmd_Create(0); if (hmd) { ovrHmd_ConfigureTracking(hmd, ovrTrackingCap_Orientation | ovrTrackingCap_MagYawCorrection | ovrTrackingCap_Position, ovrTrackingCap_Orientation); + return status_ok(); } else - { - QMessageBox::warning(nullptr, - "Error", - QCoreApplication::translate("rift_tracker_042", "Unable to start Rift tracker: %1").arg(ovrHmd_GetLastError(nullptr)), - QMessageBox::Ok, - QMessageBox::NoButton); - } + return error(tr("Unable to start Rift tracker: %1").arg(ovrHmd_GetLastError(nullptr))); } diff --git a/tracker-rift-042/ftnoir_tracker_rift_042.h b/tracker-rift-042/ftnoir_tracker_rift_042.h index 82081085..630878b9 100644 --- a/tracker-rift-042/ftnoir_tracker_rift_042.h +++ b/tracker-rift-042/ftnoir_tracker_rift_042.h @@ -21,12 +21,14 @@ struct settings : opts { {} }; -class rift_tracker_042 : public ITracker +class rift_tracker_042 : public QObject, public ITracker { + Q_OBJECT + public: rift_tracker_042(); virtual ~rift_tracker_042() override; - void start_tracker(QFrame *) override; + module_status start_tracker(QFrame *) override; void data(double *data) override; private: double old_yaw; |