diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2016-06-09 11:43:04 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-06-09 11:43:04 +0200 |
commit | 7b07d63e8129b620d275845c5d79573aac72a800 (patch) | |
tree | 40677974ca967af42ccd30cd9b8c53c279d35bb5 /tracker-pt/camera.cpp | |
parent | 1b9dcf43be582c2719b9d5bf10b15acd59eac944 (diff) |
tracker/pt: only reset camera input when needed
Diffstat (limited to 'tracker-pt/camera.cpp')
-rw-r--r-- | tracker-pt/camera.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tracker-pt/camera.cpp b/tracker-pt/camera.cpp index c995c11b..85a5a93b 100644 --- a/tracker-pt/camera.cpp +++ b/tracker-pt/camera.cpp @@ -9,9 +9,14 @@ #include <string> #include <QDebug> #include "opentrack-compat/sleep.hpp" +#include "opentrack-compat/camera-names.hpp" -void Camera::set_device_index(int index) +void Camera::set_device(const QString& name) { + const int index = camera_name_to_index(name); + + desired_name = name; + if (desired_index != index) { desired_index = index; @@ -24,6 +29,11 @@ void Camera::set_device_index(int index) } } +QString Camera::get_desired_name() const +{ + return desired_name; +} + void Camera::set_fps(int fps) { if (cam_desired.fps != fps) |