diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-04-03 19:49:41 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-04-06 04:29:50 +0200 |
commit | f84cf70bad3833d6860228a080673cfa24aa59d7 (patch) | |
tree | 59011e5d29221c636c279e40df10b0c89e4259f6 /tracker-steamvr | |
parent | fb958d5418304995f04e997cc9df1bda14ebbd83 (diff) |
tracker/steamvr: show device type before serial
Diffstat (limited to 'tracker-steamvr')
-rw-r--r-- | tracker-steamvr/steamvr.cpp | 13 | ||||
-rw-r--r-- | tracker-steamvr/steamvr.hpp | 3 |
2 files changed, 13 insertions, 3 deletions
diff --git a/tracker-steamvr/steamvr.cpp b/tracker-steamvr/steamvr.cpp index ecc738a0..7b75952e 100644 --- a/tracker-steamvr/steamvr.cpp +++ b/tracker-steamvr/steamvr.cpp @@ -85,6 +85,16 @@ void device_list::fill_device_specs(QList<device_spec>& list) continue; } + switch (v->GetTrackedDeviceClass(k)) + { + case vr::ETrackedDeviceClass::TrackedDeviceClass_HMD: + dev.type = "HMD"; break; + case vr::ETrackedDeviceClass::TrackedDeviceClass_Controller: + dev.type = "Controller"; break; + default: + dev.type = "Unknown"; break; + } + dev.model = str; dev.pose = device_states[k]; dev.k = k; @@ -254,7 +264,8 @@ steamvr_dialog::steamvr_dialog() device_list list; for (const device_spec& spec : list.devices()) - ui.device->addItem(QStringLiteral("%1 [%2]").arg(spec.model).arg(spec.serial), QVariant(spec.serial)); + ui.device->addItem(QStringLiteral("<%3> %1 [%2]").arg(spec.model).arg(spec.serial).arg(spec.type), + QVariant(spec.serial)); tie_setting(s.device_serial, ui.device); } diff --git a/tracker-steamvr/steamvr.hpp b/tracker-steamvr/steamvr.hpp index 62815a58..a8903959 100644 --- a/tracker-steamvr/steamvr.hpp +++ b/tracker-steamvr/steamvr.hpp @@ -37,7 +37,7 @@ struct settings : opts struct device_spec { vr::TrackedDevicePose_t pose; - QString model, serial; + QString model, serial, type; unsigned k; }; @@ -98,7 +98,6 @@ public: private: Ui::dialog ui; settings s; - device_list devices; private slots: void doOK(); |