summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--tracker-pt/ftnoir_tracker_pt.cpp3
-rw-r--r--tracker-pt/module/camera.cpp5
-rw-r--r--tracker-pt/module/camera.h2
-rw-r--r--tracker-pt/pt-api.hpp2
-rw-r--r--tracker-wii/wii_camera.cpp2
-rw-r--r--tracker-wii/wii_camera.h2
6 files changed, 9 insertions, 7 deletions
diff --git a/tracker-pt/ftnoir_tracker_pt.cpp b/tracker-pt/ftnoir_tracker_pt.cpp
index de95a0d4..9abe41ba 100644
--- a/tracker-pt/ftnoir_tracker_pt.cpp
+++ b/tracker-pt/ftnoir_tracker_pt.cpp
@@ -125,8 +125,7 @@ bool Tracker_PT::maybe_reopen_camera()
{
QMutexLocker l(&camera_mtx);
- return camera->start(s.camera_name,
- s.cam_fps, s.cam_res_x, s.cam_res_y);
+ return camera->start(s);
}
void Tracker_PT::set_fov(int value)
diff --git a/tracker-pt/module/camera.cpp b/tracker-pt/module/camera.cpp
index a70698de..99bea617 100644
--- a/tracker-pt/module/camera.cpp
+++ b/tracker-pt/module/camera.cpp
@@ -73,8 +73,11 @@ Camera::result Camera::get_frame(pt_frame& frame_)
return { false, {} };
}
-bool Camera::start(const QString& name, int fps, int res_x, int res_y)
+bool Camera::start(const pt_settings& s)
{
+ int fps = s.cam_fps, res_x = s.cam_res_x, res_y = s.cam_res_y;
+ QString name = s.camera_name;
+
if (fps >= 0 && res_x >= 0 && res_y >= 0)
{
if (cam_desired.name != name ||
diff --git a/tracker-pt/module/camera.h b/tracker-pt/module/camera.h
index e2ba159f..f9b62282 100644
--- a/tracker-pt/module/camera.h
+++ b/tracker-pt/module/camera.h
@@ -23,7 +23,7 @@ struct Camera final : pt_camera
{
Camera(const QString& module_name);
- bool start(const QString& name, int fps, int res_x, int res_y) override;
+ bool start(const pt_settings& s) override;
void stop() override;
result get_frame(pt_frame& Frame) override;
diff --git a/tracker-pt/pt-api.hpp b/tracker-pt/pt-api.hpp
index 741576a1..95152772 100644
--- a/tracker-pt/pt-api.hpp
+++ b/tracker-pt/pt-api.hpp
@@ -75,7 +75,7 @@ struct pt_camera
pt_camera();
virtual ~pt_camera();
- [[nodiscard]] virtual bool start(const QString& name, int fps, int res_x, int res_y) = 0;
+ [[nodiscard]] virtual bool start(const pt_settings& s) = 0;
virtual void stop() = 0;
virtual result get_frame(pt_frame& frame) = 0;
diff --git a/tracker-wii/wii_camera.cpp b/tracker-wii/wii_camera.cpp
index 973d7fab..98d180bf 100644
--- a/tracker-wii/wii_camera.cpp
+++ b/tracker-wii/wii_camera.cpp
@@ -86,7 +86,7 @@ WIICamera::result WIICamera::get_frame(pt_frame& frame_)
return result(true, cam_info);
}
-bool WIICamera::start(const QString&, int, int, int)
+bool WIICamera::start(const pt_settings&)
{
m_pDev = std::make_unique<wiimote>();
m_pDev->ChangedCallback = on_state_change;
diff --git a/tracker-wii/wii_camera.h b/tracker-wii/wii_camera.h
index 3d0ad1aa..038e25e7 100644
--- a/tracker-wii/wii_camera.h
+++ b/tracker-wii/wii_camera.h
@@ -30,7 +30,7 @@ struct WIICamera final : pt_camera
WIICamera(const QString& module_name);
~WIICamera() override;
- bool start(const QString& name, int fps, int res_x, int res_y) override;
+ bool start(const pt_settings&) override;
void stop() override;
result get_frame(pt_frame& Frame) override;