diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-01-04 13:06:53 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-01-23 14:16:33 +0100 |
commit | 8ff5c1a349781810a9166128e7840e0ee281e8ae (patch) | |
tree | 5b8808145ef9f3de95ee829dda25d7c106773fef | |
parent | c30f9afc6ef614167969d3d76395f3804c7889c4 (diff) |
[MERGE] opentrack: add UI_NO_VIDEO_FRAME
-rw-r--r-- | opentrack/defs.hpp | 19 | ||||
-rw-r--r-- | opentrack/main-window.cpp | 19 | ||||
-rw-r--r-- | opentrack/main-window.hpp | 6 |
3 files changed, 34 insertions, 10 deletions
diff --git a/opentrack/defs.hpp b/opentrack/defs.hpp index e3826474..64c45095 100644 --- a/opentrack/defs.hpp +++ b/opentrack/defs.hpp @@ -1,14 +1,17 @@ #pragma once -//#define UI_FORCED_TRACKER "pt" -//#define UI_FORCED_FILTER "accela" +#define UI_FORCED_TRACKER "neuralnet" +#define UI_FORCED_FILTER "accela" -//#define UI_NO_TRACKER_COMBOBOX -//#define UI_NO_FILTER_COMBOBOX +#define UI_NO_TRACKER_COMBOBOX +#define UI_NO_FILTER_COMBOBOX -//#define UI_NO_TRACKER_SETTINGS_BUTTON -//#define UI_NO_FILTER_SETTINGS_BUTTON +#define UI_NO_TRACKER_SETTINGS_BUTTON +#define UI_NO_FILTER_SETTINGS_BUTTON + +#define UI_NO_RAW_DATA +#define UI_NO_GAME_DATA +//#define UI_NO_VIDEO_FEED -//#define UI_NO_RAW_DATA -//#define UI_NO_GAME_DATA //define UI_ACCELA_OLD_STAIRCASE + diff --git a/opentrack/main-window.cpp b/opentrack/main-window.cpp index deccbc5a..71ab96f5 100644 --- a/opentrack/main-window.cpp +++ b/opentrack/main-window.cpp @@ -67,6 +67,10 @@ main_window::main_window() : State(OPENTRACK_BASE_PATH + OPENTRACK_LIBRARY_PATH) connect(&*s.b, &options::bundle_::saving, this, &main_window::register_shortcuts); ui.btnStartTracker->setFocus(); +#ifdef UI_NO_VIDEO_FEED + fake_video_frame.resize(640, 480); + fake_video_frame_parent.setVisible(false); +#endif } void main_window::init_shortcuts() @@ -303,7 +307,11 @@ bool main_window::profile_name_from_dialog(QString& ret) main_window::~main_window() { // stupid ps3 eye has LED issues +#ifndef UI_NO_VIDEO_FEED if (work && ui.video_frame->layout()) +#else + if (work) +#endif { hide(); stop_tracker_(); @@ -411,6 +419,7 @@ void main_window::update_button_state(bool running, bool inertialp) ui.iconcomboTrackerSource->setEnabled(not_running); #endif ui.profile_button->setEnabled(not_running); +#ifndef UI_NO_VIDEO_FEED ui.video_frame_label->setVisible(not_running || inertialp); if(not_running) { @@ -419,6 +428,7 @@ void main_window::update_button_state(bool running, bool inertialp) else { ui.video_frame_label->setPixmap(QPixmap(":/images/no-feed.png")); } +#endif } void main_window::start_tracker_() @@ -426,7 +436,12 @@ void main_window::start_tracker_() if (work) return; - work = std::make_shared<Work>(pose, ui.video_frame, current_tracker(), current_protocol(), current_filter()); +#ifndef UI_NO_VIDEO_FEED + auto* frame = ui.video_frame; +#else + auto* frame = &fake_video_frame; +#endif + work = std::make_shared<Work>(pose, frame, current_tracker(), current_protocol(), current_filter()); if (!work->is_ok()) { @@ -460,7 +475,7 @@ void main_window::start_tracker_() // NB check valid since SelectedLibraries ctor called // trackers take care of layout state updates - const bool is_inertial = ui.video_frame->layout() == nullptr; + const bool is_inertial = frame->layout() == nullptr; update_button_state(true, is_inertial); ui.btnStopTracker->setFocus(); diff --git a/opentrack/main-window.hpp b/opentrack/main-window.hpp index ddb6b725..1dcbd0eb 100644 --- a/opentrack/main-window.hpp +++ b/opentrack/main-window.hpp @@ -8,6 +8,7 @@ #pragma once +#include "opentrack/defs.hpp" #include "api/plugin-support.hpp" #include "gui/mapping-dialog.hpp" #include "gui/options-dialog.hpp" @@ -50,6 +51,11 @@ class main_window final : public QMainWindow, private State Shortcuts global_shortcuts; QShortcut kbd_quit { QKeySequence("Ctrl+Q"), this }; +#ifdef UI_NO_VIDEO_FEED + QWidget fake_video_frame_parent; + QFrame fake_video_frame{&fake_video_frame_parent}; +#endif + std::unique_ptr<options_dialog> options_widget; std::unique_ptr<mapping_dialog> mapping_widget; |