From fcb8ca75c0c274be2321f0ba91e9f129ae63e354 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 6 Jul 2015 10:42:28 +0200 Subject: ht: initial camera dialog It doesn't work while tracking. Can't pass DirectShow handle through shared memory. --- CMakeLists.txt | 10 +++--- ftnoir_tracker_ht/ftnoir_tracker_ht.cpp | 6 ++++ ftnoir_tracker_ht/ftnoir_tracker_ht.h | 5 ++- ftnoir_tracker_ht/ht-trackercontrols.ui | 60 ++++++++++++++++++++------------- 4 files changed, 53 insertions(+), 28 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c45163dc..7046c549 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -367,11 +367,13 @@ if(OpenCV_FOUND) target_link_libraries(opentrack-filter-kalman ${OpenCV_LIBS}) target_include_directories(opentrack-filter-kalman SYSTEM PUBLIC ${OpenCV_INCLUDE_DIRS}) -endif() -opentrack_library(opentrack-tracker-ht ftnoir_tracker_ht) -target_link_libraries(opentrack-tracker-ht opentrack-compat) -link_with_dinput8(opentrack-tracker-ht) + opentrack_library(opentrack-tracker-ht ftnoir_tracker_ht) + target_link_libraries(opentrack-tracker-ht opentrack-compat) + link_with_dinput8(opentrack-tracker-ht) + target_link_libraries(opentrack-tracker-ht ${OpenCV_LIBS}) + target_include_directories(opentrack-tracker-ht SYSTEM PUBLIC ${OpenCV_INCLUDE_DIRS}) +endif() link_with_dinput8(opentrack-tracker-joystick) diff --git a/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp b/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp index b922c0b2..3d142dcb 100644 --- a/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp +++ b/ftnoir_tracker_ht/ftnoir_tracker_ht.cpp @@ -170,6 +170,7 @@ TrackerControls::TrackerControls() tie_setting(s.resolution, ui.resolution); connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel())); connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK())); + connect(ui.camera_settings, SIGNAL(pressed()), this, SLOT(camera_settings())); } void TrackerControls::doOK() @@ -183,3 +184,8 @@ void TrackerControls::doCancel() s.b->reload(); this->close(); } + +void TrackerControls::camera_settings() +{ + open_camera_settings(nullptr, s.camera_name, nullptr); +} diff --git a/ftnoir_tracker_ht/ftnoir_tracker_ht.h b/ftnoir_tracker_ht/ftnoir_tracker_ht.h index cd4ffa16..25839039 100644 --- a/ftnoir_tracker_ht/ftnoir_tracker_ht.h +++ b/ftnoir_tracker_ht/ftnoir_tracker_ht.h @@ -16,6 +16,8 @@ #include #include "opentrack/options.hpp" #include "opentrack/plugin-api.hpp" +#include "opentrack/opencv-camera-dialog.hpp" + using namespace options; struct settings : opts { @@ -50,7 +52,7 @@ private: }; // Widget that has controls for FTNoIR protocol client-settings. -class TrackerControls : public ITrackerDialog +class TrackerControls : public ITrackerDialog, protected camera_dialog { Q_OBJECT public: @@ -65,6 +67,7 @@ private: private slots: void doOK(); void doCancel(); + void camera_settings(); }; #endif diff --git a/ftnoir_tracker_ht/ht-trackercontrols.ui b/ftnoir_tracker_ht/ht-trackercontrols.ui index 0b94ffc5..dd5e57f3 100644 --- a/ftnoir_tracker_ht/ht-trackercontrols.ui +++ b/ftnoir_tracker_ht/ht-trackercontrols.ui @@ -10,7 +10,7 @@ 0 0 354 - 158 + 179 @@ -29,6 +29,13 @@ HT tracker settings + + + + Frames per second + + + @@ -52,13 +59,6 @@ - - - - Frames per second - - - @@ -88,23 +88,9 @@ - - - - Camera name - - - - - - - Resolution - - - @@ -129,13 +115,41 @@ - + + + + Resolution + + + + + + + Camera name + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + Camera settings + + + + + + + Open + + + -- cgit v1.2.3