diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2015-07-06 10:42:28 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2015-07-06 10:47:48 +0200 |
commit | fcb8ca75c0c274be2321f0ba91e9f129ae63e354 (patch) | |
tree | 61dcae88917894e00da2c1e622a26567e1a4e01c | |
parent | faab09446c5c26b96e59218abc34b1dc24727418 (diff) |
ht: initial camera dialog
It doesn't work while tracking. Can't pass DirectShow handle through
shared memory.
-rw-r--r-- | CMakeLists.txt | 10 | ||||
-rw-r--r-- | ftnoir_tracker_ht/ftnoir_tracker_ht.cpp | 6 | ||||
-rw-r--r-- | ftnoir_tracker_ht/ftnoir_tracker_ht.h | 5 | ||||
-rw-r--r-- | 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 <QObject> #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<Tracker> { 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 @@ <x>0</x> <y>0</y> <width>354</width> - <height>158</height> + <height>179</height> </rect> </property> <property name="sizePolicy"> @@ -29,6 +29,13 @@ <string>HT tracker settings</string> </property> <layout class="QGridLayout" name="gridLayout"> + <item row="1" column="0"> + <widget class="QLabel" name="label_2"> + <property name="text"> + <string>Frames per second</string> + </property> + </widget> + </item> <item row="0" column="1"> <widget class="QDoubleSpinBox" name="cameraFOV"> <property name="locale"> @@ -52,13 +59,6 @@ </property> </widget> </item> - <item row="1" column="0"> - <widget class="QLabel" name="label_2"> - <property name="text"> - <string>Frames per second</string> - </property> - </widget> - </item> <item row="1" column="1"> <widget class="QComboBox" name="cameraFPS"> <item> @@ -88,23 +88,9 @@ </item> </widget> </item> - <item row="2" column="0"> - <widget class="QLabel" name="label_3"> - <property name="text"> - <string>Camera name</string> - </property> - </widget> - </item> <item row="2" column="1"> <widget class="QComboBox" name="cameraName"/> </item> - <item row="3" column="0"> - <widget class="QLabel" name="label_4"> - <property name="text"> - <string>Resolution</string> - </property> - </widget> - </item> <item row="3" column="1"> <widget class="QComboBox" name="resolution"> <item> @@ -129,13 +115,41 @@ </item> </widget> </item> - <item row="4" column="1"> + <item row="3" column="0"> + <widget class="QLabel" name="label_4"> + <property name="text"> + <string>Resolution</string> + </property> + </widget> + </item> + <item row="2" column="0"> + <widget class="QLabel" name="label_3"> + <property name="text"> + <string>Camera name</string> + </property> + </widget> + </item> + <item row="5" column="1"> <widget class="QDialogButtonBox" name="buttonBox"> <property name="standardButtons"> <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> </property> </widget> </item> + <item row="4" column="0"> + <widget class="QLabel" name="label_5"> + <property name="text"> + <string>Camera settings</string> + </property> + </widget> + </item> + <item row="4" column="1"> + <widget class="QPushButton" name="camera_settings"> + <property name="text"> + <string>Open</string> + </property> + </widget> + </item> </layout> </widget> <resources/> |