From e42a0361c986c39a9456226f1465a7fb721fe111 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 16 Feb 2018 11:07:57 +0100 Subject: tracker/{pt,wii}: simplify api Remove useless abstract member functions, simplify some. Issue: #718 --- tracker-pt/ftnoir_tracker_pt.cpp | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) (limited to 'tracker-pt/ftnoir_tracker_pt.cpp') diff --git a/tracker-pt/ftnoir_tracker_pt.cpp b/tracker-pt/ftnoir_tracker_pt.cpp index af086e5c..243fbd60 100644 --- a/tracker-pt/ftnoir_tracker_pt.cpp +++ b/tracker-pt/ftnoir_tracker_pt.cpp @@ -120,22 +120,12 @@ void Tracker_PT::run() qDebug() << "pt: thread stopped"; } -void Tracker_PT::maybe_reopen_camera() +bool Tracker_PT::maybe_reopen_camera() { QMutexLocker l(&camera_mtx); - pt_camera_open_status status = camera->start(camera_name_to_index(s.camera_name), - s.cam_fps, s.cam_res_x, s.cam_res_y); - - switch (status) - { - case cam_open_error: - break; - case cam_open_ok_change: - break; - case cam_open_ok_no_change: - break; - } + return camera->start(camera_name_to_index(s.camera_name), + s.cam_fps, s.cam_res_x, s.cam_res_y); } void Tracker_PT::set_fov(int value) @@ -156,11 +146,12 @@ module_status Tracker_PT::start_tracker(QFrame* video_frame) //video_widget->resize(video_frame->width(), video_frame->height()); video_frame->show(); - maybe_reopen_camera(); + if (!maybe_reopen_camera()) + return { tr("Can't open camera") }; start(QThread::HighPriority); - return status_ok(); + return {}; } void Tracker_PT::data(double *data) -- cgit v1.2.3